LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-02-2009, 07:29 PM   #1
germano-silva
LQ Newbie
 
Registered: Sep 2004
Posts: 6

Rep: Reputation: 0
What happens when I remove a disk device /dev/sde


Hi,

I have a production RHEL 4 server with seven disk devices as follow

/dev/sdb1
/dev/sdc1
/dev/sdd1
/dev/sde1
/dev/sdf1
/dev/sdh1
/dev/sdg1

I no longer need /dev/sde1 and /dev/sdf1 so I want to physically remove them but I haven't done it yet because I don;t know if /dev/sh1 and /dev/sdg will become /dev/sde and /dev/sdf after a server reboot and if that's the case I need to change the fstab entries for these devices. Because thsi is a production server, I don't wan tto do this unless I kno wfor sure what's going to happen.

Does anyone know what will happen?

Thanks
Germano
 
Old 08-02-2009, 07:33 PM   #2
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 67
Yes, the letters will probably change. To futureproof your fstab, you should change how it finds devices. First do this:
Code:
ls -l /dev/disk/by-uuid
For example, my output is:
Code:
~$ ll /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 2009-07-31 22:55 635a527d-f94e-47bb-930a-24bb2d5e0701 -> ../../sda5
lrwxrwxrwx 1 root root 10 2009-07-31 22:55 72450d05-6e95-44b2-9250-2958688ce9a8 -> ../../sda1
lrwxrwxrwx 1 root root 25 2009-07-31 22:56 91662005-2e0e-4007-8364-c891991e6e20 -> ../../mapper/jasmine-root
lrwxrwxrwx 1 root root 27 2009-07-31 22:56 92e263d4-e53d-4ece-8509-9207d7f9076d -> ../../mapper/jasmine-swap_1
In /etc/fstab, where it mentions /dev/sda1, I would replace it with UUID=72450d05-6e95-44b2-9250-2958688ce9a8

Do this for all of your drives so that you don't need to worry about what order your system (or any system for that matter) recognizes them in.
 
Old 08-02-2009, 07:49 PM   #3
Ruler2112
Member
 
Registered: Oct 2004
Location: Michigan, US
Distribution: Redhat 7.3, 9.0; Slackware 10, 10.1, 10.2, 11; FreeBSD 7.0; KnoppMyth 5.5
Posts: 125

Rep: Reputation: 16
A quick workaround without changing your fstab would be to create a symbolic link to the new device in a startup script. ln -s /dev/sde1 /dev/sdg1 would create a device sdg1 that would do nothing but point to sde1, so you'd have both present. I don't know how it would work if you added more drives afterwards though.

Changing the fstab is definitely a better solution (and one I was previously unaware of), but wanted to post this in case that doesn't work out for some reason.
 
Old 08-02-2009, 07:54 PM   #4
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 67
Quote:
Originally Posted by Ruler2112 View Post
Changing the fstab is definitely a better solution
I whole-heartedly agree. The symbolic link thing seems incredibly messy to me. The UUID is a unique fingerprint for a partition/device and is the best way to assure you are using the right thing. There is no standard (AFAIK) about the order in which your devices are recognized. For example, you could be running Debian and have drive A as /dev/sda drive B as /dev/sdb and drive C as /dev/sdc, but then boot the same computer with the same hardware from Knoppix and have drive A = /dev/sda, B = /dev/sdc, and C = /dev/sdb, or even more dramatic, switch to the /dev/hd* scheme

Last edited by Meson; 08-02-2009 at 07:55 PM.
 
Old 08-02-2009, 08:07 PM   #5
mrrangerman
Member
 
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 50
Quote:
germano-silva Hi,

I have a production RHEL 4 server with seven disk devices as follow

/dev/sdb1
/dev/sdc1
/dev/sdd1
/dev/sde1
/dev/sdf1
/dev/sdh1
/dev/sdg1
Does this server use scsi drives in a non-raid array?
 
Old 08-02-2009, 08:30 PM   #6
Ruler2112
Member
 
Registered: Oct 2004
Location: Michigan, US
Distribution: Redhat 7.3, 9.0; Slackware 10, 10.1, 10.2, 11; FreeBSD 7.0; KnoppMyth 5.5
Posts: 125

Rep: Reputation: 16
Quote:
Originally Posted by Meson View Post
The UUID is a unique fingerprint for a partition/device
Not entirely true, as the UUID is cloned if you use dd to duplicate a drive. (Yeah, I know I'm being picky. ) I have run into it before though; used dd to clone a thumb drive and then couldn't figure out what was going on later. In my experience, all the distros I've used have recognized drives in the same order, though you're right in that there's no guarantee of this.
 
Old 08-02-2009, 08:40 PM   #7
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 67
Quote:
Originally Posted by Ruler2112 View Post
Not entirely true, as the UUID is cloned if you use dd to duplicate a drive.
Good point, I wonder if there is a way to regenerate a UUID


Quote:
Originally Posted by Ruler2112 View Post
In my experience, all the distros I've used have recognized drives in the same order.
The example I used is based on a true story, the names and faces have been changed to protect the innocent.
 
Old 08-03-2009, 09:11 AM   #8
germano-silva
LQ Newbie
 
Registered: Sep 2004
Posts: 6

Original Poster
Rep: Reputation: 0
ls -l /dev/disk/by-uuid does not work on my server

the only command I can get to work is by-path and that does not seem to return the UUID. Any othe suggestions?

# ls -l /dev/disk/by-path
total 0
lrwxrwxrwx 1 root root 9 Aug 3 09:00 pci-0000:00:07.1-ide-0:0 -> ../../hda
lrwxrwxrwx 1 root root 9 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:0:0-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:0:0-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:0:0-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:0:0-part6 -> ../../sda6
lrwxrwxrwx 1 root root 10 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:0:0-part7 -> ../../sda7
lrwxrwxrwx 1 root root 10 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:0:0-part8 -> ../../sda8
lrwxrwxrwx 1 root root 10 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:0:0-part9 -> ../../sda9
lrwxrwxrwx 1 root root 9 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:1:0 -> ../../sdb
lrwxrwxrwx 1 root root 10 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:1:0-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 9 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:2:0 -> ../../sdc
lrwxrwxrwx 1 root root 10 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:2:0-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 9 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:3:0 -> ../../sdd
lrwxrwxrwx 1 root root 10 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:3:0-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 9 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:4:0 -> ../../sde
lrwxrwxrwx 1 root root 10 Aug 3 09:00 pci-0000:00:10.0-scsi-0:0:4:0-part1 -> ../../sde1
 
  


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
How To Clone Single Drive To Raid 1+0 (copy /dev/sde to /dev/md0)? alfista Linux - Server 5 03-18-2008 11:57 PM
How To Clone Single Drive To Raid 1+0 (copy /dev/sde to /dev/md0)? alfista Linux - Server 2 03-17-2008 11:26 PM
How To Clone Single Drive To Raid 1+0 (copy /dev/sde to /dev/md0)? alfista Linux - Server 2 03-13-2008 05:17 AM
sde-g++, sde-cpp, sde-c++ Compile issues HELP!!! derrick_chi Linux - General 1 08-31-2007 09:16 PM
iPod mounting: dmesg says sde, but no /dev/sde haertig Linux - Software 6 12-16-2006 08:56 PM


All times are GMT -5. The time now is 12:59 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration