|Simple question about LVM|
Removing a disk with surface errors
I have two hdd's in a server, one - hdb1 - has started to develop surface errors, so I need to replace it.
I have added a third drive and used pvmove to get the data off of the faulty drive.
The new drive is currently hdc1, I plan to physically remove hdb1 and put hdc1 in its place as the primary ide slave, so it will become hdb1.
Now I'm stuck!
Do I use vgreduce /dev/hdb1 before removing it. Or do I need to vgreduce /dev/hdc1 take that out then reinstall it in some way, but won't that erase the data?
I'm confused where do I go from here?
Any suggestions, thanks
|I'm confused where do I go from here? |
Playing with logical volumes is dangerous, mainly because people don't do it much and when they do it every single mistake can cause a total data loss. If you are confused, don't touch dangerous utilities like vgreduce.
My personal experience with logical volumes under both *nix and Windows Server versions is that they are a PITA once an underlying disks needs to be replaced. In my opinion a logical volume spanning multiple disks should be considered a RAID0 device without any protection and a high failure rate and should therefore only contain disposable data.
First rule: Don't do any actions that need write access to disk hdb1. This disk develops errors and every new write may make the disk unusable, for example when a write causes an unrecoverable error in an important directory or inode table.
If your logical volume only spans one disk, it is easy. Add the third disk hdc1, format it and create the same partition layout as on hdb1. Backup the contents from hdb1 and restore it to hdc1. Remove hdb1, replace it with hdc1 in such a way that the OS will recognize it as the second disk and start up. Test everything. If everything is working as expected, you have successfully transfered the disk contents. If you still find problems, you have the peace of mind that your whole copy action didn't change the data on the original disk. You can put the old disk back in and try to restart the copy procedure.
|Playing with logical volumes is dangerous |
Luckily this is my 'play' server so worst case I'm doing a reinstall and no real harm done.
I decided to run vgreduce and pvremove which has removed the LV from hdb1 so it now resides only on hda1 and hdc1. Fingers crossed, everything still seems to be working!
I want to reconnect my DVD drive to IDE2 master, so I need to move hdc1 to IDE1 slave, i.e. hdb1 This is the bit which has me stumped, can I just reconnect it, or do I need to change anything first?
It appears I didn't need to change anything!
I removed the faulty drive, set the jumpers and plugged the new one in, rebooted and everything appears to be working - no warning messages so far!