given two 2TB USB external disks that have to be combined to one 4TB volume and formatted with one big Filesystem (XFS), I have a small question to ask.

Does LVM provide better Data recovery, should one disk be unplugged/damaged by being able to recover the data of the still working disk or is everything lost?

I would appreciate a solution where only the data of one disk is lost and I can recover the content of the other with the usual filesystem/lvm/raid tools. Is that possible with LVM or RAID "linear"? This is for storing unimportant files that can be retrieved from backup, but I want to save time :)

Thank you in advance


If you must run multiple disks in a non-redundant configuration, and you want to be able to recover something when any of the disks fails, then, at the very least, you need to ensure that your data is not striped over all devices. When using a striped layout, parts of most files will end up on all disks, which means that when you lose any disk, you've irrevokably lost parts of nearly every file, not to mention parts of the filesystem structures themselves. This means, as you seem to already surmise, that you need to use linear allocation, which essentially appends the constituent devices' extents together, and gives you some chance of recovering files that exist entirely on the surviving device(s) after a device failure.

I could be wrong, but for LVM2, I believe linear allocation is the default when striping is not requested. Regardless, to be certain of a linear/appended layout, you can force it thus by first lvcreate-ing a logical volume (LV) on the physical extents (PE's) of one disk, and then lvextend-ing the LV onto the PE's of the other disk.

If you want to try software RAID (mdadm), then I believe linear mode is the one to use. Do not use raid0, as it creates a striped layout, which, as I have argued, leads to almost total filesystem loss in the event of a device failure.

Finally, I should add that I don't recommend actually doing this and expecting to recover anything after a drive failure. If you're using LVM or mdadm to create a large scratch space out of smaller drives, then you'd better have your valuable data protected by other means (either backed up, or otherwise easily recreated).

| improve this answer | |

You have an extremely high level of risk with combining two external 2TB USB drives into a 4TB configuration. First off, being external, the opportunity for physical disruption(unplugged, rough handling, etc) is considerable. Also many external drives employ power saving techniques that could end up trashing your Filesystem - especially in a LVM stripe / RAID 0 setup. In the case of disk failure, you will have to restore data from a backup.

A LVM stripe using both disk will give you zero recoverability.

Filesystem corruption - it depends on the extent on if the xxx.fsck tool can repair.

My suggestion - use RAID1.

| improve this answer | |
  • I dont redundancy, I need capacity. A mirror or RAID1 is out of the question. I have a local RAID5+Backups for the important stuff :) – leto Jan 13 '11 at 15:26
  • Okay. Then do the linear lvm setup and tell us what happens. At the very worst, you'll lose everything. At the best, you may have a had filesystem shutdown and a complicated date with xfs_repair or xfs_db to recover things. – ewwhite Jan 13 '11 at 21:38

You'll need to build a filesystem on each disk and mount them in different locations. Losing half a filesystem makes a consistent recovery of anything difficult.

| improve this answer | |
  • Thats the solution I'm currently trying to avoid but will have to look into :-/ – leto Jan 13 '11 at 15:26

You would need a RAID 1 or LVM mirroring arrangement to have any redundancy or ease recovery time in the event of a single drive failure/disconnection. How big are these "unimportant" files? Are they so big that (>2TB) that you can't use software mirroring or LVM striping?

| improve this answer | |
  • No, but it' uncomfortable to use the disks seperately. I'll have a big directory like a spool. It'll contain files from 300Mb to 50GB and will fill the 4TB effortlessly. Therefor I'd like to have a solution where I only lose files from one disk when it fails :) – leto Jan 13 '11 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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