LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Raid 1 problem (https://www.linuxquestions.org/questions/linux-software-2/raid-1-problem-264080/)

gmanigault 12-08-2004 12:05 PM

Raid 1 problem
 
I am a newbie with software Raid 1 on linux. I have it up and running. Below you will see a listing of what I think is all the critical information you will need to help me. What I am trying to do is correct a problem. I want to take /dev/md2 and change its raid type. I want to change it from 0 to 1 so that it will be mirrored. When I try to umount /dev/md2. I get the following.

umount: /var: device is busy.

How can I umount it and then rebuild it with raid 1 and using hda3 and hdd3. By the way if I have to erase everything on /var that is okay. It is a fresh install. Let me know. Thanks.

RESULTS
======

df -h

Filesystem Size Used Avail Use% Mounted on
/dev/md1 73G 1.1G 68G 2% /
/dev/md0 15G 38M 14G 1% /boot
none 251M 0 251M 0% /dev/shm
/dev/md2 97G 58M 92G 1% /var


fdisk -l


Disk /dev/hdd: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdd1 * 1 1912 15358108+ fd Linux raid autodetect
/dev/hdd2 1913 11473 76798732+ fd Linux raid autodetect
/dev/hdd3 11474 17847 51199155 fd Linux raid autodetect

Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1912 15358108+ fd Linux raid autodetect
/dev/hda2 1913 11473 76798732+ fd Linux raid autodetect
/dev/hda3 11474 17847 51199155 fd Linux raid autodetect
/dev/hda4 17848 24321 52002405 f Win95 Ext'd (LBA)
/dev/hda5 17848 19122 10241406 82 Linux swap


/etc/fstab

/dev/md1 / ext3 defaults 1 1
/dev/md0 /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/md2 /var ext3 defaults 1 2
/dev/hda5 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0

/proc/mdstat

Personalities : [raid0] [raid1]
read_ahead 1024 sectors
md2 : active raid0 hda3[0] hdd3[1]
102398080 blocks 64k chunks

md1 : active raid1 hda2[0] hdd2[1]
76798656 blocks [2/2] [UU]

md0 : active raid1 hda1[0] hdd1[1]
15358016 blocks [2/2] [UU]

unused devices: <none>


/etc/raidtab

raiddev /dev/md1
raid-level 1
nr-raid-disks 2
chunk-size 64k
persistent-superblock 1
nr-spare-disks 0
device /dev/hda2
raid-disk 0
device /dev/hdd2
raid-disk 1
raiddev /dev/md0
raid-level 1
nr-raid-disks 2
chunk-size 64k
persistent-superblock 1
nr-spare-disks 0
device /dev/hda1
raid-disk 0
device /dev/hdd1
raid-disk 1
raiddev /dev/md2
raid-level 1
nr-raid-disks 2
chunk-size 64k
persistent-superblock 1
nr-spare-disks 0
device /dev/hda3
raid-disk 0
device /dev/hdd3
raid-disk 1

========

twantrd 12-08-2004 01:24 PM

You can't just unmount the drive. You need to set the drive to faulty and then do a remove on it. Look at 'raidhotremove' and other utilities in the raidtools package.

-twantrd

gmanigault 12-08-2004 03:27 PM

I think I got it.
 
The one thing that people seemed to have neglected to let me in on was that when you do a umount and it shows device busy it is most likely due to the fact that you are in multiuser mode. I think that command I issued was:

telinit 1

That put me in single user mode. It allow me to umount the /var and then take the previous raid array offline (raid0). I am building my raid1 now. Will let you all know how it turns out.


All times are GMT -5. The time now is 12:58 AM.