Disk dying and LVM2
Guys,
I have a volume made up by two SATA disks, one 80g other 250g. The 80g is dying and I'm about to replace it.
The volume is mounted as the root fs.
This is my plan, can you tell me if I'm on the right track?
1) empty at least 80g in the volume
2) reboot, mount readonly and resize the reiserfs to 80gb less than current (this is, to 250g)
3) pvmove /dev/old_disk
4) reboot
5) take the old disk out
While the system boots and works more-or-less, when trying to open some files I get input/output errors: what will happen when pvmove tries to move the sector containing this file? After the pvmove the system shouldn't be in a worse condition that it's now, right?
thanks!
Signature · 1 line
Martin Sarsale - [email protected]
I haven't ever tried moving a root partition, but it should be possible.
pvmove will ignore the errors it encounters and "do the best it can" to transfer all data. If it can't read a certain sector, that will be missing from the move.
brassow
Quoted 31 lines · Martin Sarsale
Guys,
I have a volume made up by two SATA disks, one 80g other 250g. The 80g is dying and I'm about to replace it.
The volume is mounted as the root fs.This is my plan, can you tell me if I'm on the right track?
1) empty at least 80g in the volume
2) reboot, mount readonly and resize the reiserfs to 80gb less than current (this is, to 250g)
3) pvmove/dev/old_disk
4) reboot
5) take the old disk outWhile the system boots and works more-or-less, when trying to open some files I get input/output errors: what will happen when pvmove tries to move the sector containing this file? After the pvmove the system shouldn't be in a worse condition that it's now, right?
thanks!
Signature · 7 lines
Martin Sarsale - [email protected] _______________________________________________ linux-lvm mailing list [email protected] https://www.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Quoted 3 lines · Jonathan Brassow
pvmove will ignore the errors it encounters and "do the best it can" to transfer all data. If it can't read a certain sector, that will be missing from the move.
Having done logic like that for my own filesystem, it is not trivial to do efficiently. You have to read a large buffer, but when there is an IO error, the OS doesn't always report the bad sector correctly, so you have to then narrow down the bad parts in that buffer. Reading the buffer 1 sector at a time works, using binary search (read each half, read each half of failing half, etc) is faster but more complex. Without some such logic, more data is lost in the buffer containing bad blocks that is necessary.
pvmove source is available, and I'll take a look when I get to it, but in the meantime maybe someone knows, does pvmove incorporate such logic?
Signature · 4 lines
Stuart D. Gathman <[email protected]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flammis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial.