LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 03-26-2009, 06:46 PM   #1
Scruff
Member
 
Registered: Oct 2002
Location: Stoughton, MA
Distribution: Gentoo x86_64 & PPC
Posts: 949

Rep: Reputation: 30
SATA and PATA keep switching drive alias


Hi all,

I just put together a new box and I'm using a 74gb Raptor (sata) for the OS - linux only for those who don't know me...

Raptor is plugged into SATA1 (DFI lanparty) and I have a 300gb (pata) drive where /home and a few other partitions are mounted.

My problem is this: sometimes when I boot, Raptor is sda, and sometimes Raptor is sdb. Editing fstab is getting annoying and obviously there has to be a solution, so has anyone else had this issue? The Raptor is jumpered to be MASTER, the other drive has no jumper on it at present.

I've built countless machines and never ran across this one before...

Thanks in advance!
 
Old 03-27-2009, 02:59 AM   #2
danguba
LQ Newbie
 
Registered: Oct 2007
Location: Kragujevac, Serbia
Distribution: OpenSuse 11
Posts: 9

Rep: Reputation: 0
Quote:
Originally Posted by Scruff View Post
Hi all,

I just put together a new box and I'm using a 74gb Raptor (sata) for the OS - linux only for those who don't know me...

Raptor is plugged into SATA1 (DFI lanparty) and I have a 300gb (pata) drive where /home and a few other partitions are mounted.

My problem is this: sometimes when I boot, Raptor is sda, and sometimes Raptor is sdb. Editing fstab is getting annoying and obviously there has to be a solution, so has anyone else had this issue? The Raptor is jumpered to be MASTER, the other drive has no jumper on it at present.

I've built countless machines and never ran across this one before...

Thanks in advance!
Hi,
my girlfriend had similar problem with OpenSuse. She managed to solve problem by setting the other drive to be primary. Try to do that.
All best
 
Old 03-27-2009, 08:23 AM   #3
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
udev Rules for the Hard drives..


Use udevinfo to get unique attributes about the devices you are going to write a rule for.

udevinfo -a -p /sys/block/sda | grep -i model
Gives the following output: SYSFS{model}="LD 0 RAID1 139G"

udevinfo -a -p /sys/block/sda | grep -i size
Gives the following output: SYSFS{size}="286515200"

udevinfo -a -p /sys/block/sdb | grep -i model
Gives the following output: SYSFS{model}="PERC 5/E Adapter"

udevinfo -a -p /sys/block/sdb | grep -i size
Gives the following output: SYSFS{size}="10732699648"

2. Now that we have unique information about each device, we can write a udev rule and rename each device.
cd /etc/udev/rules.d
vi 51-perc.rules


Place the following into the file:
SYSFS{size}="10732699648", SYSFS{model}="PERC 5/E Adapter", NAME="sdb"
SYSFS{size}="286515200", SYSFS{model}="LD 0 RAID1 139G", NAME="sda"


Issue a "udevstart"
 
Old 03-27-2009, 09:17 AM   #4
thorkelljarl
Senior Member
 
Registered: Jun 2008
Posts: 1,820

Rep: Reputation: 229Reputation: 229Reputation: 229
Make it easy for that poor machine.

On my SATA mother board the first SATA is SATAII0.It may make no difference, but you might put your Raptor, jumpered as Master, on the first controller connection. Also, set the jumper on the PATA HDD as Master.

I would want the jumpers and the boot flags on both the HDD to reflect what you want them to be, one to be seen first as the HDD to boot from, and one to be seen thereafter.

You might check your BIOS to see how the two HDD are detected, and if there are any settings in the BIOS boot sequence that determine the HDD to be booted. On my board, A Gigabyte, there are, under Hard Disk Boot Priority, choices for First Boot Device, Second, etc. Upon selecting Hard Disk as one of the devices to boot from, I may press "enter" and choose HDD0 or HDD1, etc. for the SATA HDD.

My assumption is that the BIOS is presenting linux with whichever HDD it manages to find first and that the BIOS setup presents them as equally valid for presentation to the OS.

The post from farslayer may well be the one to fix the problem, but I would think that a logical solution might as well also rest on a good electronic base, those sequences and jumpers for example.

Good Luck

Last edited by thorkelljarl; 03-27-2009 at 09:26 AM.
 
Old 03-27-2009, 11:04 AM   #5
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
changing drive jumpers or BIOS settings may work for the short term, but my concern is then you add another drive to the system, or leave a USB drive plugged in over a reboot, and you are troubleshooting all over again.. if drive device names that change is an issue, I would try to address the issue where it's occurring..

The udev rules are fixed and won't change, so you can build the rule set as you go, or add to the system.


Best of luck and remember to feed back with your final working solution.. Might be something completely different than we've provided thus far




There are so many interfaces on motherboards these days, SATA, SATA RAID, PATA, PATA RAID, eSATA, USB, etc.. who knows which one the system is going to present first to the OS.. I'm ultimately the one that ends up sitting there scratching my head wondering why didn't the system boot this time ? I have one system that refuses to complete POST if I forget to unplug my External USB Hard drive.. now what's that all about ? I could see it failing to start Linux, but not completing POST even with an error ? It can be trying at times
 
Old 03-27-2009, 11:56 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You can also use the UUID number in grub and /etc/fstab. Then the correct filesystem is selected even if the node assignment changes.
In fstab you can use UUID=<UUID #> instead of the device node.
 
Old 03-27-2009, 01:36 PM   #7
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
And, just to nit-pick, those (/dev/sda, ...) names are not drive aliases. They are the names assigned to the physical drives presented to the kernel in the order specified by your GRUB settings which is, by default, the order specified by the BIOS, but you can change that with the GRUB map directives.

If you want to have drive aliases, you can use udev to create symlinks from the physical drive name (based on drive characteristics as described above) to any mnemonic name you want to use.
 
Old 03-27-2009, 02:27 PM   #8
Scruff
Member
 
Registered: Oct 2002
Location: Stoughton, MA
Distribution: Gentoo x86_64 & PPC
Posts: 949

Original Poster
Rep: Reputation: 30
Wow, all great suggestions particularly the UUID and udev posts. To thorkelljarl - I am using the first SATA connect and set to MASTER. There are 8 in this machine numbered 1-8 which is why I'm puzzled in the first place. Drives order is set correctly in the BIOS as well.

I'll most likely give the UUID one a shot. Should be a painless and relatively elegant way to go about it.

Thanks again!

-Scruff

Last edited by Scruff; 03-27-2009 at 02:34 PM.
 
Old 04-07-2009, 11:48 AM   #9
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by farslayer View Post
Best of luck and remember to feed back with your final working solution.. Might be something completely different than we've provided thus far
So, what worked?
 
Old 04-07-2009, 12:34 PM   #10
Scruff
Member
 
Registered: Oct 2002
Location: Stoughton, MA
Distribution: Gentoo x86_64 & PPC
Posts: 949

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by archtoad6 View Post
So, what worked?
Sorry, forgot to post it. I went with the UUID solution and it works fine. You can find the UUID's with vol_id:

Code:
sudo vol_id -u /dev/sdaN
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing to PATA disk on motherboards that use SATA and "legacy" PATA. demianph Slackware - Installation 1 07-02-2008 10:15 AM
kernel accessing pata cd rom drive instead of sata OS hard drive for filesystem elaps2007 Linux - Kernel 0 03-19-2008 09:39 AM
PATA vs. SATA ddaas Linux - Hardware 7 04-24-2007 02:06 PM
New motherboard with SATA and PATA won't boot linux from PATA centosian Linux - General 4 08-14-2006 10:24 AM
FC3 and SATA/150 running with PATA drive PatRay Linux - Hardware 0 04-14-2005 07:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration