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 07-20-2011, 07:26 PM   #1
bluekill14
LQ Newbie
 
Registered: Jul 2006
Posts: 20

Rep: Reputation: 2
Adding disk - jumble of disk device names


The scenario is I have added 4 new sata disk, I attached, power, mount and added fstab entries each disk for every reboot. Disk1 is detected as sdb1, then disk2 is sdc1, then disk3 is sdd1, and here comes the problem, disk4 is detected as sdb1 instead of sde1.

My fix is running blkid and exchanging the UUID and the mount points of disk1 and disk4. There is no issue after restart, device names and mount points are ok.

In adding the 5th old sata disk which contains files to be transferred on the 4 new disk, device name assignments jumbled again. To make the story short I was able to transfer files from the old disk to the 4 new disk, shutdown, removed the old disk, power it on, and device names and mount points are ok again.

What should be the adjustments in disk mounting or adding fstab entries to keep that from happening?

Thank you
 
Old 07-20-2011, 07:42 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
If you are using UUID it shouldn't matter - let's see your fstab.
 
Old 07-20-2011, 09:29 PM   #3
bluekill14
LQ Newbie
 
Registered: Jul 2006
Posts: 20

Original Poster
Rep: Reputation: 2
Hi syg00, actually the machine is from a company of which my brother supports and he asked me for help. I'll not be able to get it soon. I wanted to use device name in the fstab but it already uses UUID so the latter is what I used. Is the UUID based from the disk or from sata ports of motherboard? From my testing, after I removed disk5 from the sata port5 the 2 disk device names we're still altered. Sata port 5 is not used previously by any of the disks
 
Old 07-20-2011, 09:49 PM   #4
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Quote:
Originally Posted by bluekill14 View Post
Is the UUID based from the disk or from sata ports of motherboard?
The UUIDs are generated at the time the disk partition if formatted. They are independent of which SATA port is used.
 
1 members found this post helpful.
Old 07-20-2011, 11:04 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
UUIDs are generated when a (Linux native) filesystem is formatted.
LVM, of course, does things differently - I believe pvcreate assigns a UUID as well.

Unless there are duplicate UUIDs present (yes, it can happen, "unique" doesn't always mean "unique" apparently) UUIDs shouldn't just move around. Even if the device name changes, as happens, that shouldn't matter. We need more (solid) info to help.

As for grub (classic) using UUID, it has to be patched - used to be Fedora had patched theirs (only) for LABEL. May be different these days, haven't looked. Perhaps you should look to use LABEL instead.
 
1 members found this post helpful.
Old 07-21-2011, 07:07 PM   #6
bluekill14
LQ Newbie
 
Registered: Jul 2006
Posts: 20

Original Poster
Rep: Reputation: 2
I tried to recreate the scenario in a fedora 14 vm

df -h result after adding 4 disk:

/dev/sdb1 96M 5.6M 86M 7% /mnt/disk1-sdb1
/dev/sdc1 96M 5.6M 86M 7% /mnt/disk2-sdc1
/dev/sdd1 96M 5.6M 86M 7% /mnt/disk3-sdd1
/dev/sde1 96M 5.6M 86M 7% /mnt/disk4-sde1

then I remove disk1 virtual disk and df -h result below:

/dev/sdb1 96M 5.6M 86M 7% /mnt/disk2-sdc1
/dev/sdc1 96M 5.6M 86M 7% /mnt/disk3-sdd1
/dev/sdd1 96M 5.6M 86M 7% /mnt/disk4-sde1

Notice that the system adjusted the device name. Instead of retaining sdc1 name of disk2 it change to sdb1 which is originally from disk1.

Then I used e2label as a suggestion of syg00 and mount -l result

/dev/sdb1 on /mnt/disk1-sdb1 type ext4 (rw) [/sdb1]
/dev/sdc1 on /mnt/disk2-sdc1 type ext4 (rw) [/sdc1]
/dev/sdd1 on /mnt/disk3-sdd1 type ext4 (rw) [/sdd1]
/dev/sde1 on /mnt/disk4-sde1 type ext4 (rw) [/sde1]

and still the same problem after removing disk1

/dev/sdb1 on /mnt/disk2-sdc1 type ext4 (rw) [/sdc1]
/dev/sdc1 on /mnt/disk3-sdd1 type ext4 (rw) [/sdd1]
/dev/sdd1 on /mnt/disk4-sde1 type ext4 (rw) [/sde1]

Is there anyway that the system retains the original assigned name to a disk? Thank you.

Last edited by bluekill14; 07-21-2011 at 07:14 PM. Reason: change font color of gnu/linux commands
 
Old 07-21-2011, 08:45 PM   #7
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Quote:
Originally Posted by bluekill14 View Post

/dev/sdb1 on /mnt/disk1-sdb1 type ext4 (rw) [/sdb1]
/dev/sdc1 on /mnt/disk2-sdc1 type ext4 (rw) [/sdc1]
/dev/sdd1 on /mnt/disk3-sdd1 type ext4 (rw) [/sdd1]
/dev/sde1 on /mnt/disk4-sde1 type ext4 (rw) [/sde1]

and still the same problem after removing disk1

/dev/sdb1 on /mnt/disk2-sdc1 type ext4 (rw) [/sdc1]
/dev/sdc1 on /mnt/disk3-sdd1 type ext4 (rw) [/sdd1]
/dev/sdd1 on /mnt/disk4-sde1 type ext4 (rw) [/sde1]

Is there anyway that the system retains the original assigned name to a disk? Thank you.
It would probably have been better if you would have not used device names for the label.

Maybe {DISK1,DISK2,DISK3,DISK4}.

Nevertheless, you need to use root=LABEL= to refer to the devices in grub.

Could you post your /etc/fstab and /boot/grub/menu.lst?
 
1 members found this post helpful.
Old 07-26-2011, 09:28 AM   #8
bluekill14
LQ Newbie
 
Registered: Jul 2006
Posts: 20

Original Poster
Rep: Reputation: 2
-= fstab =-
##############################################################################################
# /etc/fstab
# Created by anaconda on Sun Jul 10 13:55:46 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_fedora14-lv_root / ext4 defaults 1 1
UUID=c16b4423-5b03-447e-a124-aede956c26ec /boot ext4 defaults 1 2
/dev/mapper/vg_fedora14-lv_swap swap swap defaults 0 0
#UUID=5c6aa16b-c5aa-4066-9afd-94c1379f4ae0 /mnt/disk1-sdb1 ext4 defaults 1 2
#UUID=dab666db-a97b-4072-beeb-322639d8aec2 /mnt/disk2-sdc1 ext4 defaults 1 2
#UUID=eaeb8299-310e-4d1b-ae82-ab382976f752 /mnt/disk3-sdd1 ext4 defaults 1 2
#UUID=66741882-84b3-49fd-8665-cd259872c1c4 /mnt/disk4-sde1 ext4 defaults 1 2
LABEL=/sdb1 /mnt/disk1-sdb1 ext4 defaults 1 2
LABEL=/sdc1 /mnt/disk2-sdc1 ext4 defaults 1 2
LABEL=/sdd1 /mnt/disk3-sdd1 ext4 defaults 1 2
LABEL=/sde1 /mnt/disk4-sde1 ext4 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
###############################################################################################

-= cat /boot/grub/menu.lst =-
###############################################################################################
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/vg_fedora14-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=0
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.35.6-45.fc14.i686)
root (hd0,0)
kernel /vmlinuz-2.6.35.6-45.fc14.i686 ro root=/dev/mapper/vg_fedora14-lv_root rd_LVM_LV=vg_fedora14/lv_root rd_LVM_LV=vg_fedora14/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us nomodeset rhgb quiet
initrd /initramfs-2.6.35.6-45.fc14.i686.img
###################################################################################

andrewthomas thanks for your suggestion, i'll never use device names as Label. But I don't really get what you said about using root=LABEL in referring devices in grub. Do you mean I add this line to menu.lst "/mount_point=UUID"?

In checking other forums with similar subject they just use UUID, and maybe I'll also stop worrying about this and just live with using UUID and Label in managing multiple disks.
 
  


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
Incresing disk device to / root disk Redhat Enterprise server 4 lamoul Red Hat 1 03-25-2010 04:40 PM
Adding second hard disk with windows to boot with grub on first hard disk rushadrenaline Linux - Hardware 3 07-08-2009 04:39 AM
format of logical disk device names ahmedb72 Solaris / OpenSolaris 2 07-07-2007 11:49 PM
RAID 1: adding a new SCSI disk to existing disk.... help mgy Linux - Enterprise 4 04-17-2006 03:56 AM
Disk names mghiya Linux - Hardware 1 04-11-2006 07:40 AM

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

All times are GMT -5. The time now is 07:51 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