LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-21-2007, 12:14 AM   #1
wildone
LQ Newbie
 
Registered: Jun 2007
Posts: 9

Rep: Reputation: 0
SOLVED: Ubuntu Server with 10 HDDs! Harddrive Oddity!


hey guys, i got a strange problem i cant figure out. I have googled, i have asked guru's but with no avail.

WHAT I AM TRYING TO DO: Have VMware Machines have direct access to harddrives, eg i want to create a virtual harddrive in VMWare Server pointing to /dev/sda.

WHAT IS MY PROBLEM: On the HOST harddrives change their oder "/dev/sda" at every boot (musical chairs!!). eg if i run "cat /proc/partitions" then reboot and run it again the hardrives just move around. This mean my VMs have a problem.

WHAT I WOULD I LIKE TO HAPPEN: Hardrives stop changin their order at every boot. (no more musical chairs, if its /dev/sda, it stais like that forever)

WHAT I DO NOT WANT TO: Mount the drives in Ubuntu, we all know what can happen

MY CONFIG: Ubuntu 7.0.4, VMWare Server 1.0.3

original thread http://ubuntuforums.org/showthread.php?t=479134

APPENDIX

************************************************** **********************************
>lspci

00:00.0 Host bridge: Intel Corporation 82875P/E7210 Memory Controller Hub (rev 02)
00:01.0 PCI bridge: Intel Corporation 82875P Processor to AGP Controller (rev 02)
00:03.0 PCI bridge: Intel Corporation 82875P/E7210 Processor to PCI to CSA Bridge (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #3 (rev 02)
00:1d.3 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #4 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c2)
00:1f.0 ISA bridge: Intel Corporation 82801EB/ER (ICH5/ICH5R) LPC Interface Bridge (rev 02)
00:1f.2 IDE interface: Intel Corporation 82801EB (ICH5) SATA Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801EB/ER (ICH5/ICH5R) SMBus Controller (rev 02)
00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)
01:00.0 VGA compatible controller: ATI Technologies Inc Radeon R350 [Radeon 9800 Pro]
01:00.1 Display controller: ATI Technologies Inc Radeon R350 [Radeon 9800 Pro] (Secondary)
02:01.0 Ethernet controller: Intel Corporation 82547GI Gigabit Ethernet Controller
03:02.0 FireWire (IEEE 1394): Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)
03:03.0 RAID bus controller: Silicon Image, Inc. SiI 3112 [SATALink/SATARaid] Serial ATA Controller (rev 02)
03:05.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)
03:06.0 RAID bus controller: Silicon Image, Inc. Adaptec AAR-1210SA SATA HostRAID Controller (rev 02)
03:07.0 RAID bus controller: Adaptec Serial ATA II RAID 1420SA (rev 01)

************************************************** **********************************


************************************************** **********************************
>cat /proc/partitions

* this table changes every boot, SDA drive which is 250GB will become some other letter SD(ABCE..)

major minor #blocks name

8 0 244140625 sda
8 1 244131741 sda1
8 16 244198584 sdb
8 17 244196001 sdb1
8 32 244198584 sdc
8 33 244196001 sdc1
8 48 390711384 sdd
8 49 390708801 sdd1
8 64 72613056 sde
8 65 1 sde1
8 66 10337796 sde2
8 69 61761861 sde5
8 70 505984 sde6
8 80 244198584 sdf
8 81 244196001 sdf1
8 96 488386584 sdg
8 97 488384001 sdg1
8 112 488386584 sdh
8 113 488384001 sdh1
8 128 732574584 sdi
8 129 732572001 sdi1
8 144 244198584 sdj
8 145 244196001 sdj1

************************************************** **********************************


i understand about fstab and i can mount the drives but i need VMware server to use the drives directry and it uses them via /dev/sda. But the drives just keep on moving around, see below:

i ran the [ls -al /dev/disk/by-uuid] then rebooted then [ls -al /dev/disk/by-uuid] agains here is the output:


lrwxrwxrwx 1 root root 10 2007-06-20 17:08 0840027F4002742A -> ../../sdb1
lrwxrwxrwx 1 root root 10 2007-06-20 17:08 2E84F48D84F45933 -> ../../sdc1
lrwxrwxrwx 1 root root 10 2007-06-20 17:08 32ee675d-2c5d-4811-a9f0-2ee3d7adaccb -> ../../sda6
lrwxrwxrwx 1 root root 10 2007-06-20 17:08 443001D03001C9BE -> ../../sdd1
lrwxrwxrwx 1 root root 10 2007-06-20 17:08 4CF47FEBF47FD5A4 -> ../../sde1
lrwxrwxrwx 1 root root 10 2007-06-20 17:08 6C14A1F314A1C086 -> ../../sdg1
lrwxrwxrwx 1 root root 10 2007-06-20 17:08 7CD034E3D034A574 -> ../../sdj1
lrwxrwxrwx 1 root root 10 2007-06-20 17:08 AC1CD5DE1CD5A41C -> ../../sdi1
lrwxrwxrwx 1 root root 10 2007-06-20 17:08 DA440CE7440CC7E9 -> ../../sda5
lrwxrwxrwx 1 root root 10 2007-06-20 17:08 e310c008-3a6b-46b9-9363-0b59b32f4168 -> ../../sdh1
lrwxrwxrwx 1 root root 10 2007-06-20 17:08 F840A4BF40A485CA -> ../../sdf1
lrwxrwxrwx 1 root root 10 2007-06-20 17:08 fb79e510-7e6c-4131-9096-8d8c737bde34 -> ../../sda2


**REBOOT


lrwxrwxrwx 1 root root 10 2007-06-21 00:29 0840027F4002742A -> ../../sdj1
lrwxrwxrwx 1 root root 10 2007-06-21 00:29 2E84F48D84F45933 -> ../../sda1
lrwxrwxrwx 1 root root 10 2007-06-21 00:29 32ee675d-2c5d-4811-a9f0-2ee3d7adaccb -> ../../sdi6
lrwxrwxrwx 1 root root 10 2007-06-21 00:29 443001D03001C9BE -> ../../sdb1
lrwxrwxrwx 1 root root 10 2007-06-21 00:29 4CF47FEBF47FD5A4 -> ../../sdc1
lrwxrwxrwx 1 root root 10 2007-06-21 00:29 6C14A1F314A1C086 -> ../../sde1
lrwxrwxrwx 1 root root 10 2007-06-21 00:29 7CD034E3D034A574 -> ../../sdh1
lrwxrwxrwx 1 root root 10 2007-06-21 00:29 AC1CD5DE1CD5A41C -> ../../sdg1
lrwxrwxrwx 1 root root 10 2007-06-21 00:29 DA440CE7440CC7E9 -> ../../sdi5
lrwxrwxrwx 1 root root 10 2007-06-21 00:29 e310c008-3a6b-46b9-9363-0b59b32f4168 -> ../../sdf1
lrwxrwxrwx 1 root root 10 2007-06-21 00:29 F840A4BF40A485CA -> ../../sdd1
lrwxrwxrwx 1 root root 10 2007-06-21 00:29 fb79e510-7e6c-4131-9096-8d8c737bde34 -> ../../sdi2

Last edited by wildone; 06-24-2007 at 09:14 PM. Reason: SOLVED.
 
Old 06-21-2007, 07:44 AM   #2
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
Sorry if I should know the answer to this by reading the output you posted, but I don't use VMserver enough yet to figure it out.

Is this "musical drives on reboot" happening in the host OS, or the VM's? It sounds from your description as if it's the host. If that's the case, you have a VERY interesting problem. I have never seen or even heard of this before. AFAIK, this is supposed to be impossible in Linux, hda is always the Primary Master IDE, etc. (Soon to change in the new kernels, when everything will be sdx.)
 
Old 06-21-2007, 06:09 PM   #3
wildone
LQ Newbie
 
Registered: Jun 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by archtoad6
Sorry if I should know the answer to this by reading the output you posted, but I don't use VMserver enough yet to figure it out.

Is this "musical drives on reboot" happening in the host OS, or the VM's? It sounds from your description as if it's the host. If that's the case, you have a VERY interesting problem. I have never seen or even heard of this before. AFAIK, this is supposed to be impossible in Linux, hda is always the Primary Master IDE, etc. (Soon to change in the new kernels, when everything will be sdx.)

Thanks for the reply mate, you are right the "musical drives on reboot" happen in HOST PC, so i cant even mount them in VM because the path changes every reboot. I only have one IDE CD-ROM and 10 SATA HDD's (4 HDD's on MB SATA, 4 on 1st SATA Cards, and 2 on 2nd SATA Card).
 
Old 06-21-2007, 06:15 PM   #4
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Mount by drive id.

You can mount them by drive id. that would stop them from switching around every reboot on you.
 
Old 06-21-2007, 06:46 PM   #5
wildone
LQ Newbie
 
Registered: Jun 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Hern_28
You can mount them by drive id. that would stop them from switching around every reboot on you.
yeh you are right i can also mount them by labeel, but i want VMs to access harddisk directly via /dev/sda etc, no mounting this way the posibility of killing the data is lower.
 
Old 06-21-2007, 06:51 PM   #6
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Udev Rules

Couldn't you also write udev rules to create consistant device links /dev/sda* for each drive?
Haven't tried it with internal hd's yet, only plugin externals that borked and give the same problem.

Edit I write rules because I have quite a few external drives, and memory sticks and such and naming is order dependent.

Last edited by Hern_28; 06-21-2007 at 06:54 PM.
 
Old 06-21-2007, 08:00 PM   #7
wildone
LQ Newbie
 
Registered: Jun 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Hern_28
Couldn't you also write udev rules to create consistant device links /dev/sda* for each drive?
Haven't tried it with internal hd's yet, only plugin externals that borked and give the same problem.

Edit I write rules because I have quite a few external drives, and memory sticks and such and naming is order dependent.
thanks for the tip, ill try it and let you know how i go.
 
Old 06-24-2007, 09:14 PM   #8
wildone
LQ Newbie
 
Registered: Jun 2007
Posts: 9

Original Poster
Rep: Reputation: 0
hey Hern_28, thanks for the tip, i figured out the UDEV Rules, they work good, a had to figure out a few triks on my own but all working now.
 
Old 06-25-2007, 08:57 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
Thanks for letting us, especially Hern_28, know we helped you.

BTW, would you please post your "triks" -- they might help the person w/ the same problem.
 
Old 06-26-2007, 04:52 AM   #10
wildone
LQ Newbie
 
Registered: Jun 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Cool Solved

SOLUTION:

Well all the drives i have are SATA and for some reason kernel loads all of them in different order at boot into /sys/block and names them sda, sdb ...


I created a file "70-local.rules" purpously after "65-persistent-storage.rules", for a reason that i let the udev create all the symlink everywhere it want to and then just rename the disk and partitions to the names i want.
see "70-local.rules" file for more detail.

I used the disk serial to be exact i am picking the right disk, unlike some examples online!

To find out your disk serial do:

#-n = name

udevinfo -q all -n /dev/sda

OR

#-p = path

udevinfo -q all -p /sys/block/sda


********************* udevinfo -q all -n /dev/sda

P: /block/sdi <- path is still what KERNEL load it as
N: sda <- but the name is what i gave it.
L: 0
S: disk/by-id/scsi-1ATA_WDC_WD740GD-00FLA0_WD-WMAKE1145287
S: disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0
E: ID_VENDOR=ATA
E: ID_MODEL=WDC_WD740GD-00FL
E: ID_REVISION=21.0
E: ID_SERIAL=1ATA_WDC_WD740GD-00FLA0_WD-WMAKE1145287
E: ID_SERIAL_SHORT=ATA_WDC_WD740GD-00FLA0_WD-WMAKE1145287
E: ID_TYPE=disk
E: ID_BUS=scsi
E: ID_PATH=pci-0000:00:1f.2-scsi-0:0:0:0




********************* 70-local.rules

#-> for disks these rules will apply
#
#KERNEL=="sd*[!0-9]" means match drive named {sd[!=not 0-9]} only sda...sdz
#NAME="sda" set the name to SDA etc
#
#-> for partitions these rules will apply
#
#KERNEL=="sd*[0-9]" now match all other sda0..9 etc
#NAME="sda%n" %n will be the partition number
#
#


#D OS & ServerData
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD740GD-00FLA0_WD-WMAKE1145287", NAME="sda"
KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD740GD-00FLA0_WD-WMAKE1145287", NAME="sda%n"

#E Data1
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD2500JD-75FYB0_WD-WMAEH1924391", NAME="sdb"
KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD2500JD-75FYB0_WD-WMAEH1924391", NAME="sdb%n"

#F Data2 - VM Store
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD2500JD-00GBB0_WD-WMAEP1708011", NAME="sdc"
KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD2500JD-00GBB0_WD-WMAEP1708011", NAME="sdc%n"

#G Data3
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD2500JD-50FYB0_WD-WMAEH2709188", NAME="sdd"
KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD2500JD-50FYB0_WD-WMAEH2709188", NAME="sdd%n"

#H Data4
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD2500JD-50FYB0_WD-WMAEH2708798", NAME="sde"
KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD2500JD-50FYB0_WD-WMAEH2708798", NAME="sde%n"

#I Data5
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD2500JD-40GBB2_WD-WMAEP3646983", NAME="sdf"
KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD2500JD-40GBB2_WD-WMAEP3646983", NAME="sdf%n"

#J Data6
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD4000YR-01PLB0_WD-WMAMY1186058", NAME="sdg"
KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD4000YR-01PLB0_WD-WMAMY1186058", NAME="sdg%n"

#K Data7
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="1ATA_ST3750640AS_5QD0426Q", NAME="sdh"
KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="1ATA_ST3750640AS_5QD0426Q", NAME="sdh%n"

#L Data8
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD5000AAKS-00TMA0_WD-WCAPW0740007", NAME="sdi"
KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD5000AAKS-00TMA0_WD-WCAPW0740007", NAME="sdi%n"

#M Data9
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD5000AAKS-00TMA0_WD-WCAPW0736066", NAME="sdj"
KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="1ATA_WDC_WD5000AAKS-00TMA0_WD-WCAPW0736066", NAME="sdj%n"
__________________

Last edited by wildone; 06-26-2007 at 04:53 AM.
 
Old 06-27-2007, 11:27 AM   #11
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Anytime man :)

A good link that is a pretty basic how-to on udev rules that I found useful was :

http://www.reactivated.net/writing_udev_rules.html

Covers pretty nicely what he had to do .

Edit:

If you are running slackware and don't have internet at home the same page is in
/usr/doc/udev-(version)/doc/writing_udev_rules/index.html

You can choose how exactly you wish to identify the drive i.e. name, serial number, brand and so on. Just use the udev tools to find the info as wildone did and you can use the info {} to identify the drive and then test the settings. You can also use udev rules to run scripts for ex, auto-mount the drive on insertion and place a folder or link to a folder on your desktop

Last edited by Hern_28; 06-27-2007 at 01:12 PM.
 
Old 06-29-2007, 06:51 AM   #12
wildone
LQ Newbie
 
Registered: Jun 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Hern_28
A good link that is a pretty basic how-to on udev rules that I found useful was :

http://www.reactivated.net/writing_udev_rules.html

Covers pretty nicely what he had to do .

Edit:

If you are running slackware and don't have internet at home the same page is in
/usr/doc/udev-(version)/doc/writing_udev_rules/index.html

You can choose how exactly you wish to identify the drive i.e. name, serial number, brand and so on. Just use the udev tools to find the info as wildone did and you can use the info {} to identify the drive and then test the settings. You can also use udev rules to run scripts for ex, auto-mount the drive on insertion and place a folder or link to a folder on your desktop

yeah i know about that link, it does not cover the most important "udevinfo -q all" option and does not have any hdd examples otherwise its good.
thanks
 
Old 06-29-2007, 08:30 AM   #13
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
True.

But the only other ones i find are not newbie friendly, and most everyone else (Like me I hope) will use the man pages . It just gives a general outline for it but you do still have to figure some things out for yourself.

Link wasn't really for you, not being rude, your just already beyond it . Just posted it so newbies with the same problem searching the forum could get a general format. Your addition to it makes it more useful and allows for them to do something a little more advanced.

Edit: I had never tried to write a udev rule to force naming on internal drives, but find the fact it can be done extremely useful. Thank you for posting your how to .

Last edited by Hern_28; 06-29-2007 at 08:44 AM.
 
Old 07-01-2007, 06:49 PM   #14
wildone
LQ Newbie
 
Registered: Jun 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Hern_28
But the only other ones i find are not newbie friendly, and most everyone else (Like me I hope) will use the man pages . It just gives a general outline for it but you do still have to figure some things out for yourself.

Link wasn't really for you, not being rude, your just already beyond it . Just posted it so newbies with the same problem searching the forum could get a general format. Your addition to it makes it more useful and allows for them to do something a little more advanced.

Edit: I had never tried to write a udev rule to force naming on internal drives, but find the fact it can be done extremely useful. Thank you for posting your how to .

No problem Hern, thanks for the reply, good to see a few good people on this forum, hopefully i can contribute more in the future.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Intel i810 on-board graphics card bug, with Ubuntu server 7.04 running Ubuntu-Desktop calebf Linux - Server 2 05-14-2007 11:53 PM
Fedora Core 6 won't recognize second internal harddrive or usb harddrive Rockgod1969 Linux - Hardware 14 01-26-2007 01:03 AM
Accessing other HDDs/Booting from other HDDs Namatacka Ubuntu 2 05-07-2006 11:21 AM
How do I duplicate a server harddrive? The_Nerd Linux - Software 1 03-28-2005 01:06 PM
Installing linux on 2nd harddrive(dual boot) windows on seperate harddrive lysol Linux - Software 25 08-03-2004 09:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:45 PM.

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