You are not logged in.
Sometimes (only sometimes) Arch Linux will have an error during bootup because my Linux drive gets mounted as sdb instead of sda. My NTFS Sata storage drives gets mounted in its place as sda.
When this happens, Arch Linux will stop booting at the "checking filesystems" step:
:: Checking Filesystems [BUSY]
/dev/sda3:
The superblock could not be read or does not describe a corect 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>
[FAIL]
**************** FILESYSTEM CHECK FAILED ****************
* *
* Please repair manually and reboot. Note that the root *
* file system is currently mounted read-only. To remount *
* it read-write type: mount -n -o remount,rw / *
* When you exit the maintenance shell the system will *
* reboot automatically. *
* *
***********************************************************
Give root password for maintenance
(or type Control-D to continue):
And from there i have to remount my drives manually or restart the computer. Everytime I start the computer, I simply have to hope that my Linux drive will mount as sda. It's totally hit and miss.
Now, I know that my superblock is not corrupt. fsck is failing because it is looking for my linux filesystem on sda. It is encountering my NTFS Sata drive on sda instead of the expected Linux ext filesystem.
So how do I know that this is happening?
Well, after giving the root password, it shows the root prompt
[root@(none) ~]#
and i proceed to use the lshw command to see what's up with the drives:
[root@(none) ~]# lshw -short | grep /dev/
/0/6/0.0.0 /dev/sdb disk 120GB WDC WD1200JB-00E
/0/6/0.0.0/1 /dev/sdb1 volume 101MiB Linux filesystem partition
/0/6/0.0.0/2 /dev/sdb2 volume 258MiB Linux swap volume
/0/6/0.0.0/3 /dev/sdb3 volume 7506MiB EXT4 volume
/0/6/0.0.0/4 /dev/sdb4 volume 104GiB EXT4 volume
/0/6/0.1.0 /dev/sdc disk 81GB Maxtor 6Y080P0
/0/6/0.1.0/1 /dev/sdc1 volume 76GiB Windows NTFS volume
/0/8/0.0.0 /dev/sda disk 640GB Hitachi HDT72106
/0/8/0.0.0/1 /dev/sda1 volume 596GiB Windows NTFS volume
So, clearly, this shows that my Linux drive has gotten mounted as sdb and my NTFS Sata drive has gottem mounted as sda. It's totally random: sometimes they mount vice versa and the system boots just fine.
When Arch does happen to mount itself properly as sda and the system starts successfully, then the lshw command shows this:
[root@(none) ~]# lshw -short | grep /dev/
/0/6/0.0.0 /dev/sda disk 120GB WDC WD1200JB-00E
/0/6/0.0.0/1 /dev/sda1 volume 101MiB Linux filesystem partition
/0/6/0.0.0/2 /dev/sda2 volume 258MiB Linux swap volume
/0/6/0.0.0/3 /dev/sda3 volume 7506MiB EXT4 volume
/0/6/0.0.0/4 /dev/sda4 volume 104GiB EXT4 volume
/0/6/0.1.0 /dev/sdb disk 81GB Maxtor 6Y080P0
/0/6/0.1.0/1 /dev/sdb1 volume 76GiB Windows NTFS volume
/0/8/0.0.0 /dev/sdc disk 640GB Hitachi HDT72106
/0/8/0.0.0/1 /dev/sdc1 volume 596GiB Windows NTFS volume
The above correctly mounted format shows the drives in the same order as my Hard Disk boot priority in BIOS as well as in the same order as during the initial drive detection directly following the memory test (don't know if it has anything to do with it though).
So my question is this. How do I ensure that Arch Linux mounts itself as sda ALL of the time, and not randomly?
Or should I remove my sda entries in etc/fstab and let Arch determine where my Linux filesystems are? If so, how?
It's interesting to note that GRUB is set to boot Arch Linux from hd0, which should be sda.
It's also intriguing to note that if I take out my Sata drive, I never encounter this problem.
Last edited by trusktr (2010-06-15 07:49:31)
joe@trusktr.io - joe at true skater dot io.
Offline
I think the way to fix this is to lock them down with udev rules:
http://www.reactivated.net/writing_udev_rules.html
You probably should map a UUID to device name
Last edited by ewaller (2010-06-10 05:32:06)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
You don't need any extra udev rules - just use UUIDs or labels, as described here.
BTW, Arch installs using UUIDs by default - you must have changed it yourself.
Read the wiki's grub page as well - grub has it's own naming scheme for block devices, hence the hd0/sda difference.
Offline
See, that's what i thought tomk! I haven't changed anything. The uuid's are set as follows (without the problematic sata drive connected):
[trusktr@rocketship ~]$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Jun 14 14:37 01CA836D8BE82040 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jun 14 14:37 0ddf0e41-e7e6-4af5-b0e9-bc79a91b12eb -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun 14 14:37 92b88528-dd0f-4c1b-bcce-54084ef2aceb -> ../../sda4
lrwxrwxrwx 1 root root 10 Jun 14 14:37 cdb33de5-0100-4c5f-a9b1-5c1a444e6eac -> ../../sda3
lrwxrwxrwx 1 root root 10 Jun 14 14:37 d0a5d49d-169d-43ce-af0f-216dc4a9f604 -> ../../sda2
Let me see what i get when i return after connecting the sata drive and rebooting...
joe@trusktr.io - joe at true skater dot io.
Offline
you need to use the uuid in fstab.
Offline
Thanks kgas, here's what i found out so far:
Alright so after rebooting, this is what i determined:
When Linux mounts the drives incorrectly (take note of the parts in bold, the short numbers are NTFS filesystems, long numbers the Linux filesystems):
[trusktr@rocketship ~]$ ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Jun 14 21:08 01CA836D8BE82040 -> ../../[b]sdc1[/b]
lrwxrwxrwx 1 root root 10 Jun 14 21:08 0ddf0e41-e7e6-4af5-b0e9-bc79a91b12eb -> ../../[b]sdb1[/b]
lrwxrwxrwx 1 root root 10 Jun 14 21:08 92b88528-dd0f-4c1b-bcce-54084ef2aceb -> ../../[b]sdb4[/b]
lrwxrwxrwx 1 root root 10 Jun 14 21:08 C838CF5838CF4462 -> ../../[b]sda1[/b]
lrwxrwxrwx 1 root root 10 Jun 14 21:08 cdb33de5-0100-4c5f-a9b1-5c1a444e6eac -> ../../[b]sdb3[/b]
lrwxrwxrwx 1 root root 10 Jun 14 21:08 d0a5d49d-169d-43ce-af0f-216dc4a9f604 -> ../../[b]sdb2[/b]
So an NTFS filesystem is mounted in sda instead of the Linux filesystem
When Linux mounts everything properly:
[trusktr@rocketship ~]$ ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Jun 14 21:08 01CA836D8BE82040 -> ../../[b]sdb1[/b]
lrwxrwxrwx 1 root root 10 Jun 14 21:08 0ddf0e41-e7e6-4af5-b0e9-bc79a91b12eb -> ../../[b]sda1[/b]
lrwxrwxrwx 1 root root 10 Jun 14 21:08 92b88528-dd0f-4c1b-bcce-54084ef2aceb -> ../../[b]sda4[/b]
lrwxrwxrwx 1 root root 10 Jun 14 21:08 C838CF5838CF4462 -> ../../[b]sdc1[/b]
lrwxrwxrwx 1 root root 10 Jun 14 21:08 cdb33de5-0100-4c5f-a9b1-5c1a444e6eac -> ../../[b]sda3[/b]
lrwxrwxrwx 1 root root 10 Jun 14 21:08 d0a5d49d-169d-43ce-af0f-216dc4a9f604 -> ../../[b]sda2[/b]
This doesn't tell us much except that I indeed do have uuid's for all the drives.
So, i guess as kgas said, i probably need to use the uuid in fstab so that Linux always knows which hard drive is the linux drive! In that case, only the uuid for the Linux drive will be necessary. For the other drives it wouldn't matter so much i guess since they don't contain the operating system.
Alright, i'll be back to determine if this fixes it!
Last edited by trusktr (2010-06-15 06:41:25)
joe@trusktr.io - joe at true skater dot io.
Offline
How can one mount oneself?
What a perverse thought...
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
haha moljac!
Alright, it works!!! I've used UUID's in fstab so now my main Linux drive is no longer mounted randomly as another drive (sdb, sdc, etc...).
For anyone wondering, this is what my fstab looks like. I've put the UUID's only for my linux filesystems:
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
devpts /dev/pts devpts defaults 0 0
shm /dev/shm tmpfs nodev,nosuid 0 0
# /dev/cdrom /media/cd auto ro,user,noauto,unhide 0 0
# /dev/dvd /media/dvd auto ro,user,noauto,unhide 0 0
# /dev/fd0 /media/fl auto user,noauto 0 0
UUID=0ddf0e41-e7e6-4af5-b0e9-bc79a91b12eb /boot ext2 defaults 0 1 #/dev/sda1
UUID=d0a5d49d-169d-43ce-af0f-216dc4a9f604 swap swap defaults 0 0 #/dev/sda2
UUID=cdb33de5-0100-4c5f-a9b1-5c1a444e6eac / ext4 defaults 0 1 #/dev/sda3
UUID=92b88528-dd0f-4c1b-bcce-54084ef2aceb /home ext4 defaults 0 1 #/dev/sda4
Woooo!
So just in case you're wondering why this works, it's because sometimes your BIOS might list your drives in a random order depending on which drives are detected first by the motherboard and this will change the order that Linux mounts them, unless specifically stated like I just did above.
But, in this situation, I don't understand how GRUB continues to work because hd0 sould no longer be the same sda1!
joe@trusktr.io - joe at true skater dot io.
Offline
These two articles do a good job describing the problem and how to fix it:
http://linux.byexamples.com/archives/32 … with-uuid/
http://www.g-loaded.eu/2009/01/04/alway … -in-fstab/
joe@trusktr.io - joe at true skater dot io.
Offline
Dude, the link tomk gave ...
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
But, in this situation, I don't understand how GRUB continues to work because hd0 sould no longer be the same sda1!
No, GRUB uses the physical positions of the devices to get the names. The first HDD on the first controller is hd0, the second hd1, etc etera.
Last edited by Barrucadu (2010-06-15 17:52:13)
Offline
Oh yeah filesystemchecked, tomk's link is really good too! I happened to find those articles right before checking his link. The articles seem a little bit clearer with the examples though. I'm gunna see if I can put in some examples so to the Wiki page so newbs don't get scared off!
joe@trusktr.io - joe at true skater dot io.
Offline
trusktr - the link I gave you is not particularly intended for newbs, just like Arch itself. Feel free to edit if you want to, but the info already provided is more than enough for the average Archer.
Whatever issues you encounter, always check our wiki first - a lot of people have put a lot of work into it based on their own first hand experience, and it is more likely to be directly relevant than generic pages thrown up by Google.
Finally, a personal request - do you think you could stop using exclamation marks? Or at least cut down a bit? TIA
Offline
Very true, although i had no idea how to find that wiki page. Your link was the only way for me to reach that page. I hadn't any idea what search terms to use. Thanks for the link.
Is that better?
Last edited by trusktr (2010-06-16 09:26:21)
joe@trusktr.io - joe at true skater dot io.
Offline
Enter "UUID" in the wiki search box.
Offline
I still prefer labels, and would recommend them over UUIDs
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
One really cool thing about all this tomk is that trying to set up and configure Arch Linux for your needs in fact teaches you basics of Linux. I never tried Linux until this year, with Arch Linux as my first choice of Distro ever.
So although the wiki is definitely great for the average Archer, some pages i think could include a few extra details so new users will find Arch as not just an amazing distro, but a great way to easily learn alot about Linux. Me for example, I've learnt so much that I wouldn't have if i simply installed LMint or Ubuntu, etc.
So whenever i have the opportunity to expand any of the wiki pages with my small contributions, I definitely will!
joe@trusktr.io - joe at true skater dot io.
Offline