You are not logged in.

#1 2007-09-04 02:27:17

somairotevoli
Member
Registered: 2006-05-23
Posts: 335

(solved)raid 0 questions

I have to 40 GB drives. First one w/ my /, /boot, and /home the other w/ mostly my music.

I would like to combine the 2 drives and was wondering how to go about this w/o a reinstall if possible.

Can I combine the 2 the way they are now? Can I combine them if I removed all the data off the second? Or do I need to do a clean install?

Last edited by somairotevoli (2007-09-21 06:26:41)

Offline

#2 2007-09-04 10:47:31

sinister99
Member
Registered: 2007-04-10
Posts: 136

Re: (solved)raid 0 questions

You would need a clean install, your drives would need to be repartitioned.  In my experience, it is hard to get raid working in linux unless you are lucky enough to have a hardware raid controller (most are software based).

Offline

#3 2007-09-04 12:45:22

Magician21
Member
Registered: 2007-03-23
Posts: 45

Re: (solved)raid 0 questions

Software raid in Linux isn't terribly hard.  You'd probably have a more difficult time figuring out what drivers to use for a hardware raid controller.

I've gotten 50-60MB throughput with a pair of 250MB SATA 150 drives using software raid.

For software raid, you want to have 2 identical (or as close as possible) partitions on the drives.  Having both partitions on the same drive really wouldn't give you the performance boost you're looking for smile

Once you have the partitions, you can follow any number of howtos either on the wiki or via a google search.  Once you have the /dev/md* device(s) created (as a result of following the howtos), you can just create a filesystem on that device like you normally would.  Mount it as any other block device, and the raid part is transparent.

Offline

#4 2007-09-04 18:23:32

somairotevoli
Member
Registered: 2006-05-23
Posts: 335

Re: (solved)raid 0 questions

Thanks.... I guess it's a day of backing up and reinstalling for me...

Offline

#5 2007-09-19 08:37:12

somairotevoli
Member
Registered: 2006-05-23
Posts: 335

Re: (solved)raid 0 questions

So I finally got a round to this, all worked out well in the end, just a few bumps.

I now would like to run some ext3 tweaks, but I need to be able to do it on my root.

So how do I boot from a livecd in order to do this?

How do I tell it I am using raid?

Offline

#6 2007-09-19 13:01:52

Magician21
Member
Registered: 2007-03-23
Posts: 45

Re: (solved)raid 0 questions

I'm not sure what "tweaks" you're referring to, so I'll assume you need the raid devices to be active.

Just using the install / rescue cd should get you booted and able to see the disk drive devices.
You'll need to manually assemble the existing raid devices with something like 'mdadm --assemble ...' - see the man page for details on mdadm.  I'm just guessing as to whether it exists on the rescue image or not...

Once the devices are created, just mount them as you would mount anything else.

Offline

#7 2007-09-19 19:42:34

somairotevoli
Member
Registered: 2006-05-23
Posts: 335

Re: (solved)raid 0 questions

Thanks.
I basically want to have full journal.
I tried doing it the fstab way and appending rootflags=data=journal but after checking w/

tune2fs -l /dev/md0

, it is showing (none) still for the default mount options.
I got it to "stick" for my /home (/dev/md3) by unmounting and running

tune2fs -O has_journal -o journal_data /dev/md3

and then

e2fsck -D -f /dev/md3

I basically wasn't quite sure if mdadm was the proper way to go about it.. I was sure that was the command to set up raid and all google searches led me to that but only on how to setup it up.

The only other thing I can find on the matter is http://linux-raid.osdl.org/index.php/Tw … id_devices and acorrding to that I should

mkraid --really-force /dev/md*

"Because there are filesystems on /dev/sda1, /dev/sda2 and /dev/sda3 it is necessary to force the start of the raid device."

Last edited by somairotevoli (2007-09-19 20:36:25)

Offline

#8 2007-09-19 20:09:57

somairotevoli
Member
Registered: 2006-05-23
Posts: 335

Re: (solved)raid 0 questions

After reading the mdadm man, mdadm -A (--assemble) is the way to go about it.

Last edited by somairotevoli (2007-09-19 20:10:20)

Offline

#9 2007-09-20 11:46:07

Magician21
Member
Registered: 2007-03-23
Posts: 45

Re: (solved)raid 0 questions

I did a bit of googling to see what was involved with full journaling.
http://forums.gentoo.org/viewtopic-t-30 … +tips.html
It looks like you can use data=journal in /etc/fstab, OR rootflags=data=journal as a kernel parameter.
"I tried doing it the fstab way and appending rootflags=data=journal"
Which parameter did you actually put in /etc/fstab?

How are you building your md devices at boot time?
Once you've assembled a raid array for your root filesystem, you should have added md=n,dev,dev,...  to the kernel parameters in order to build your root md device.  I do this for both of my md devices and see no harmful side effects.
(http://www.linuxmanpages.com/man4/md.4.php)
Once that's done, you should be able to specify the correct parameter in /etc/fstab and have the data=journal option work.

You also need to rebuild your initial ramdisk (mkinitcpio) with the raid specified as a hook.

Offline

#10 2007-09-20 20:15:34

somairotevoli
Member
Registered: 2006-05-23
Posts: 335

Re: (solved)raid 0 questions

here's my fstab

#
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
none                   /dev/pts      devpts    defaults            0      0
none                   /dev/shm      tmpfs     defaults            0      0

/dev/md0            /                ext3      defaults,data=journal             0      0
/dev/md2           swap              swap      defaults            0      0
/dev/md1           /boot             ext3      defaults            0      0
/dev/md3           /home             ext3      defaults,data=journal             0      0


/dev/cdrom             /mnt/cd   iso9660   ro,user,noauto,unhide   0      0
/dev/dvd               /mnt/dvd  udf       ro,user,noauto,unhide   0      0
/dev/fd0               /mnt/fl   vfat      user,noauto             0      0

and here's my menu.lst

# (0) Arch Linux
title  Arch Linux  [/boot/vmlinuz26]
root   (hd0,0)
kernel /vmlinuz26 root=/dev/md0 ro md=0,/dev/sda3,/dev/sdb3 vga=792 rootflags=data=journal
initrd /kernel26.img

and yet output of  tune2fs -l /dev/md0 stll says

Default mount options:    (none)

I was thinking maybe I need to force a filesystem check on it to make it stick, yet

shutdown -F -r now

or

touch /forcefsck

do nothing after a reboot. No file check gets ran.

I built my md devices according to the wiki on raid/lvm (skiping the lvm part) and using raid 0 for / and /home and raid 1 for /boot and swap.


My raid setup isn't the problem here as all works as it should... I just don't understand why the full journal does not want to take.

Last edited by somairotevoli (2007-09-20 20:17:31)

Offline

#11 2007-09-21 03:13:18

Magician21
Member
Registered: 2007-03-23
Posts: 45

Re: (solved)raid 0 questions

I'm out of my depth, but the last thing I can offer is this:
The 6th column is a fsck option. fsck looks at the number in the 6th column to determine in which order the filesystems should be checked. If it's zero, fsck won't check the filesystem.
(http://www.tuxfiles.org/linuxhelp/fstab.html)

Maybe that's why the check doesn't happen on boot?

Offline

#12 2007-09-21 04:24:38

somairotevoli
Member
Registered: 2006-05-23
Posts: 335

Re: (solved)raid 0 questions

Yep, changing 0 to 1 allowed thew check but did not make the full journal option stick.
I blindly followed the raid/lvm wiki and it didn't even click that zero was there as I had always had 1 there before w/ previous installs. I guess this is no good and the wiki should be edited.

I guess I will try the live cd after I do a backup.

Thanks for your help/input.

Offline

#13 2007-09-21 06:25:57

somairotevoli
Member
Registered: 2006-05-23
Posts: 335

Re: (solved)raid 0 questions

Update

I booted using the arch full installer, load my raid modules, and used

mdadm -A /dev/md0 /dev/sda3 /dev/sdb3

to start the raid for my /. Then ran

tune2fs -O has_journal -o journal_data /dev/md0

and then

e2fsck -D -f /dev/md0

. After reboot the full journal took:)
Thanks again Magician21!

Offline

Board footer

Powered by FluxBB