![]() |
|
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
fsck tries to check non-existent disk and swapon picks the wrongdisk too
I have a Gentoo installation that I'm trying to make bootable in 2
different machines. On the first machine, the hard disk is seen as /dev/sda; the root partition becomes /dev/sda1 and swap /dev/sda2. On the second machine the disk is seen as /dev/sdc and root is /dev/sdc1 while swap is /dev/sdc2. I have set up 2 kernel configurations suitable for the hardware of each machine plus the correct root= kernel parameter (root=/dev/sda1 on the 1st machine and root=/dev/sdc1 on the 2nd.) In /etc/fstab I use labels instead of device names to do the mounting: LABEL=GentooRoot / ext3 noatime 0 1 LABEL=GentooSwap none swap sw 0 0 At first it works (when booting in the 1st machine where I've set it up). However, booting it in the 2nd machine results in swapon complaining that /dev/sda2 does not exist (which is correct). It fails to pick /dev/sdc2 (LABEL=GentooSwap). Now, moving the hard drive to the 1st machine again and trying to boot from it results in a non-bootable system; the command 'fsck -C -T -a /' (this happens in /etc/runlevels/boot/checkroot) complains that /dev/sdc1 cannot be repaired, and the boot process stops. That's totally wrong; it should check sda1, not sdc1. Probably I'm doing something wrong here. :P |
|
|||
|
Re: fsck tries to check non-existent disk and swapon picks the wrong disk too
On Sunday 13 July 2008 05:17, someone who identifies as *Nikos Chantziaras*
wrote in /alt.os.linux.gentoo:/ > I have a Gentoo installation that I'm trying to make bootable in 2 > different machines. On the first machine, the hard disk is seen as > /dev/sda; the root partition becomes /dev/sda1 and swap /dev/sda2. On > the second machine the disk is seen as /dev/sdc and root is /dev/sdc1 > while swap is /dev/sdc2. > > I have set up 2 kernel configurations suitable for the hardware of each > machine plus the correct root= kernel parameter (root=/dev/sda1 on the > 1st machine and root=/dev/sdc1 on the 2nd.) > > In /etc/fstab I use labels instead of device names to do the mounting: > > LABEL=GentooRoot / ext3 noatime 0 1 > LABEL=GentooSwap none swap sw 0 0 > > At first it works (when booting in the 1st machine where I've set it > up). However, booting it in the 2nd machine results in swapon > complaining that /dev/sda2 does not exist (which is correct). It fails > to pick /dev/sdc2 (LABEL=GentooSwap). > > Now, moving the hard drive to the 1st machine again and trying to boot > from it results in a non-bootable system; the command 'fsck -C -T -a /' > (this happens in /etc/runlevels/boot/checkroot) complains that /dev/sdc1 > cannot be repaired, and the boot process stops. That's totally wrong; > it should check sda1, not sdc1. > > Probably I'm doing something wrong here. :P Have you tried using labels as well for */boot/grub/menu.lst?* By the way, by the same token you can also use UUIDs instead of labels, but that makes for much longer strings, of course. -- *Aragorn* (registered GNU/Linux user #223157) |
|
|||
|
Re: fsck tries to check non-existent disk and swapon picks the wrongdisk too
Nikos Chantziaras wrote:
> I have a Gentoo installation that I'm trying to make bootable in 2 > different machines. On the first machine, the hard disk is seen as > /dev/sda; the root partition becomes /dev/sda1 and swap /dev/sda2. On > the second machine the disk is seen as /dev/sdc and root is /dev/sdc1 > while swap is /dev/sdc2. > > Probably I'm doing something wrong here. :P Out over what Aragorn wrote, check that the mtab is clean of the old device names. Secondly the device.map may be using the "wrong" device names too, which can give you yet more headache. -- //Aho |
|
|||
|
Re: fsck tries to check non-existent disk and swapon picks the wrongdisk too
Aragorn wrote:
> On Sunday 13 July 2008 05:17, someone who identifies as *Nikos Chantziaras* > wrote in /alt.os.linux.gentoo:/ > >> I have a Gentoo installation that I'm trying to make bootable in 2 >> different machines. [...] >> >> [...] booting it in the 2nd machine results in swapon >> complaining that /dev/sda2 does not exist (which is correct). It fails >> to pick /dev/sdc2 (LABEL=GentooSwap). >> >> [...] 'fsck -C -T -a /'complains that /dev/sdc1 cannot be repaired >> [...] > > Have you tried using labels as well for */boot/grub/menu.lst?* By the way, > by the same token you can also use UUIDs instead of labels, but that makes > for much longer strings, of course. Now that you mentioned UUIDs, I noticed that /dev/disk/ contains these directories: by-id/ by-label/ by-path/ by-uuid/ After I changed fstab to: /dev/disk/by-label/GentooRoot / ext3 noatime 0 1 /dev/disk/by-label/GentooSwap none swap sw 0 0 it works perfectly. I suppose it should have worked with the LABEL= syntax in the first place too. by-id and by-uuid also works though I prefer labels (out of habit). Anyway, it works now so I'm happy. I wonder though if I should open a bug for it. The behavior with LABEL= looks dangerous to me. swapon previously complained that /dev/sda2 does not exist. What if /dev/sda2 *did* exist? It would happily wipe it out by using it as swap :P |
|
|||
|
Re: fsck tries to check non-existent disk and swapon picks the wrongdisk too
J.O. Aho wrote:
> Nikos Chantziaras wrote: >> I have a Gentoo installation that I'm trying to make bootable in 2 >> different machines. On the first machine, the hard disk is seen as >> /dev/sda; the root partition becomes /dev/sda1 and swap /dev/sda2. On >> the second machine the disk is seen as /dev/sdc and root is /dev/sdc1 >> while swap is /dev/sdc2. >> >> Probably I'm doing something wrong here. :P > > Out over what Aragorn wrote, check that the mtab is clean of the old > device names. Secondly the device.map may be using the "wrong" device > names too, which can give you yet more headache. mtab was indeed using wrong device names (even after deleting it). For some reason LABEL= doesn't seem to work as expected. I switched to using /dev/disk/by-label (see my other post) and it works now. |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|