Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Gentoo

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-13-2008, 03:17 AM
Nikos Chantziaras
 
Posts: n/a
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
Reply With Quote
  #2 (permalink)  
Old 07-13-2008, 03:59 AM
Aragorn
 
Posts: n/a
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)
Reply With Quote
  #3 (permalink)  
Old 07-13-2008, 05:50 AM
J.O. Aho
 
Posts: n/a
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
Reply With Quote
  #4 (permalink)  
Old 07-13-2008, 04:53 PM
Nikos Chantziaras
 
Posts: n/a
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
Reply With Quote
  #5 (permalink)  
Old 07-13-2008, 05:00 PM
Nikos Chantziaras
 
Posts: n/a
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.
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Gentoo


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:14 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109