Slackware This Forum is for the discussion of Slackware Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-16-2007, 03:59 PM
|
#1
|
|
LQ Newbie
Registered: Mar 2006
Posts: 10
Rep:
|
e2fsck, during boot, trying to check incorrect drive using LABEL
I have a bootable USB HD based on Slackware 11, using the 2.6.21.3 kernel.
If I edit fstab as follows, the USB HD will successfully boot to a computer with internal IDE drives.
/dev/sda1 / ext3 defaults 1 1
/dev/sda2 /home ext3 defaults 1 2
/dev/sda3 swap swap defaults 0 0
And if I edit fstab as follow, the USB HD will successfully boot to a computer with an internal SATA drive.
/dev/sdb1 / ext3 defaults 1 1
/dev/sdb2 /home ext3 defaults 1 2
/dev/sdb3 swap swap defaults 0 0
However, the purpose of the USB HD is to be able to take it to any computer without knowing, in advance, how it is configured. (Editing fstab isn't going to work.)
So, I tried labels.
The fstab contains lines such as
LABEL=SOLD_ROOT_USB / ext3 defaults 1 1
LABEL=SOLD_HOME_USB /home ext3 defaults 1 2
LABEL=SOLD_SWAP_USB swap swap defaults 0 0
This works just fine on the IDE only computer. But when I visit the SATA computer that has Windows on /dev/sda1, I get the following.
/sbin/e2fsck:Bad magic number in super-block while trying to open /dev/sda1
/dev/sda1:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
This computer also has Linux (Slackware 11, 2.6.21.3) on the SATA drive. So, I can boot Linux and successfully execute
# e2fsck LABEL=SOLD_ROOT_USB
So I edit the first line in fstab to use /dev/sdb1 and boot.
Turns out it was time to check the fs. e2fsck identified the partition it was checking as SOLD_ROOT_USB.
Once booted, I find that /home is mounted with SOLD_HOME_USB still in fstab. I can umount and mount /home successfully.
If I try to fsck LABEL=SOLD_ROOT_USB, I get warned that /dev/sdb1 is mounted. Seems it's the correct label.
The problem with the name only seems to happen during boot and after the root fs is already mounted ro.
Finally here's a blkid dump in case that helps
/dev/sda1: TYPE="ntfs"
/dev/sda8: UUID="f7ae0cb6-c167-418e-b247-34b43603ca19" TYPE="ext2" LABEL="HUGH_TEST"
/dev/dvd: TYPE="iso9660"
/dev/sdb3: TYPE="swap" LABEL="SOLD_SWAP_USB" UUID="496df4d5-a1a7-4ce8-a37d-cf3804b4d0b8"
/dev/sdb2: LABEL="SOLD_HOME_USB" UUID="9a6f145d-ed9b-4abc-866c-8c139dfa7f40" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda9: UUID="f88a7cbe-ac10-4266-8eb1-9d7792edc1b0" SEC_TYPE="ext2" TYPE="ext3" LABEL="HUGH_TINY"
/dev/sda2: TYPE="ntfs"
/dev/sda3: TYPE="ntfs"
/dev/sda5: UUID="fb198432-1dab-45a9-b36b-ed003c2c8e48" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda6: UUID="727127da-4c7f-4dc1-9114-12944b2140f4" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda7: UUID="2fb4777e-afaf-47a3-b518-9ab47683f3a9" SEC_TYPE="ext2" TYPE="ext3"
/dev/cdrom: TYPE="iso9660"
/dev/sda10: TYPE="swap" LABEL="SWAP_HD" UUID="5367bc10-9160-4e99-83dd-66b5c184afac"
/dev/sdb1: LABEL="SOLD_ROOT_USB" UUID="780b0f7c-285d-45a2-8da8-ac8d6b195cd5" SEC_TYPE="ext2" TYPE="ext3"
|
|
|
|
08-17-2007, 12:13 AM
|
#2
|
|
LQ Newbie
Registered: Mar 2006
Posts: 10
Original Poster
Rep:
|
Update. The problem is inconsistent.
I just tried booting computer A (SATA) and then computer B (pure IDE). They both worked. But then I went back to the SATA box and it failed, trying to check sda1 (when it should be sdb1).
So, some of the time it works and some of the time it doesn't?
I'd put a sleep in there to give the usb drivers time to load but the root fs is already mounted read-only. The drivers are clearly running.
|
|
|
|
08-17-2007, 04:49 AM
|
#3
|
|
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,592
|
Looks to me like you need to boot with an initrd so all the drivers can register before trying to mount /.
You might try using rootdelay= in your bootloader line instead. Or you might put use '/dev/rootfs' as the boot device and depend on the bootloader line to specify the drive.
|
|
|
|
08-18-2007, 10:20 AM
|
#4
|
|
LQ Newbie
Registered: Mar 2006
Posts: 10
Original Poster
Rep:
|
Quote:
Originally Posted by gnashley
Looks to me like you need to boot with an initrd so all the drivers can register before trying to mount /.
You might try using rootdelay= in your bootloader line instead. Or you might put use '/dev/rootfs' as the boot device and depend on the bootloader line to specify the drive.
|
Thanks. I'm already using an initrd and rootdelay.
I'll read more about rootfs.
In the meantime, I solved the problem a different way. I had already determined the eventual root partition by using a tag file. The fs was already mounted rw. So, I updated its fstab file, on the fly, with the correct /dev/sd?? entry.
So, I don't need more help but am still interested in learning more about the problem. It still seems odd that ext2fs believes it finds the label and "thinks" it points to a different drive.
Anyway, thanks for the reply.
|
|
|
|
08-18-2007, 03:18 PM
|
#5
|
|
Member
Registered: Mar 2006
Location: Jersey
Distribution: Arch
Posts: 38
Rep:
|
Quote:
Originally Posted by hmccurdy
Thanks. I'm already using an initrd and rootdelay.
I'll read more about rootfs.
In the meantime, I solved the problem a different way. I had already determined the eventual root partition by using a tag file. The fs was already mounted rw. So, I updated its fstab file, on the fly, with the correct /dev/sd?? entry.
So, I don't need more help but am still interested in learning more about the problem. It still seems odd that ext2fs believes it finds the label and "thinks" it points to a different drive.
Anyway, thanks for the reply.
|
My Archlinux system works very similarly. I use persistent block device naming, via /dev/disk/by-label, and here's why.
GRUB, at least on my machine sees hd0,0 as the first boot device according to the BIOS, but udev seems to want to make this drive sdb1..NOT sda1, IF I have an additional SATA drive installed. What this boils down to is that, at least on my machine, hd0,0 is NOT necessarily sda1. If I have additional drives hooked up, I can either make the kernel line root=/dev/disk-by-label/archlinux -or- root=/dev/sdb1, even though GRUB is pointing to hd0,0 in both cases. So, the key for me, is not so much the persistent block device naming, but more the GRUB numbering scheme being in sync with my BIOS boot device ordering. So..as long as I have GRUB pointing to the right drive according to my boot order, I use disk labeling, which spares me from having to tweak menu.lst every time I change around my harddrives. (Which is often for me) Hope this helps. 
More info here: http://wiki.archlinux.org/index.php/..._device_naming
Last edited by Misfit138; 08-18-2007 at 03:20 PM.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:28 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|