Wayne Dawson on Mon, 17 Mar 2003 12:54:42 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] how to put partitions on RAID?



On Wed, Mar 12, 2003 at 12:19:21PM -0800, Wayne Dawson wrote:
> Ok, some time ago I asked how I should arrange my partitions on RAID.
>
> Well now I'm asking how to actually move a partition onto RAID.
>
> I can unmount /var so I figured I'd try to put it onto my /dev/md0 device
> which I created via "mdadm -C" from /dev/sda1 and /dev/sdb1.
>
> I've tried some things, but maybe I should just back up and ask:  how do I
> do it?

At 11:07 AM 3/13/03 -0500, you wrote:
Well I just moved root to raid1 on my 1u server last night. Created the
/dev/md0 , formated it reiserfs then just did a cp -ax / /mnt/newroot
Course I always keep around some spare space to allow me to move stuff
around.

Well, once I got to a point where I could see /dev/md0, I figured it acted like a physical hard disk which I could create partitions on via fdisk. It didn't work. After (apparently) successfully creating a partition with fdisk (/dev/md0p1), if I try to mount it, the mount command generates this error:
mount: special device /dev/md0p1 does not exist


Certainly I can just copy everything from a single partition (/ for example) over to the mounted raid, but what I need to do is put multiple partitions onto it.

What I have now is:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda5               505605    179305    300196  38% /
/dev/hda1               101089     17580     78290  19% /boot
/dev/hda3              7337124     32876   6931540   1% /home
none                    127176         0    127176   0% /dev/shm
/dev/hda2             20050176   3972764  15058892  21% /usr
/dev/hda6              1027768    168644    806916  18% /var
/dev/md0              17639128     32836  16710276   1% /mnt/softraid

What I want to do is take all these partitions (or as much as possible, excluding /dev/md0 itself of course) and place them on the /dev/md0 device so that I can boot and run the system from there.

I did notice one thing which, to me, seems rather bizarre. After assembling /dev/md0 from /dev/sda1 and /dev/sdb1 (using "mdadm -As /dev/md0"), I noticed that I can mount all three at the same time, and then access them separately. All 3 of them show a file blah/test, which I created when only /dev/md0 was mounted directly.
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda5 505605 213759 265742 45% /
/dev/hda1 101089 22484 73386 24% /boot
/dev/hda3 7337124 34592 6929824 1% /home
none 126940 0 126940 0% /dev/shm
/dev/hda2 20050176 4066548 14965108 22% /usr
/dev/hda6 1027768 183056 792504 19% /var
/dev/md0 17639128 32836 16710276 1% /mnt/softraid
/dev/sda1 17639128 32836 16710276 1% /mnt/sda1
/dev/sdb1 17639128 32836 16710276 1% /mnt/sdb1


So I tried creating a file /mnt/softraid/blah/test2 to see if it showed up on /mnt/sda1/blah/test2 and /mnt/sdb1/blah/test2. It did not - that is, until I unmount/remounted /dev/sda1. It's now visible at /mnt/sda1/blah/test2, but /dev/sdb1 doesn't show it even after unmounting/remounting.

I don't understand this behavior, but the critical thing here is to get this system running with as much as possible on the raid.

Can anybody tell me what I need to do?

Thanks,
Wayne

_________________________________________________________________________
Philadelphia Linux Users Group        --       http://www.phillylinux.org
Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug