Change the grub and boot directory to a different device

I have Manjaro mounted on a USB3 drive booting from that drive with grub2 on that drive. The boot is in a /boot directory on the USB3 drive and not on a separate partition on the USB drive. I have a card for the USB3 drives but it is not visible on the boot until the kernel loads. The computer bios only supports USB2 drives so it is not seen at boot. I don’t like dual booting from the Windows drive boot loader.
Question: Can I use a 32Gb flash drive to do the boot with grub2 and bootstrap the boot from a /boot partition on the 32Gb flash drive who’s files would get transferred from the USB drive… Once the boot loads the kernel the rest of the system files would be visible if the drive were plugged into the USB3 card’s adapter port. I am not too thrilled about reinstalling everything because I have many programs that would need reinstalling with all the associated problems…

You don’t need to and one of the major advantages of UEFI. There are several solutions:

  • grub
  • a Boot Manager like rEFInd that will then load the individual Boot Loaders (Windows BOOTMGR, Grub, OS/2, etc.)
  • UEFI Boot Manager (depends on your hardware manufacturer, but most allow this nowadays)
  • No . (Emphasis mine)
  • You could mount /boot on a 32G flash drive though and all the other files on a USB stick but that will make your installation more complex: you need both the Flash drive and the USB stick in the machine and if one of the 2 fails, everything fails so System Backups will become important to you!

:grin:

1 Like

Yes, you can do that:

  1. Create a partition for the boot in the flash drive, format it and mount it anywhere on your system.

  2. Copy the contents of your boot folder to that partition:
    sudo cp -RPp /boot/* <path-to-partition>

  3. Adjust your /etc/fstab to mount the new partition as you new /boot

  4. Unmount both /boot and your new partition.

  5. Mount your new partition in /boot

  6. Use grub-install to install grub in the flash drive

  7. If needed, run update-grub

  8. Reboot.

In case it fails (which I doubt, as I’ve done this at least twice, though I never installed grub on a flash drive), you can always chroot from a live system and revert the changes.

3 Likes

I have spent the whole day today with a different problem that I resolved so I will have to attempt MBB’s solution when I feel up to it but this will definitely improve my system (if I can get it to work) since I will be able to run my USB drive installation on the USB3 drive in a USB3 drive socket.Thanks for the other suggestions also.

2 Likes

I followed the directions. When the USB3 hard drive was plugged into a USB2 port it worked perfectly but that was not what I was after. Plugging it into the USB3 port on my card gave me the error no such device at the grub prompt (actually it spit out my uuid for where my /boot was); unknown file system. Booting normally I tried grub-install again with the exact same result. I got the idea that maybe I should use the instructions from Manjaro wiki concerning which I was struggling with yesterday for restoring the grub with grub-install, after messing up but finally getting it to work. Instead of mounting to /mnt I just mounted everything to /. I did the chroot. and followed it down to the end using the info from gparted to determine the drive for grub-install and NOT the partition.
Finally I got the USB3 hard drive plugged into the card with a usb3 port to respond. It started with not being able to see the (uuid #as before)but the screen was different because before it was stuck. Then it gave me a message over 10 times telling me that it cannot get C / H / S values on HD2. It seems the values have something to do with reading a hard drive. All I know is that my disk for Manjaro is working in a USB3 port and not just USB2. Manjaro is loaded. I have an idea of what the problem is. First of all my bios and my motherboard cannot offer support for a USB3 drive and only treat one like a USB2 drive. When grub first sees it it knows that it will not have to deal with the USB3. Once the kernel is loaded however in time the constant not getting the C/H/S values message is cancelled by the fact that the USB3 drive plugged into the USB3 card port has finally become accessible and the Manjaro boot screen with all the files and operating systems becomes available. There may be a way around this if I read the Grub info but I don’t know if this really matters. Once it got the values grub proceeded to load Manjaro. It is frustrating when things don’t work. Eventually from trial and error this worked.

The idea is to plug the flash with /boot on USB2 porta and the drive with Root on USB3 porta. Is This what you did?

YES. Old computers cannot boot off of the usb3 drive because the USB3 is not in the motherboard or in the bios. If an aftermarket card was inserted that allowed them to operate a usb3 drive they only become accessible after the software for using them has been run so since they can’t be seen they can’t be used to boot. As soon as the system can mount the kernel or whatever terminology is used the USB3 ports are visible to the system. If you want to mount an OS on a USB drive it would be inserted into a USB2 port because that is on the motherboard and bios. With what I did was lie to my computer which is why grub had a pissy fit about having to read a USB3 drive when it shouldn’t be there in the boot. That warning I got from my Internet reading is when there is some conflict set up on setup sometimes between using bios and something else that I read about (forgot). I got an error like 10 times before grub woke up and allowed me to use the drive. I think I had done something similar to this before computers could mount off of the USB drive at all and had to use a cdrom to boot from. Things are a lot more complicated now and without your help in giving me some information I never would have accomplished this. The system files, etc are being read on a USB3 drive not a USB3 drive plugged into a USB2 port which would have acted like a USB2 drive. I had a lot of bumps in the road but the result was worth all the bruises I got. That computer had Windows 7 on it and I updated it to Windows 10. I have made it a little Windows faster but in reality it is painfully slow and I love Manjaro because of the difference in speed from decrepit Windows. This should improve the Manjaro even more.

I know what’s the problem. I was just confirming you connected the grub flash to a USB2 port.

I had an old desktop in which I added a PCI card with SATA ports. I had the same problem, but I then I found out a BIOS option to load the cards’ firmware upon boot. And this solved the issue for good. I don’t remember exactly how the option was called. I think it was embed something… but I’m not sure. It was a BIOSTAR motherboard.

Currently I also have a PCIE USB3 card for my external backup drive, but I don’t boot from there.

The motherboard is :slight_smile:VIOLET6
Vendor PEGATRON CORPORATION (Advanced Micro Devices (formerly ATI), www.amd.com)
Version 6.01

Bios
|Date|06/03/2010|
|Vendor|American Megatrends Inc. (American Megatrends, www.ami.com)|
|Version|5.16|

I went thru all the options I could find on it and I was unable to find anything to load the Anker card (listed on a print out as: VIA Technologies, Inc. VL805 USB 3.0 Host Controller ). I think that since this has an ugly boot, but it does boot and it can get worse I will just use it as it is.

But is it working or not? Are you able to boot with the root on USB3? Sorry, it’s just that your writing is a bit confusing.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.