You are not logged in.

#1 2017-07-11 05:28:18

kmartin
Member
Registered: 2016-04-27
Posts: 17

[SOLVED] USB persistent Arch install: changed to swap-file boot fails

OK so I fallowed the Arch wiki, that is fine, this is a pebkac situation.
   I installed the swap file as a partition from the installing machine (desk top Arch install), my confusion. I planed to use a swap file . Any way that USB did boot on the desk top (where I created it) fine but squawked about not finding the swap partition on my laptop, understandable. It did boot however. I tried to resolve the swap partition/swap file issue by editing the fstab file on the stick while booted, and installed a swap file instead. This arrangement work's fine on the laptop no more (squawking) but wont even boot on the desktop that it was originally created on. I get after Grub while booting: " Starting version 233".

   The error is:

ERROR: Device 'UUID ...4ee0493' not found. Skipping Fsck. Mount: Can't find ... 4ee0493 ...

. This is the USB / partition
   I do hope I explained this clearly. Should be simple but I have not found it. Here is some info:

Arch_usb fstab, note the commented out swap partition entry.

# 
# /etc/fstab: static file system information
#
#        <file system>                    <dir>        <type>  <options>                                       <dump>  <pass>
# /dev/sdc2 LABEL=Arch_root
UUID=f5ec0cbd-25f5-4034-9cde-379cc4ee0493  /         	ext4  rw,relatime,data=ordered                            0       1

# /dev/sdc1 LABEL=Arch_boot
UUID=355ff2ee-3cd8-4a03-b3d7-cb0b6257a3b5  /boot     	ext2  rw,relatime,block_validity,barrier,user_xattr,acl   0       2

#desk top Dell
# /dev/sdb5
#UUID=cb512c15-b12f-4330-be81-07bfbd596992  none      	swap  defaults                                            0       0

# arch_usb swap file
/swapfile                                   none        swap  defaults                                            0       0

/dev/sdc1: is the USB inserted in the desktop/w 2 HDD's.

blkd:$ blkid
/dev/sda1: LABEL="ManjaroBoot" UUID="b00dc455-86b3-41c7-aef4-22d9b6bfe8c0" TYPE="ext2" PARTUUID="b03806bb-01"
/dev/sda2: LABEL="ManjaroRoot" UUID="9929404a-b5fe-4511-b474-85362ac66ca8" TYPE="ext4" PARTUUID="b03806bb-02"
/dev/sda5: UUID="cd5a764b-2309-46f4-a411-344fbeb3d71a" TYPE="swap" PARTUUID="b03806bb-05"
/dev/sdb5: UUID="cb512c15-b12f-4330-be81-07bfbd596992" TYPE="swap" PARTUUID="000c6971-05"
/dev/sdb6: LABEL="Arch_root" UUID="c6a6300e-f0cc-410c-99fb-861a4d014a82" TYPE="ext4" PTTYPE="dos" PARTUUID="000c6971-06"
/dev/sdb7: LABEL="Arch_boot" UUID="b5a6a322-5ac2-4142-bdbd-e6363b89bbf5" TYPE="ext2" PTTYPE="dos" PARTUUID="000c6971-07"
/dev/sdc1: LABEL="Arch_boot" UUID="355ff2ee-3cd8-4a03-b3d7-cb0b6257a3b5" TYPE="ext2" PARTUUID="2a384c75-01"
/dev/sdc2: LABEL="Arch_root" UUID="f5ec0cbd-25f5-4034-9cde-379cc4ee0493" TYPE="ext4" PARTUUID="2a384c75-02"

Thanks folks...

Last edited by kmartin (2017-07-11 08:23:10)


... it seemed like a good idea ...

Offline

#2 2017-07-11 06:39:31

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: [SOLVED] USB persistent Arch install: changed to swap-file boot fails

The error you see has nothing to do with fstab or swap. There are three possible reasons:

1. The UUID (in grub.cfg) is not correct. To confirm this is negative, check the UUID in error against the one from blkid (in this case f5ec0cbd-25f5-4034-9cde-379cc4ee0493).

2. Some of the driver required to mount the root device (in this case most likely ehci-pci/xhci-pci and uas/usb-storage) is missing in the initramfs. The could be due to the fact that when the initramfs images are generated, the installation is not yet on the USB drive, or the drive is plugged into a different machine (that has a different type of USB host controller). To confirm you can boot with the fallback initramfs. There should be a (sub)entry for that on the grub menu.

3. Probing USB drives might take quite a bit longer than probing SATA drives. It almost always requires poll_device() in the mkinitcpio init to be performed. For that do NOT omit the udev hook from the initramfs. You may also try appending rootdelay= to the linux line in the grub menu entry (press 'e' after you highlighted the entry) with a value higher than 10, which is the default timeout of the polling.

Last edited by tom.ty89 (2017-07-11 06:45:10)

Offline

#3 2017-07-11 08:16:33

kmartin
Member
Registered: 2016-04-27
Posts: 17

Re: [SOLVED] USB persistent Arch install: changed to swap-file boot fails

Thanks @tom.ty89 Thanks for the quick respondence!

tom.ty89 wrote:

1. The UUID (in grub.cfg) is not correct. To confirm this is negative, check the UUID in error against the one from blkid (in this case f5ec0cbd-25f5-4034-9cde-379cc4ee0493).

   The grub.cfg has the same UUID for /

tom.ty89 wrote:

2. Some of the driver required to mount the root device (in this case most likely ehci-pci/xhci-pci and uas/usb-storage) is missing in the initramfs. The could be due to the fact that when the initramfs images are generated, the installation is not yet on the USB drive, or the drive is plugged into a different machine (that has a different type of USB host controller). To confirm you can boot with the fallback initramfs. There should be a (sub)entry for that on the grub menu.

Thanks I'm posting from  the fallback initramfs, on the desk top box.
You nailed it tom.ty89 !
I've been running Linux for just a few years and really appreciate the help. Are

ehci-pci/xhci-pci and uas/usb-storage

drivers that are instal-able like with pacman or are they kernel components which require building a kernel? This is more of a learning experiment and a show and tell for the windows friends. So I don't want to wast a lot of your time... Again Thanks.

Last edited by kmartin (2017-07-11 08:18:34)


... it seemed like a good idea ...

Offline

#4 2017-07-11 10:27:18

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: [SOLVED] USB persistent Arch install: changed to swap-file boot fails

Those are kernel modules that comes with the kernel packages (e.g. "linux" in the core repo).

Since they are built separately as a module (files), they are not in the kernel image (vmlinuz) that is loaded by grub. So if they are needed for the root device, they must be included in the initramfs image.

mkinitcpio (the initramfs "builder") has a hook called "autodetect" which eliminate driver modules that are pulled by other hook (in this case the "block" hook) that it consider unnecessary when it builds the image. "autodetect" is not used for the fallback image so it works.

In fact for a "portable" (e.g. USB) installation one should avoid using the autodetect hook at all, so you should remove it from the HOOKS array in /etc/mkinitcpio.conf. Make sure you run mkinitcpio -P after that.

If you want to avoid building/keeping duplicate (large) images, you can _additionally_ remove 'fallback' from the PRESETS array in the preset files in /etc/mkinitcpio.d/ and delete the existing fallback images in /boot.

Last edited by tom.ty89 (2017-07-11 10:30:34)

Offline

#5 2017-07-11 18:21:00

kmartin
Member
Registered: 2016-04-27
Posts: 17

Re: [SOLVED] USB persistent Arch install: changed to swap-file boot fails

Very nice detailed and clear explanation @tom.ty.89. This should help others as well. I think I actually understand a good bit of your post. There is much for me to read still. I'll see how it goes this evening...
Again, thanks...


... it seemed like a good idea ...

Offline

#6 2017-07-12 05:58:44

kmartin
Member
Registered: 2016-04-27
Posts: 17

Re: [SOLVED] USB persistent Arch install: changed to swap-file boot fails

All's good, of course:

tom.ty89 wrote:

In fact for a "portable" (e.g. USB) installation one should avoid using the autodetect hook at all, so you should remove it from the HOOKS array in /etc/mkinitcpio.conf. Make sure you run mkinitcpio -P after that.

Right, done .

tom.ty89 wrote:

If you want to avoid building/keeping duplicate (large) images, you can _additionally_ remove 'fallback' from the PRESETS array in the preset files in /etc/mkinitcpio.d/ and delete the existing fallback images in /boot.

Done and done, saved 23.5 Megs.

One quick question re.

/etc/mkinitcpio.d/linux.preset
# mkinitcpio preset file for the 'linux' package

ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"

PRESETS=('default')

#default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-linux.img"
#default_options=""

#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/initramfs-linux-fallback.img"
fallback_options="-S autodetect"

Isn't this this section useless now?

#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/initramfs-linux-fallback.img"
fallback_options="-S autodetect"

Thank you.


... it seemed like a good idea ...

Offline

#7 2017-07-12 07:51:58

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: [SOLVED] USB persistent Arch install: changed to swap-file boot fails

Well yeah the lines are not used when there is no preset with corresponding name ('fallback' in that case) in the PRESETS array. Doesn't hurt to keep it for reference though.

Offline

#8 2017-07-12 16:17:31

kmartin
Member
Registered: 2016-04-27
Posts: 17

Re: [SOLVED] USB persistent Arch install: changed to swap-file boot fails

Right, I see.
Thanks for the help.

Happy trails...


... it seemed like a good idea ...

Offline

Board footer

Powered by FluxBB