Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a laptop with only one HDD and is impossible add other HDD. The feature "copies=2" of ZFS is the perfect solution for to add redundancy to my /home in the laptop.

I would like emulate the copies=2 option of ZFS with LVM (or other software if you prefer), for example 2 copies of each block of my /home partition.

In this HDD, I have other systems and I use habitually the laptop for testing a lot of new versions of OS, so I need continue using a standard MBR partition table and the changes must be in the partition level.

I will not use ZFS or btrfs for this. If you have other ideas, all are welcome :) .

http://blogs.oracle.com/relling/entry/zfs_copies_and_data_protection

Update: Like Gilles said, my idea only give me protection from invalid sectors and similar failures for a very limited time. Not for human errors, software bugs or mechanical/electronic failures of my HDD. This is the idea.

share|improve this question
    
Why are you ruling out ZFS ? –  jlliagre Sep 22 '11 at 1:25
    
Because ZFS is not a good option in Linux. Bad performance and is too much experimental (in Linux). –  Juan Francisco Cantero Hurtado Sep 22 '11 at 1:43
    
Did you actually try it ? ZFS fuse on Linux was first released in 2006 and is quite stable now. Performance is probably not stellar but I don't care that much. The main bottleneck shouldn't be that much disk I/Os as far as a home directory usage is concerned. YMMV. –  jlliagre Sep 22 '11 at 2:14
    
I've tried ZFS in PCBSD and OpenSolaris/OpenIndiana. In PCBSD was very slow. And I need a fast FS in my /home, the I/O is important :) –  Juan Francisco Cantero Hurtado Sep 22 '11 at 2:29

1 Answer 1

up vote 3 down vote accepted

You can make an LVM mirror volume. As the name suggests, a mirror volume has exactly the same contents in two (or more) places. Use lvcreate -m 1 to create a two-sided logical volume. Each side of the mirror must be on different physical volumes within the same volume group.

You can do the the mirroring with the device mapper layer. Create two storage volumes (disk partitions, in your case), and create a RAID-1 volume from them (mdadm -C -l 1).

Neither solution is very useful, as the most common failure mode for a hard disk is for it to become completely unusable. Even if it doesn't fail outright, once a few sectors become unreadable, others usually quickly follow. And mirroring is useless about software problems such as accidentally erasing a file. Mirroring between two disks is useful to keep going when one of the disk fails, but doesn't replace backups. In your case, back up to an external USB drive or key.

share|improve this answer
    
Thanks for the answer. I didn't remember the device mapper!. I only need protection from bad sectors and similar little errors. I know the behavior of bad sectors in disks, I worked as hardware support. And yes, the backup is the only real and complete solution. –  Juan Francisco Cantero Hurtado Sep 22 '11 at 0:25
    
I've been using btrfs for years but in the last months I've had various important problems. Now I've changed to ext4 and xfs. For this reason I need a additional protection for the data integrity (btrfs has integrate features for data integrity, xfs and ext4 no). –  Juan Francisco Cantero Hurtado Sep 22 '11 at 0:31
    
@JuanFranciscoCanteroHurtado For data integrity, on Linux, the only way I know is zfs or btrfs. –  Gilles Sep 22 '11 at 0:39
    
Yes, I know. With the RAID + a FS stable is sufficient for me. Thanks :) . Btrfs will be the most powerful FS in Linux in the future but in the last months I've lost various files in btrfs partitions (I had backups). If the btrfs kernel code is corrupting my files, the aditional features of btrfs aren't the best argument for this FS. ZFS performance off of solaris is very bad. –  Juan Francisco Cantero Hurtado Sep 22 '11 at 1:54

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.