Does anyone have suggestions for easily simulating a missing volume in LVM on bare metal? I'm trying to test behaviour like a network attached physical volume going missing (actually, a network mounted virtual disc image). The normal loopback approach to testing falls a bit short, while overwriting the file can corrupt the PV, removing it seems very hard, as even force removing the loop device seems to leave it connected to the file handle, meaning a reboot is required to really clear things, and so at the minute I can only test what happens if a drive is missing after boot, rather than disappears during operation. (A bit easier to do with discs on a VM, but doing testing on a laptop.)
Once upon a time, Ian Malone ibmalone@gmail.com said:
Does anyone have suggestions for easily simulating a missing volume in LVM on bare metal?
Actually make a volume go missing? The easiest way to do that would be USB volumes (thumb drives), and just yank the drive out. Even if you don't want to physically pull the drive, I think you can tell a USB device to power down via a sysfs attribute, so that might be sufficient.
echo 1 > /sys/block/sdX/device/delete
And the device should disappear.
On Thu, Jan 3, 2019 at 11:01 AM Chris Adams linux@cmadams.net wrote:
Once upon a time, Ian Malone ibmalone@gmail.com said:
Does anyone have suggestions for easily simulating a missing volume in LVM on bare metal?
Actually make a volume go missing? The easiest way to do that would be USB volumes (thumb drives), and just yank the drive out. Even if you don't want to physically pull the drive, I think you can tell a USB device to power down via a sysfs attribute, so that might be sufficient.
-- Chris Adams linux@cmadams.net _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
On Thu, 3 Jan 2019 at 18:13, Roger Heflin rogerheflin@gmail.com wrote:
On Thu, Jan 3, 2019 at 11:01 AM Chris Adams linux@cmadams.net wrote:
Once upon a time, Ian Malone ibmalone@gmail.com said:
Does anyone have suggestions for easily simulating a missing volume in LVM on bare metal?
Actually make a volume go missing? The easiest way to do that would be USB volumes (thumb drives), and just yank the drive out. Even if you don't want to physically pull the drive, I think you can tell a USB device to power down via a sysfs attribute, so that might be sufficient.
echo 1 > /sys/block/sdX/device/delete
And the device should disappear.> > --
Thanks both, I'd thought about a USB drive, but didn't have one to hand at the time that I didn't mind messing up. The sysfs route sounds a bit safer though, and I can probably find one I don't need any more.
Once upon a time, Ian Malone ibmalone@gmail.com said:
Thanks both, I'd thought about a USB drive, but didn't have one to hand at the time that I didn't mind messing up. The sysfs route sounds a bit safer though, and I can probably find one I don't need any more.
Another thought: use something like NBD or iSCSI running locally, rather than direct loopback volumes. I'm pretty sure you could kill an NBD or iSCSI export.