I already searched for a solution for my problem on this Forum, but I can’t find any help.
My problem:
On my Server I have a partition named /dev/md1, that is my main partition for the OS, created from /dev/hda2 and /dev/hdc2 (Softwareraid).
What I want to do is to remove this Raid without deleting files and without having to reinstall the System.
My question:
What have I to do to
a) disable / remove the RAID?
b) let the System being bootable after doing that?
You will first have to save the data on another media (say a removable disk or inactive disk partition). You can use dump, tar, or cpio. I prefer dump since it saves ACLs and file XATTRs. I use a command like
dump -j0f /media/disk/root.dump /
to create a file /media/disk/root.dump. It is best to boot a live CD to do this.
Then, while the live CD is still booted split the disk. All you will have to do is a mkfs.ext3 on what ever partitions. For example,
mkfs.ext3 /dev/hda2
Then, mount the new partition and restore
mount -t ext3 -oacl,user_xattr /dev/hda2 /mnt
cd /mnt
restore -raof /media/disk/root.dump
The final step is to fix the file /mnt/etc/fstab to use the new partition and so something like
mount -t proc none /mnt/proc
mount -o bind /sys /mnt/sys
mount -o bind /dev /mnt/dev
chroot /mnt
mkinitrd
exit
Thanks for the first answer, but my problem is that I need to remove the RAID on a running Server (where I have no option to use a Live-CD).
The main Problem is that after some reboots (necessary on that system to get some functions running properly) the Software-RAID doesn’t work and the system comes only up with Sinlge User Mode (like an init 2. without Network, SSH and bash) and only allows sh as console.
I know that under Solaris it is possible to remove even a Software RAID when the system partition is involved.
Why not rebuild the array with mdadm? Note a degraded array can take a very long time (several hours) to rebuild and the command line mdadm does this in background mode and if you want a progress indication, have to manually ask it.
mdadm can certainly stop an array, but then you probably have to remove the raid entry in fstab to stop the system looking for it on boot. (No expert in this but have spend a lot of time struggling with raid1.)
This is the best guide I have seen to date, though is a bit late on mentioning mdadm. The Software-RAID HOWTO