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

Is it possible to install software RAID 1 on a single disk Debian server without erasing/format the data on the original disk?

What approach would you recommend?

share|improve this question
    
WHY would you do that? On a single disc there is no advantage at all to use RAID 1 - only disadvantages (writes REALLY get slower). –  TomTom Mar 2 '12 at 6:59
    
It can be done but why would you ever have a need for this?!... –  DaffyDuc Mar 2 '12 at 7:24
    
The reason is redundancy, I don't need the extra speed with RAID 0, just the security if one disk fails. –  Chrille Mar 2 '12 at 11:24
    
How will you have redundancy with only one disk ? –  Gregory MOUSSAT Mar 2 '12 at 18:10
    
I don't think he means to use a single disk all along. He has a single disk right now and wants to plug in another and convert to a RAID1. But even with a single disk you would get some amount of redundancy against bad blocks - ZFS for example has ditto blocks which is quite similar when set on a storage pool with a single physical disk. –  the-wabbit Mar 2 '12 at 20:58

1 Answer 1

up vote 0 down vote accepted

You can. I don't understand why you want only one disk, but you can. And this won't slow your disk accesses.

You need to shrink the filesystem to make sure there is 128K free at the end of the device, because Linux software RAID need it:

umount /
resize2fs /dev/xxx your_size
mdadm --create /dev/mdx --raid-devices=2 --level=raid1 /dev/xxx missing
mount /dev/md0 /xxxxx

I strongly suggest you to test it with a dummy computer or a virtual machine.

share|improve this answer
    
Ok, it sounds like it's nothing you recommend? Would it be better to set up a new server with configured RAID and migrate all data to it? –  Chrille Mar 2 '12 at 11:25
    
Seems you are not aclimated with software RAID and/or Linux, so I suggest you to test before playing with datas. The procedure itself is simple and relatively safe, but Murphy's watching you. –  Gregory MOUSSAT Mar 2 '12 at 18:13

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.