You are not logged in.

#1 2010-06-10 05:04:14

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

[SOLVED] Arch won't mount my hard drives correctly, problems at boot.

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

#2 2010-06-10 05:31:11

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

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

#3 2010-06-10 08:13:09

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

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

#4 2010-06-15 03:42:42

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

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

#5 2010-06-15 04:14:33

kgas
Member
From: Qatar
Registered: 2008-11-08
Posts: 718

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

you need to use the uuid in fstab.

Offline

#6 2010-06-15 06:24:09

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

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

#7 2010-06-15 06:30:49

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

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

#8 2010-06-15 07:48:14

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

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

#9 2010-06-15 07:52:34

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

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

#10 2010-06-15 17:20:35

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

Dude, the link tomk gave ...


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#11 2010-06-15 17:51:59

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

trusktr wrote:

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

#12 2010-06-15 19:46:20

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

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! big_smile wink


joe@trusktr.io - joe at true skater dot io.

Offline

#13 2010-06-16 08:32:15

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

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

#14 2010-06-16 09:26:01

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

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? wink

Last edited by trusktr (2010-06-16 09:26:21)


joe@trusktr.io - joe at true skater dot io.

Offline

#15 2010-06-16 11:00:10

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

Enter "UUID" in the wiki search box. smile

Offline

#16 2010-06-16 11:23:27

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

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

#17 2010-06-29 17:08:56

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] Arch won't mount my hard drives correctly, problems at boot.

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. big_smile

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

Board footer

Powered by FluxBB