Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm testing some NAS setups using virtualbox, with several virtual hard drives, and software raid.

I would like to test the behavior under certain fails, and I would like to simulate that one of the hard disks broke and there's need to rebuild the RAID...

Would it be enough to do a

cat /proc/urandom > /virtualdisk

Or as the virtual disks are containers, VBox couldn't use it and would break the VirtualBox machine?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

I don't know that you can fail a hard drive this way in VBox (or any VM -- They're typically designed to pretend hardware is perfect). You can try it and see but the results could be pretty awful...

A better strategy might be to shut down the VM & remove the disk, power on & do stuff, then shutdown & re-add the disk. Another option is to use the software RAID administration tools to mark a drive as failed (almost all of them support this AFAIK), scribble on it from within the VM, then re-add it & watch the rebuild.

All told however the only real test of a drive failure is to put the OS on real hardware and yank out one of the disks -- This is the only way to know for sure how your OS will react on a given piece of hardware with associated controller quirks.

share|improve this answer

I'd just open up the host OS, and move one of the virtual disk set files someplace else, and watch what happens. That would emulate one of the member disks suddenly not being available.

But as said earlier, that shows how the NAS behaves in that virtualized environment. It may or may not give the identical behavior in a physical configuration.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.