newly attached USB drive makes OMV unable to reboot

  • Hi guys,


    I have a problem booting OMV when an external USB drive is connected and need your guidance.


    I first installed OMV on the internal hdd (500 GB) of an old PC. When I learned that OMV can't use the remaining space on the internal hdd for my personal data because OMV reserves the whole disk for itself, I installed OMV on a 32 GB USB stick. By doing this, OMV could mount the internal hdd as a data store for my personal data. Some days later, I mounted an external 5 TB USB hard drive for my backups. Everything worked fine until I needed to restart OMV. After restart, the old OMV installation on the internal hdd got booted instead of OMV installation of the USB stick!


    I might solve this issue by going into the boot menu in order to deactivate the internal hdd to be booted from but since my OMV-PC is headless (it has no monitor, no keyboard and no mouse), I wanted to solve the issue just via ssh shell.


    I came across of this post, which finally just suggests to run update-grub but this didn't solve my issue. As soon as I attached my external 5 TB USB hdd, OMV will boot from the internal hdd instead of the 32 GB USB stick.


    Since this did not solve the issue, I removed the bootable flag from the internal hdd (see instructions how I proceeded). However, OMV still booted from the internal hdd as long as the external 5 TB USB drive was attached.


    So I made a backup of the master boot record (mbr) of the internal hdd. Then I deleted the mbr without its partition tables of the internal hdd (see instructions how I proceeded). Now, OMV did not boot any longer as long as the external 5 TB USB hdd is attached.


    Here are all occurrences of sd from my grub config:


    Here are my block devices when OMV booted correctly from the 32 GB USB stick (the 5TB USB hdd has been mounted after boot):


    Here are my block devices when OMV booted incorrectly from the 500 GB internal hdd (the 5TB USB hdd was attached during boot):


    I'd be glad to know how I have to configure OMV so that it always boots from the 32 GB USB stick. Thanks in advance for your help!

  • macom

    Approved the thread.
  • macom

    Moved the thread to the trash.
  • macom

    Approved the thread.
  • The format of the 5 TB external USB drive is ntfs.

    When I attached it the first time, OMV could not mount it because its label contained spaces. I had some difficulties to remove the spaces from the label but finally succeeded. Here is what I did:

    Now, when I boot up OMV without having attached the external drive, OMV is able to mount it through its web interface without problems now.

    However, the initial problem, for which I opened this thread, still remains.

  • The format of the 5 TB external USB drive is ntfs.

    Realize that I'm speculating, but the external drive is likely be at least part of the problem. This drive may have been formatted by the OEM using "who knows what" scheme. OEM's throw security software on them with weird security (encrypted) and sometimes hidden partitions, all manner of propriety utilities, etc. It wouldn't surprise me that on a boot up and on first access, the drive might try to get a bit of code loaded before the OS is loaded.

    If the drive was mine and I bought it for use with OMV:


    I'd boot OMV up, then connect it. I'd wipe the drive under Storage, Disks, and Wipe. Then, in File systems, give it a short label and format it EXT4.


    After the format is complete, on the CLI, I'd use the command

    update-grub


    Your call.

  • Sounds good, thanks for the suggestion! However, OMV never booted from the newly attached 5 TB USB drive. OMV (wrongly) booted from the internal 500 GB hdd but should have booted from the 32 USB stick.

    However, if I understand you correctly, you think that the 5 TB USB hdd might have messed up the boot sequence so that OMV got booted from the internal 500 GB hdd instead of the 32 GB USB stick, right?

  • OMV (wrongly) booted from the internal 500 GB hdd but should have booted from the 32 USB stick.

    That might have been a BIOS boot order issue. When another drive is introduced, depending on the BIOS type, the device order can change. (That's BIOS OEM's trying to help us.) Instead of following the SATA port number sequence, the first drive BIOS detects becomes /dev/sda, and boots if it's bootable. "Then" grub takes over. Again this is all speculation. There's such variation in BIOS features and types, with much of it undocumented, there's no way to figure it out from remote.

    You might consider wiping the 500GB drive, to remove the OMV installation you no longer need.

    update-grub will (hopefully) fix the issue after the drive is wiped, formatted and it's assigned a UUID.

  • OMV did not succeed wiping the 5 TB USB drive, no matter if it's mounted or unmounted:

    Code
    OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; blockdev --rereadpt '/dev/sdc' 2>&1' with exit code '1': blockdev: ioctl error on BLKRRPART:
    Device or resource busy in /usr/share/openmediavault/engined/rpc/diskmgmt.inc:297
    Stack trace:
    #0 /usr/share/php/openmediavault/rpc/serviceabstract.inc(588): Engined\Rpc\DiskMgmt->Engined\Rpc\{closure}('/tmp/bgstatuswh...', '/tmp/bgoutputO5...')
    #1 /usr/share/openmediavault/engined/rpc/diskmgmt.inc(301): OMV\Rpc\ServiceAbstract->execBgProc(Object(Closure))
    #2 [internal function]: Engined\Rpc\DiskMgmt->wipe(Array, Array)
    #3 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
    #4 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('wipe', Array, Array)
    #5 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('DiskMgmt', 'wipe', Array, Array, 1)
    #6 {main}

    What do I wrong?

  • Wiping succeeded eventually after having mounted and unmounted the 5 TB USB drive several times.


    PS: Yes, your comment reminds me that I also removed a samba share. Maybe that was the reason that OMV stated "drive is busy" and refused to wipe it.

  • Creating the file system succeeded as well:

    I guess it will take some time to format 5 TB. I keep you up to date. Thanks so far for your help!

  • could the problem be your bios is set to boot usb devices first.

    The bios has to be set to boot usb device first because OMV is installed on the 32 GB USB stick (as I wrote above already).


    Well, I finally wiped the 5 TB USB drive, gave it a short label, formatted it as ext4 partition and executed update-grub as crashtest suggested. However, OMV did not reboot as long as the 5TB usb drive was attached :-(


    So I followed the second suggestion from crashtest, wiped the internal 500 GB drive, gave it a short label, formatted it as ext4 partition and executed update-grub. However, OMV did still not reboot as long as the 5TB usb drive was attached :-(


    I wonder also why OMV is stating that there is still a shared folder (see screenshot) even though I removed all shares. How can I know why OMV thinks that the shared folder is still referenced (and by what's referenced)?.


    PS: as you can see in the screenshot, I edited the device of the shared folder from its former 5TB USB drive to the internal drive. That's why name and device don't match anymore. However, even after reattributing a new device, I'm unable to remove the share.

  • I'm really out of ideas. OMV will not boot as long as the 5 TB USB drive is attached (even if it's unmounted). Do I really have to detach the USB drive to boot OMV? I can't imagine that OMV has been designed this way.

  • Based on that screen shot, I believe something is confused. The "Device" is the label of the hard drive (which indicates the 500GB internal drive) but the "name of the share" is the name of the external drive? Something is crossed or there's a misunderstanding of some sort.


    Maybe you should rebuilt. Apparently, you already know how to create a bootable thumbdrive for OMV.


    - First, wipe the 500gb internal drive so the OMV installation that still exists on it doesn't interfere when you try to boot up on the thumb-drive.

    - Rebuild the thumb-drive with OMV, fresh. (You know how to do this.)


    Download this guide -> OMV5 Users Guide


    Start with the section titled; Initial Configuration on page 28 (Or you could start from the beginning and verify that your thumb-drive is healthy.)
    Go through the guide and make sure to install OMV-Extras, that applies to you. (Thumbdrives will wear out fast without the Flashmemory plugin. Make sure you install it!)


    Work through and create your first share on the clean and newly reformatted 500GB internal drive.
    Use a LAN client to put some data in the share.


    When the above is settled, then reconnect the USB drive and we'll see what happens.

  • Don't worry about the screenshot: I just edited the properties of the shared resource to try to delete it afterwards - but the delete button is still grayed out and I don't see by what it's referenced.

    Once mounted the 5 TB USB drive, I can reset the properties of the shared resource to point it to its former device (see screenshot). So the names are now consistent but the delete button is still disabled because OMV thinks it's referenced - but by what? Is there a way to find this out?


    Btw. I already switched both USB ports but it did not solve the issue. :-(

    - First, wipe the 500gb internal drive so the OMV installation that still exists on it doesn't interfere when you try to boot up on the thumb-drive.

    Yes, I already wiped the 500 GB internal hdd (as I wrote above already).


    Of course, I could still rebuild OMV but I don't see the difference of what I did previously. Why should OMV behave differently then? Only because the internal 500 GB hdd has been wiped and is not bootable anymore or because the 5 TB usb drive has been wiped?


    I also don't see how I could solve the issue by altering the bios because USB has to be booted first since OMV is installed on a USB stick. The question is why OMV prefers the 5 TB USB drive (which is not bootable) instead to boot from the 32 GB bootable USB stick.

  • OMV does not work like what you're experiencing. (Is this a repurposed Laptop?) I can't explain what's happening with the hardware, but I have the exact same scenario.

    - I boot on a thumbdrive.

    - I have 2 internal drives on SATA ports

    - And 1 external USB drive.

    OMV boots fine, on the thumbdrive, with or without the external connected.


    But, there may be a work around for this. You could rebuild on the internal drive and still use it for shares.

    It's not best practice, but the following plugin will allow you to use the boot drive for shares.



    ______________________________________________________________________________________________

    In this scenario, you can use the internal drive and remove USB from the BIOS boot order. If something goes wrong again, I'd be looking at returning that external drive. (If it's new.)

  • I already switched both USB ports but it did not solve the issue

    crashtest the above would suggest that the bios is controlling the boot order, yes you can set a machine to boot from usb, but in some cases you also have to 'set' the boot order within the bios, i.e. set the flash drive first.


    Every machine bios is different, if you can't set a boot order there should be an option of selecting the boot device from a boot menu, depending on the machine could be F7, F9, F12.


    Apologies for butting in :)

    Raid is not a backup! Would you go skydiving without a parachute?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!