Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

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

    • Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      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/usb_stick_name/
        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.[/quote]

      The post was edited 1 time, last by Solo0815: Added Tags ().

    • Re: Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      Method 4.
      Install omv on usb stick.
      Boot with some live distri.
      Partition your hdd . For example sda1 8g ext4, sda2 2g swap, rest extended with atapartition in it.
      Sda1 must be larger than usbstick.
      Now dd if=/dev/sdb1 of =/dev/sda1 bs=4096 (sdb is the usb stick)
      Than rezize2fs /dev/sda1.
      Now the bootmanager grub has to be installed.
      either:
      Boot last time from stick mount sda1 to /mnt and do
      grub-install --no-floppy --recheck --root-directory=/mnt /dev/sda.
      Now you can boot from hd and use /dev/sda5 for data.
      or:
      dd if=/dev/sdb of=/dev/sda bs=446 count=1 (where sdb is USB Stick and sda is Hdd)
      in this case you dont have to reboot the usb stick.
    • Re: Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      I would avoid method 1 (basically create a file and mount that file like a hard drive) because re-partitioning with gparted works very well. So, yes you can re-partition with Ubuntu.
      omv 4.1.8.2 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.8
      omv-extras.org plugins source code and issue tracker - github.com/OpenMediaVault-Plugin-Developers

      Please read this before posting a question.
      Please don't PM for support... Too many PMs!
    • Re: Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      Method 4 is still the best in my opinion.
      omv 4.1.8.2 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.8
      omv-extras.org plugins source code and issue tracker - github.com/OpenMediaVault-Plugin-Developers

      Please read this before posting a question.
      Please don't PM for support... Too many PMs!
    • Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      "Tyberious Funk" wrote:

      Is there a particular reason why OMV doesn't like to share space on the boot drive?

      I think Volker's original intentions were that the boot drive would be small and not needed for data. Also, if the system drive or data drive(s) fail, it would not effect the other.
      omv 4.1.8.2 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.8
      omv-extras.org plugins source code and issue tracker - github.com/OpenMediaVault-Plugin-Developers

      Please read this before posting a question.
      Please don't PM for support... Too many PMs!
    • Re: Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      "dieres" wrote:

      Method 4.
      Install omv on usb stick.
      Boot with some live distri.
      Partition your hdd . For example sda1 8g ext4, sda2 2g swap, rest extended with atapartition in it.
      Sda1 must be larger than usbstick.
      Now dd if=/dev/sdb1 of =/dev/sda1 bs=4096 (sdb is the usb stick)
      Than rezize2fs /dev/sda1.
      Now the bootmanager grub has to be installed.
      either:
      Boot last time from stick mount sda1 to /mnt and do
      grub-install --no-floppy --recheck --root-directory=/mnt /dev/sda.
      Now you can boot from hd and use /dev/sda5 for data.
      or:
      dd if=/dev/sdb of=/dev/sda bs=446 count=1 (where sdb is USB Stick and sda is Hdd)
      in this case you dont have to reboot the usb stick.


      So, from what I understand with this method (#4), you're simply partitioning your HDD like any other linux setup; though you install to a flash drive and clone it the bigger boot partition you created. Thus removing the need to have the flash drive anymore, correct?
      [IMG:http://i1249.photobucket.com/albums/hh516/da-pharoah/Modpic.gif]

      Asus Eee PC 1005PE
      Processor:
      Intel(R) Atom(TM) CPU N450 @ 1.66GHz
      Memory:
      1GB RAM
      Kernel:
      Linux 2.6.32-5-amd64
      Version: 2.0.7 (Stone burner)

      [IMG:http://trakt.tv/user/hakarune/widgets/watched/all-banner.jpg]
    • Re: Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      It is even easier to the following especially if you use partedmagic/gparted

      - install on the drive you intend to use (will call sda)
      - resize the main partition sda1
      - delete swap (sda5) and extended partition (sda2)
      - create new extended partion (sda2)
      - create new swap (sda5)
      - create new data partition (sda6)
      - change the uuid in /etc/fstab for swap to the new uuid which you can find using blkid
      omv 4.1.8.2 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.8
      omv-extras.org plugins source code and issue tracker - github.com/OpenMediaVault-Plugin-Developers

      Please read this before posting a question.
      Please don't PM for support... Too many PMs!
    • Re: Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      worked like a charm
      [IMG:http://i1249.photobucket.com/albums/hh516/da-pharoah/Modpic.gif]

      Asus Eee PC 1005PE
      Processor:
      Intel(R) Atom(TM) CPU N450 @ 1.66GHz
      Memory:
      1GB RAM
      Kernel:
      Linux 2.6.32-5-amd64
      Version: 2.0.7 (Stone burner)

      [IMG:http://trakt.tv/user/hakarune/widgets/watched/all-banner.jpg]
    • Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      It can also be installed in a virtual machine. Once it's setup and working boot the vm with a rescue cd then create a tar ball of the install. On the target computer create a 4 gig partition and a swap partition then tar the tar ball created earlier onto the new partition. Reboot the partition with grub2 and install the grub loader on the mbr. Using blkid find the partition uuid's. adjust the uuid's and and add swap in /etc/fstab. The unused portition of the hard drive then will appear as a usable partition to OMV to do with as you please.
    • Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      I used method 3 and it worked like a charm. Removed the USB and the files/folders I created are still there. Everything stays mounted and I can create files/shares etc. But when I try to create a new MySQL instance I can't see the share created, it only lists the two physical arrays that I have. Under filesystems it lists the drive there but as /dev/disk/by-uuid/diskUUID and as missing but still mounted. Am I doing something wrong? I followed the instructions to the letter.
      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
    • Re: Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      "ryecoaaron" wrote:

      It is even easier to the following especially if you use partedmagic/gparted

      - install on the drive you intend to use (will call sda)
      - resize the main partition sda1
      - delete swap (sda5) and extended partition (sda2)
      - create new extended partion (sda2)
      - create new swap (sda5)
      - create new data partition (sda6)
      - change the uuid in /etc/fstab for swap to the new uuid which you can find using blkid


      I followed these steps and thought everything was working nicely, but I got this issue;

      bugtracker.openmediavault.org/view.php?id=814

      :(
    • Re: Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      Is the web interface working? I have seen the engined not started error plenty of times but it starts moments after that.
      omv 4.1.8.2 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.8
      omv-extras.org plugins source code and issue tracker - github.com/OpenMediaVault-Plugin-Developers

      Please read this before posting a question.
      Please don't PM for support... Too many PMs!
    • Re: Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      "ryecoaaron" wrote:

      Is the web interface working? I have seen the engined not started error plenty of times but it starts moments after that.


      The web interface works, but the daemon still spits out errors.

      I ended up running an update which upgraded some components and the problem disappeared. I don't know whether there was a bug in the older engined or whether the update overwrote some bad settings essentially "fixing" things. But the end result is that it seems to be working ok now.
    • Re: Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      "ryecoaaron" wrote:

      It is even easier to the following especially if you use partedmagic/gparted

      - install on the drive you intend to use (will call sda)
      - resize the main partition sda1
      - delete swap (sda5) and extended partition (sda2)
      - create new extended partion (sda2)
      - create new swap (sda5)
      - create new data partition (sda6)
      - change the uuid in /etc/fstab for swap to the new uuid which you can find using blkid


      I did this but used sda3 for the name of the new partition (didn't have to change the uuid in fstab, they match between the blkid and fstab). Now upon reboot the partition I made doesn't persist, I have to do the following every time.

      1) mdadm /dev/md100 --create --force --level=linear --raid-devices=1 /dev/sda3
      2) mount -a

      Is there a way I can fix this?
      Here's a copy of my blkid output. pastebin.com/PxUnpEgK
      Here is a copy of my fstab pastebin.com/uEkqedvJ
      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
    • Re: Re: [Howto] Store data on the boot disk (Method 1, 2, 3)

      "kidlotus" wrote:


      I did this but used sda3 for the name of the new partition (didn't have to change the uuid in fstab, they match between the blkid and fstab). Now upon reboot the partition I made doesn't persist, I have to do the following every time.


      I assume you when you say the partition doesn't persist, you mean it doesn't stay mounted?

      Your fstab doesn't have an entry for sda3 under the OMV settings. Did you try and mount this drive via the OMV gui?