Issue with creating a Software RAID on CentOs
Hello all. I have been experiencing an issue with creating a sofware RAID on a CentOS VM in Virtual Box. I went through the following steps when attempting to create a Software RAID:
1. I created 2 primary partions /dev/hda3 and dev/hda4 using the fdisk command.
2. I set the partition id to fd (Linux raid) autodetect.
3. I wrote each partition to the disk followed by the partprobe command.
4. I created an ext3 file system for each partition by using the following command for /dev/hda3(ex: mkfs -t ext3 /dev/hda3) and /dev/hda4 (ex: mkfs -t ext3 /dev/hda4)
5. I created entries in /etc/fstab for /dev/hda3 and /dev/hda4
6. I ran the command mount -a
7. I created a raid device with the following command:
mdadm -C /dev/md0 -a yes -l 1 -n 2 /dev/hda3 /dev/hda4
8. I formatted the RAID device with the following command:
mkfs -t ext3 /dev/md0
9. I added an entry to /etc/fstab. The /etc/fstab file contents is shown below:
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/hda3 /testmount ext3 defaults 1 2
/dev/hda4 /tesmount2 ext3 defaults 1 2
/dev/md0 /testraid ext3 defaults 1 2
However, when I reboot, I get the following errors during bootup:
WARNING: badformat in line 11 of /etc/fstab
WARNING: badformat in line 12 of /etc/fstab
WARNING: badformat in line 13 of /etc/fstab
fsck.ext3: Device or resource busy while trying to open /dev/hda3
fsck.ext3: Device or resource busy while trying to open /dev/hda4
Does anyone know what would cause this error? Also, when I try to fix /etc/fstab via single user mode, it says that the file is read only. Is there any way to fix the file with out using a rescue disk? Thanks for any help you can provide.
It's a while since I have done it, but steps 4, 5 and 6 look out of place. You shouldn't format the devices which make up the array and you certainly shouldn't mount them (or add them to the fstab).
With regard to single user mode; your root partition is probably mounted readonly, so you would need to remount it as read/write before you could edit the fstab.
Concur with above poster.
|All times are GMT -5. The time now is 10:53 AM.|