LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Ubuntu Server with 10 HDDs! Harddrive Oddity! (https://www.linuxquestions.org/questions/linux-server-73/ubuntu-server-with-10-hdds-harddrive-oddity-563356/)

wildone 06-21-2007 12:14 AM

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

archtoad6 06-21-2007 07:44 AM

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

wildone 06-21-2007 06:09 PM

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

Hern_28 06-21-2007 06:15 PM

Mount by drive id.
 
You can mount them by drive id. that would stop them from switching around every reboot on you.

wildone 06-21-2007 06:46 PM

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.

Hern_28 06-21-2007 06:51 PM

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.

wildone 06-21-2007 08:00 PM

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.

wildone 06-24-2007 09:14 PM

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. :)

archtoad6 06-25-2007 08:57 AM

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.

wildone 06-26-2007 04:52 AM

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"
__________________

Hern_28 06-27-2007 11:27 AM

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 :)

wildone 06-29-2007 06:51 AM

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

Hern_28 06-29-2007 08:30 AM

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 :D. 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 :).

wildone 07-01-2007 06:49 PM

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 :D. 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. :D


All times are GMT -5. The time now is 08:19 PM.