Running arch from USB
hello everyone... I'm trying hard to run an existing copy of arch from USB. I've changed the /etc/fstab properly. The new system is UEFI so I configured a new EFI partition and configured grub for that (building a menu.lst file following this link: https://wiki.archlinux.org/index.php/Install_Arch_Linux_on_a_removable_medium). Now the problem is that grub works fine, it detects all OSs but when I select "Arch" it says it's not able to find the specific partition with that UUID and it kicks me into a secure shell (roots). From the I can say that the folder /dev/disk/by-uuid/ doesn't contain the UUID of the disks I've connected... it can only detect the ones of the internal HD. Does anyone know what is the problem?
I'm really going crazy and don't know where to hit my head
About this post
- Posted
- Archived
- Score
- 12 · 100% up
- Kind
- Text
- ID
- hya09u
17 comments
Likely you're missing usb-storage module in initramfs. See your /etc/mkinitcpio.conf, modify MODULES var in it to add usb-storage and uas, then regenerate initramfs with mkinitcpio -p linux
thank you very much!!! That was exactly the problem! Starting from the solution I've tried to inform myself better about mkinitcpio but I haven't found so much... for instance I did find nowhere the MODULES variables (like 'usb-storage' and 'uas'). Where could I find this information? Should I check the source code?
Anyway thank you again I would have never realized how to do that!
Should have read that before posting my long answer. Lol. I’m glad this is now working for you. I am though puzzled as mine works fine just with base, udev, block, keyboard, autodetect, modconf, filesystems and fsck (order is really important) for my mkinitcpio.conf file. I have nothing for the Modules. Just says MODULES=(). Oh well...
See https://wiki.archlinux.org/index.php/Mkinitcpio#MODULES
MODULES is just a list of kernel modules to put into initramfs. USB drives are handled by either usb-storage (for older drives) or by uas, SD cards (if it sits on MMC bus) - by mmc-block.
You can check
dmesgoutput after inserting USB drive to figure out a driver name, in my case:Use root=PARTUUID= instead of root=UUID=
The blkid command should be able to list both the UUID and PARTUUID characters, so use the PARTUUID instead inside the grub config file.
Personally (as a sysadmin), I've had more luck using blkid instead of /dev/disk/by-uuid when setting up encrypted lvms, mdadm arrays and such
Unfortunately the problem persists... instead of being unable to find the uuid now isn't able to find the partuuid. Thank you anyway!
Deleted before we saved it.
You can also try assigning labels to the partitions on the USB drive that you are booting off of.
It makes it very easy to mount them manually on any machine with a "mount LABEL=<partition-label>" command without needing to lookup the device name in /dev each time.
You can also use "genfstab -L -p /mnt >> /mnt/etc/fstab" to generate the fstab using partition labels during the install process.
I have found this to be a very portable way to set things up.
EDIT: You could also just manually edit the fstab and replace the "UUID=..." section manually with "LABEL=<partition-label>
@jes_chr This is your solution. Especially the last paragraph. This would solve you problems as it is states on the wiki
Sadly I don't know what your problem is, but I experienced similar behavior a few years ago. In my case, the USB drive worked flawlessly on some machines, but not on some others. So it may be a BIOS/UEFI issue of that particular machine you are trying on. Could you try to boot the stick on a different machine?
So for my own sanity I did the arch install on a USB key as per the link you described. Here’s below things done that you might have missed or done differently.
I created a VM with the latest downloaded ArchLinux ISO. The VM has no HD, and made sure a USB key is seen by the VM. That way it sees the USB key as /dev/sda1.
Created on USB key - dev/sda1 Fat32 512M, /dev/sda2 swap 512M, /dev/sda3 ext4 6G. The FAT32 is mandatory for /dev/sda1 or it won’t boot into UEFI mode.
Followed the usual handguide, and installed on the pacstrap base linux linux-firmware vim man-db man-pages texinfo grub efibootmgr
Modified the /etc/mkinitcpio.conf file to have block and keyboard hooks before the autodetect hook, then ran the mkinitcpio -P command.
Did the grub-install command making sure the —removable is present.
It works on my VM, and on another physical laptop. But I have to boot into the UEFI menu for both of them (ESC or F12) and select the USB in UEFI mode in order to boot properly.
I didn’t have to change anything in the /etc/fstab file as the one generated following the handbook just works fine.
Anything in there that you might have missed or done differently?
Thank you very much for your time and your answer.. I guess I didn't follow the order of mkinitcpio and I solved it in an unconventional way.... I made another post where I describe both ways... I hope these posts won't make someone else with a similar problem confused (I was kind of trying to reach the opposite)
Deleted before we saved it.
Curious. When you boot, do you boot in the manufacturer UEFI of the machine, then choose the USB key in UEFI mode? Or do you boot into the machine’s HD, then choose an option in there that points to the USB key?
Not a problem. In fact, those 2 posts bring us knowledge by experience of what happens when the reorder doesn’t occur in that configuration file, and different ways to solve it. Great job!
Many thanks! I really appreciate! I don't know too much about computer science but I do love open source and the entire way of thinking. I like helping whenever I could