Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hey, I own a server with 2 hdds and I used a debian raid installation template. Know I want to reinstall my server and don't want raid anymore to have more space. My provider wants money to change the template to a non-raid debian one.

Is there a way to disable software raid on linux after a fresh installation?

Thanks

share|improve this question
up vote 2 down vote accepted

This answer assumes a mdadm based Raid 1. It is a very general answer, as you haven't really provided much details on the actual setup.

To un-raid a software Raid 1 you do the following:

  1. Remove one of the disk/partitions from the raid device, putting it in a degraded mode.
  2. Create a fresh partition, filesystem etc on the freed drive. Rsync all files from the degraded raid device to the new partition.
  3. If /boot/ is handled by a raid device, repeat 1 and 2 on it as well.
  4. Fiddle with /boot/grub/menu.1st and /etc/fstab to make sure the system is booted without the degraded raid device(s).
  5. Reboot
  6. Clear away the degraded raid from the remaining disk.

(Preferable by first practicing on a local, possibly virtual, test system.)

share|improve this answer
    
Thank you, I'll try it tomorrow after I've reinstalled my server. And yes I'm using mdadm. – DebFo Mar 7 '10 at 22:44

Andol's answer is correct for a RAID-only setup.

If the system uses lvm+raid, however, you can do a 'live' move of your filesystems (assuming RAID-1 or RAID-10):

  • remove half your disks from the raid array (one mirror)
  • on each disk, create one partition, set type to Linux LVM
  • run pvcreate on those partitions
  • run vgextend on your existing lvm volume group with the partitions as argument (e.g., vgextend /dev/vg0 /dev/sda1)
  • for each of your lvm logical volumes, run pvmove -v /dev/md0 (assuming that's the name of your RAID device), and wait until they've finished
  • reinstall your bootloader as soon as the vg containing /boot has been fully moved
  • once all LVs have been moved, run vgreduce -a. This should remove the raid array from your lvm vg. If it doesn't, that means there's still data on the RAID.
  • you can now destroy the RAID array, add the other disks to the volume group, and possibly resize your LVs.
share|improve this answer

Your Answer

 
discard

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