views:

122

answers:

2

I would like to change the filesystem of my RAID-0 from ext3 to xfs. I use Centos.

Do I have to remove the RAID first using mdadm? Or can I just change it? How to do that? I don't need to preserve the data.

Thanks

A: 

If you would like to keep the RAID block device as RAID 0, you can just format the block device to the new filesystem(of course effectively losing any existing filesystem).

Find out the device name of the block, such as /dev/md0, and then do a mkfs.

First make sure you unmount the device if it is mounted:

umount /dev/md0

then format it

mkfs.xfs /dev/md0 (You can replace xfs with whatever format you want-- assuming you have the tools installed for this filesystem type)

There are other options you can set, check the man pages.

You may also want to double check your /etc/fstab , and update the filesystem type and/or mount point, if you're changing that as well.

You can then remount the device and you should have a nice and clean filesystem.

mount /your/mountpoint/from/fstab (Assuming you have an fstab entry-- if you don't you probably already know how to mount/unmount your RAID 0 drive)

Kekoa
A: 
mkfs.xfs ...

As BobbyShaftoe said, RAID works on the block device level (the actual sectors of the disk) rather than at the file system. The fact that you are using RAID does not matter, so you just need to know how to reformat with the new file system. Use mkfs.xfs. The options though depend highly on your configuration, so read the man page.

Zifre