[Howto] Store data on the boot disk

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [Howto] Store data on the boot disk

      Method 4

      Corrected on Aug. 22. 2012
      --Today
      Thanks a seidler2547. Efectivily is posible to use sda3 partition on OMV only formating it.
      --
      We start from an OMV system running and installed on a hard drive that it could be /dev/sda and we want to use part of it as a aditional data storage unit for the system.

      We stop orderly OMV, and with "gparted live" CD or USB (@ sourceforge.net):

      1) reduce the size of the partition /dev/sda1 (system partition) to a reasonable size, eg 8 GiB
      2) extend the size of the primary partition /dev/sda2 to full disk size.
      3) move the extended partition for swap, /dev/sda5 contained in the primary /dev/sda2, from the end, to the beginning of the /dev/sda2
      4) reduce the size of the primary partition /dev/sda2 just to the size of the extended partition /dev/sda5
      5) create a new partition with free disk size /dev/sda3
      --Today
      6) format /dev/sda3 with the type ext4
      ---

      We stop orderly gparted.
      --Yesterday
      We start again OMV and from the CLI we type:

      Source Code

      1. mdadm /dev/md100 --create --force --level=linear --raid-devices=1 /dev/sda3

      and already, in "OMV web gui: raid" we find a raid like this:
      openmediavault:100, /dev/md127, clean, linear, on /dev/sda3
      --
      --Today
      We start again OMV and in the web gui we can look
      storage:filesystems we find a line like this:
      device /dev/sda3 filesystem ext4 Mounted no
      we mount the device and wala....
      --
      Now, we can build on it shared folders and so on, all that we want and ......
      Naturally, this configuration persists after stopping and starting the system

      PpFdez

      The post was edited 1 time, last by ppfdez ().

    • Re: [Howto] Store data on the boot disk

      And another alternative: install the LVM plugin, then proceed as in Method 4, but instead of

      "ppfdez" wrote:


      Source Code

      1. mdadm /dev/md100 --create --force --level=linear --raid-devices=1 /dev/sda3


      one types

      Source Code

      1. pvcreate /dev/sda3


      Then you'll find a new physical volume in the Web GUI, out of which you can create a volume group, a logical volume, and finally a file system on it.

      Stefan
    • Re: [Howto] Store data on the boot disk

      I prefer Method 4 described above. However, I understand you're using mdadm which - if I'm correct - enables raid on the newly created partition (/dev/sda3). If I don't want to use raid, is there a way to use in sda3 in OMV, mount it, format it and use it as part of the NAS?
      Many thanks in advance for your responses
      HP Proliant Microserver N40L - 8Go RAM - ESXi 6 - 1*250Go + 2*3To + 1*650Go - OMV 2.x installed
    • Re: [Howto] Store data on the boot disk

      "tugdualenligne" wrote:

      I prefer Method 4 described above. However, I understand you're using mdadm which - if I'm correct - enables raid on the newly created partition (/dev/sda3). If I don't want to use raid, is there a way to use in sda3 in OMV, mount it, format it and use it as part of the NAS?
      Many thanks in advance for your responses


      Today I know only method 4 with mdadm or lvm or Methods 1, 2 or 3
    • Re: [Howto] Store data on the boot disk

      Unfortunately my account got mistakenly deleted together with all my posts hence I'm re-posting it again for reference. It's a copy from old forum: sourceforge.net/apps/phpbb/ope…&hilit=store+data+on+disk
      Al credits to the original author, marknewfsd

      OpenMediaVault is a wonderful NAS solution if you want to build your own system. Is is derived from FreeNAS but uses GNU/Linux instead of FreeBSD. I am really happy with it, but one thing kept bugging me: For some reason, the developers decided that the main file system containing the OS and configuration can not be used for storage.

      As I am using an old laptop for my NAS system (which is both cost-efficient and eco-friendly), I do not want to sacrifice my whole 320GB harddisk just for configuration files. I have found a way to work around this limitation in a robust fashion.


      I've found 3 ways to do this. (I suggest you to read all the methods and then decide which one is the best for you (Step 3 is the most easiest way).

      Method 1
      Create a file that will act as the container of all your files. There is only one downside of this; you aren't able to change the size of this container later on.
      More information

      Method 2
      Instead of a file you can use a partition on the disk.
      1. You must boot from the live cd and reduce the size of partition where you installed OpenMediaVault.
      2. Create another unallocated partition and then follow the instructions.
      3. Continue Method 1, but skip the creation of the file.
      4. Replace “losetup /dev/loop1 /virtualdisk” to “losetup /dev/loop1 /dev/sda3″ (where sda3 is your new partition).
      5. In lodev script replace “losetup /dev/loop1 /virtualdisk” to “losetup /dev/loop1 /dev/sda3″

      Copyright IlgizKs comment on the website of Method 1

      Method 3
      Volker suggested that I should be able to do this by using mount bind.
      1. Attach an USB stick to your system, mount it.
      2. Open CLI (Command Line Interface) and write these commands:

        Source Code

        1. cd /
        2. mkdir /omv/
        3. cd /media/
        4. ls


      3. Then look which disk is your usb stick.

        Source Code

        1. mount --bind /omv/ /media/usb_stick_name/

        (replace usb_stick_name with the name you see with the ls command)

      4. Source Code

        1. cd ../
        2. cd usb_stick_name


      5. Now create a file by using your favorite file editor. I'll use nano for this;

        Source Code

        1. nano test.txt

        Write something in the document, save it and exit the editor.

      6. Check if the file you created is really there:

        Source Code

        1. cd /omv/
        2. ls


      7. Create a shared folder on this location (by using the Web UI)

      8. Now remove your USB Flashdrive

      9. Check if the share and the folder /media/usb_stick_name are still there.
        Now we've created a solution to store files. All files which are being stored in /media/usb_stick_name will actually be stored in /omv/ (a folder on the first harddisk).
        There is one problem left, this mount command is gone after a reboot. This can be solved by creating a script that will automaticly mount the folder during the boot of the system.

      10. Source Code

        1. nano /etc/init.d/mountfirstdisk

        Write this inside the file:

        Source Code

        1. ! /bin/sh
        2. # /etc/init.d/mountfirstdisk
        3. #
        4. ### BEGIN INIT INFO
        5. # Provides: mountfirstdisk
        6. # Required-Start: $all
        7. # Required-Stop: $all
        8. # Should-Start:
        9. # Should-Stop:
        10. # Default-Start: 2 3 4 5
        11. # Default-Stop: 0 1 6
        12. # Short-Description: Mounts first disk as storage disk
        13. ### END INIT INFO
        14. # Carry out specific functions when asked to by the system
        15. case "$1" in
        16. start)
        17. #echo "Starting script blah "
        18. #echo "Could do more here"
        19. mount --bind /omv/ /media/8040-309A/
        20. ;;
        21. stop)
        22. #echo "Stopping script blah"
        23. #echo "Could do more here"
        24. ;;
        25. *)
        26. echo "Usage: /etc/init.d/mountfirstdisk {start|stop}"
        27. exit 1
        28. ;;
        29. esac
        30. exit 0
        Display All

        Save the file and exit the editor.

        Source Code

        1. update-rc.d mountfirstdisk defaults


      11. Now reboot your system to check if everything works. Now simply create a share on the 'fake' usb stick.


      I've tried Method 3 out and it works wonderfull. However, I've done and written these steps, but I didn't test them afterwards (by using this guide), so in case something isn't working, please tell me. (Sorry for the buggy layout of each step, this is the fault of the forum system here)

      Warning: be sure to test each method first in VirtualBox before applying them into a production system. You don't want to break anything.
    • Re: [Howto] Store data on the boot disk

      I tried to rebuild the array manually as described forums.openmediavault.org/view…p?f=11&t=334&p=1139#p1103
      I get clean array on /dev/md0 but after reboot it switched to /dev/md127... described on next post forums.openmediavault.org/view…p?f=11&t=334&p=1139#p1139

      Is it due to this missing "mdadm /dev/md100 --create --force --level=linear --raid-devices=1 /dev/sda3" step?
    • Re: [Howto] Store data on the boot disk

      I know this is an old thread, I'm kinda hoping that someone can help me out. I used method #3 listed above today. It works good, stuff added/removed from the USB shows as being on the HDD and my free space available is listed as what is remaining on the boot disk.

      My question is, do I have to keep the USB key connected to the server or can I unmount and remove it? If I have to keep it mounted that's fine, I'll just swap out the one I used with a smaller one I never touch. If I can remove it would just unmounting it be good enough or do I have to update the init.d script to do so?
      Asus P5N-D LGA755 MoBo
      Intel Core 2 Quad 2.7 gHz
      8 GB 877Mhz DDR2 RAM
      IBM 1015 flashed to 9221-8i - IT mode w/o Option Rom
      Running OpenMediaVault 2.2.1
      OS => 1x320 GB HDD Partitioned 50/Remain for local storage & downloads
      Media => 4x3TB HDD's Software RAID 5
      Data => 3x500GB HDD's Software RAID 5