Find the answer to your Linux question:
Results 1 to 9 of 9
Hello everyone, My system has two hard drives in it. One has Ubuntu installed (/dev/sda) and the other has Slackware 13.37 installed (/dev/sdb). I compiled the 3.5.2 kernel, and it ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    12

    Linux 3.6.0-rc1 on Slackware changes device id VFS error


    Hello everyone,

    My system has two hard drives in it. One has Ubuntu installed (/dev/sda) and the other has Slackware 13.37 installed (/dev/sdb). I compiled the 3.5.2 kernel, and it works fine using /dev/sdb2 as the root for my Slackware drive. However, when I tried to compile 3.6.0-rc1, it changed the mapping in it's System.map to /dev/sde (ubuntu drive) and /dev/sdf (Slackware drive).

    Now, when I try to boot into 3.6.0, I get a VFS error about not finding the root. If I change the command to root=/dev/sdf2 (which is the location of my Slackware installation), I get an errro when it's trying to check with e2fs, because that's looking for /dev/sdb2 instead (which is what lilo.conf and grub on /dev/sda show).

    My question is how do I either get lilo to recognize that for the 3.6.0 kernel, everything is on /dev/sdf2, or get the 3.6.0 kernel to recognize that it's on /dev/sdb2? I can try recompiling the kernel, but without knowing what changes to make, I don't think it'll do any good. When I compiled it, I copied the current .config file in (from 3.5.2) and used make allocalyesconfig to generate the new config. Then I ran make menuconfig to ensure that things were the same/right.

    Have a great day
    Patrick.

    P.S. When I edit lilo.conf from the 3.5.2 kernel, and run lilo, it fails to find /dev/sdf2, so it won't update. And I can't edit it from 3.6.0 (at least not without mounting the drive as rw) as it's mounted read-only.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,665
    This is a known issue. You need to apply a label or GUID to your file systems and use the label or guid in /etc/fstab. I find labels more friendly and consistent than guids personally. An example of how this works is if your file system is and ext2/3/4 one, just use e2label:
    Code:
    # e2label /dev/sdxn mylabel
    Then in /etc/fstab, if this is your system /boot partition (or / if you don't have a separate /boot partition) your entry would look like this:
    Code:
    LABEL=mylabel   /boot  ext4  defaults 1 2
    This way if the kernel changes the device ids, you are still golden. I just finished configuring a 5 node hadoop test cluster in the Amazon cloud, and I had to do this for sure.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Sep 2010
    Posts
    12
    Quote Originally Posted by Rubberman View Post
    This is a known issue. You need to apply a label or GUID to your file systems and use the label or guid in /etc/fstab. I find labels more friendly and consistent than guids personally. An example of how this works is if your file system is and ext2/3/4 one, just use e2label:
    Code:
    # e2label /dev/sdxn mylabel
    Then in /etc/fstab, if this is your system /boot partition (or / if you don't have a separate /boot partition) your entry would look like this:
    Code:
    LABEL=mylabel   /boot  ext4  defaults 1 2
    This way if the kernel changes the device ids, you are still golden. I just finished configuring a 5 node hadoop test cluster in the Amazon cloud, and I had to do this for sure.
    So in my case (both drives are ext4), I'd boot into Slackware, and type e2label /dev/sdb2 /dev/sdf2 and then in /etc/fstab add the LABEL=/dev/sdf2 /boot ext4 defaults 1 2 at the end?

    Thanks. It'll be a week or so before I can do anything, as the computer died yesterday (I think the motherboard shelled out).

    Have a great day
    Patrick.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,665
    Quote Originally Posted by PatrickDickey52761 View Post
    So in my case (both drives are ext4), I'd boot into Slackware, and type e2label /dev/sdb2 /dev/sdf2 and then in /etc/fstab add the LABEL=/dev/sdf2 /boot ext4 defaults 1 2 at the end?

    Thanks. It'll be a week or so before I can do anything, as the computer died yesterday (I think the motherboard shelled out).

    Have a great day
    Patrick.
    You could, but I don't recommend using the device id like that for the label. Use something meaningful, such as "slack-boot". Then you can label the other /boot file system something like "ubuntu-boot".
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Just Joined!
    Join Date
    Sep 2010
    Posts
    12
    Quote Originally Posted by Rubberman View Post
    You could, but I don't recommend using the device id like that for the label. Use something meaningful, such as "slack-boot". Then you can label the other /boot file system something like "ubuntu-boot".
    Thanks again. How does this all work with the lilo.conf file and lilo commands? That's where I'm having an issue. If I boot into the 3.5.2 kernel, I don't have /dev/sdf available to me. So, would I change the lilo.conf root lines for each image to 'slack-boot'? (Right now, they all say /dev/sdb2), or do I only need to do it on the 3.6.0 kernel (as it's the only one that isn't using /dev/sdb2 for a drive)?

    Also is the label= line a separate line altogether in /etc/fstab, or is it added to the current line describing the drive? I'll have to read up on e2label a bit more, just so I understand what I'm doing with it.

    I think to make it clearer for me (and for anyone in the future, let's do this: I'll post the /etc/fstab of the computer that I'm on, and use it as a sample for this.

    Code:
    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    nodev,noexec,nosuid 0       0
    # / was on /dev/sda1 during installation
    UUID=e7ecb166-c4f1-4e3d-9458-6d2ca6b6d780 /               ext4    errors=remount-ro 0       1
    # swap was on /dev/sda5 during installation
    UUID=8ea55b6f-de06-42f8-99b6-e9c37e7c9be3 none            swap    sw              0       0
    So, if I wanted to change the label on my / drive, I would type
    Code:
    e2label /dev/sda1 ubuntu-boot
    (or would this have to be
    Code:
    e2label e7ecb166-c4f1-4e3d-9458-6dca6b6d780 ubuntu-boot
    ?)

    and then modify the line in /etc/fstab that says UUID=e7ecb166-c4f1-4e3d-9458-6d2ca6b6d780 / ext4 errors=remount-ro 0 1
    to LABEL=ubuntu-boot / ext4 errors=remount-ro 0 1

    Is that correct, or do I leave that line alone, and add the label line at the end?

    Have a great day
    Patrick.
    Last edited by PatrickDickey52761; 08-30-2012 at 01:22 AM. Reason: Adding an example of /etc/fstab and possible changes to it.

  7. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,665
    It has nothing to do with the boot loader. It has to do with the system mounting the file system after it starts.

    The line: LABEL=ubuntu-boot / ext4 errors=remount-ro 0 1
    would work just fine. From your post, it is using UUIDs (GUIDs) now, which should continue to work, but are not suitable if you need to clone your drive to a new disc because the old one is starting to get bad sectors. It would have a new UUID, so the boot would fail. I use the LABEL=name technique all the time, on Ubuntu, Red Hat, Gentoo, Suse, and Debian systems and have never had a problem with it.

    Doing it that way has let me install clusters of computers on AWS (amazon cloud) and upgrade the system (creating a new instance), attaching the old disc's snapshot (bit-copy), then boot and run. If I didn't do the LABEL=name thing then I would have to do a full re-installation every time, which would be a MAJOR pain in the u-no-what.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  8. #7
    Just Joined!
    Join Date
    Sep 2010
    Posts
    12
    Quote Originally Posted by Rubberman View Post
    It has nothing to do with the boot loader. It has to do with the system mounting the file system after it starts.

    The line: LABEL=ubuntu-boot / ext4 errors=remount-ro 0 1
    would work just fine. From your post, it is using UUIDs (GUIDs) now, which should continue to work, but are not suitable if you need to clone your drive to a new disc because the old one is starting to get bad sectors. It would have a new UUID, so the boot would fail. I use the LABEL=name technique all the time, on Ubuntu, Red Hat, Gentoo, Suse, and Debian systems and have never had a problem with it.

    Doing it that way has let me install clusters of computers on AWS (amazon cloud) and upgrade the system (creating a new instance), attaching the old disc's snapshot (bit-copy), then boot and run. If I didn't do the LABEL=name thing then I would have to do a full re-installation every time, which would be a MAJOR pain in the u-no-what.
    Thanks again. I was able to get the computer up and running (had to buy a new motherboard for it). So, here's the real /etc/fstab file

    Code:
    /dev/sda5        swap             swap        defaults         0   0
    /dev/sdb1        swap             swap        defaults         0   0
    /dev/sdb2        /                ext4        defaults         1   1
    #/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro  0   0
    /dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
    devpts           /dev/pts         devpts      gid=5,mode=620   0   0
    proc             /proc            proc        defaults         0   0
    tmpfs            /dev/shm         tmpfs       defaults         0   0
    So, I'll type
    Code:
    e2label /dev/sdb2 slack-boot
    and then alter the line for /dev/sdb2 in /etc/fstab to
    Code:
    LABEL=slack-boot / ext4 defaults 1 1
    ? Like I said before, I'm confirming it both for myself and for anyone in the future, so they can see exactly what needs to be changed.

    Also, since this is a known issue, does it only affect root, or do I need to do something similar for my swap partitions?

    Have a great day
    Patrick.
    Last edited by PatrickDickey52761; 08-31-2012 at 12:34 AM. Reason: Removed an = that shouldn't have been in the code.

  9. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,665
    Actually, you can use the same swap partition for both systems, unless you hibernate both of them at the same time - I think (not 100% sure) that hibernate uses the swap space to store the machine state. You can create two swap partitions (use different label for one - default is "swap" - call the other "swap2") and after adjusting the relevant /etc/fstab table, you should be golden!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  10. #9
    Just Joined!
    Join Date
    Sep 2010
    Posts
    12
    Quote Originally Posted by Rubberman View Post
    Actually, you can use the same swap partition for both systems, unless you hibernate both of them at the same time - I think (not 100% sure) that hibernate uses the swap space to store the machine state. You can create two swap partitions (use different label for one - default is "swap" - call the other "swap2") and after adjusting the relevant /etc/fstab table, you should be golden!

    Two things: First, the whole two swap thing is because it asked if I wanted to use both when I installed Slackware, and mistakenly, I said "Yes". Not a big issue, except that when it reformattted the swap partition on my Ubuntu drive (/dev/sda), I had to fix that UUID in /etc/fstab (which probably is a good reason for using labels instead of UUID's). I won't be making that mistake again, although it's probably neither a good or bad thing.

    Second, I'm going to have to reinstall Slackware anyhow. I moved the drives to another computer (which already has a drive in it), so now everything is messed up beyond saving. Ubuntu boots normally, but when I try to boot into Slackware, now it's /dev/sda instead of /dev/sdb (or /dev/sdf in the 3.6.0 kernel). If I change the root= to /dev/sda1, I get an error about a missing init= statement. So, rather than fight with this more, I'm going to reinstall completely and then put the labels in before I start adding kernels.

    On a bright side, at least now I'll have a real processor and motherboard (instead of an e-Machines POC that doesn't work half the time). Once I've reinstalled Slackware and set everything up (and upgraded to the kernels that I need), I'll come back and mark this as solved.

    Thanks again for your help, and have a great weekend (three-day weekend if you live in the US).
    Patrick.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •