LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-14-2004, 04:04 PM   #1
andrewjschmidt
LQ Newbie
 
Registered: May 2004
Posts: 9

Rep: Reputation: 0
Question Software RAID-5 to regular drives...Possible without complete reformat?


I have 3 drives in a RAID set (100G x 1 and 120G x 2). I set it up that way to play around (in other words, yes I know having unequal size drives will cause in wasted space). I would like to set it up to be plain-jane regular hard drives. Is it possible to move the data around somehow and change the drives to 'normal', or will I have to move them to a totally separate drive to accomplish this? No big deal really, but it sure would make things easy if I didn't have to copy out almost 100G.

Here's the df output for md0:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/md0 192304732 96024120 86512064 53% /

Thanks!

Andy
 
Old 08-14-2004, 06:02 PM   #2
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
Possible, but can be quite dangerous.

There's a couple of ways to try it, but either way you should backup your stuff.

Since I don't have specifics on how you've built your array, I'll use the following as an example.
Your RAID is setup as /dev/md0, with /dev/hda + /dev/hdc + /dev/hde as participants. You would probably want to use the largest drive, so in this case I'm using /dev/hde as one of the 120GB platters.
Try 'raidsetfaulty /dev/md0 /dev/hde'. If that works without complaints, you should still have a functional (but no longer redundant) raid array consisting of /dev/hda + /dev/hdc. Now you should be able to use 'raidhotremove /dev/md0 /dev/hde1'. If that succeeds, you can now run 'fdisk /dev/hde' and delete and re-create new non-raid partition(s). After that you can mk<whateverfs> you want to format the partition(s). For this example I just used one partition as /dev/hde1.

If you've made it this far, you can now mount the drive; 'mount /dev/hde1 /mnt'.

Next we need to copy over the data from your root fs to the new partitions. I use
cd /
find . -xdev | cpio -pmv /mnt
This will copy everthing from the / directory, excluding any other mount points (we don't want to copy /mnt to /mnt as we'd lather/rinse/repeat until the drive is stuffed full).

Now you need to make the changes to your fstab on the mounted drive - edit /mnt/etc/fstab and change the /dev/md0 mount to /dev/hde.

You won't be able to boot this drive directly until you re-run your boot loader configuration (tell us which one you're using - grub or lilo), but you should be able to mount it at boot by passing 'root=/dev/hde1' (assuming that /dev/hde1 is your new / partition) at the boot prompt.

Last edited by mcleodnine; 08-14-2004 at 06:03 PM.
 
Old 08-15-2004, 11:04 AM   #3
andrewjschmidt
LQ Newbie
 
Registered: May 2004
Posts: 9

Original Poster
Rep: Reputation: 0
Okeedokee, I have partial success so far. I removed one of the (120G) drives from the raid set and copied everything over to it. I edited grub.conf and pointed everything to /dev/hda3. When I try booting, I get a 'kernel panic, no init found try passing init="..... error.

Thanks a bunch for the reply. I have everything on /dev/hda3 so nothing is lost (yet). When I mount hda3, I can still see the filesystem as it should be.

FYI, here is my drive layout:

/dev/hda1 = /boot
/dev/hda2 = swap
/dev/hda3 = (old raid disk 0, now separated)
/dev/hdb1 = raid disk 1
/dev/hdd1 = raid disk 2

Here is what grub.conf looks like with the /dev/hda3 entries:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda3
# initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core (2.6.7-1.494.2.2)
root (hd0,0)
kernel /vmlinuz-2.6.7-1.494.2.2 ro root=/dev/hda3 rhgb quiet
initrd /initrd-2.6.7-1.494.2.2.img
title Fedora Core (2.6.6-1.435.2.3)
root (hd0,0)
kernel /vmlinuz-2.6.6-1.435.2.3 ro root=/dev/hda3 rhgb quiet
initrd /initrd-2.6.6-1.435.2.3.img
title Fedora Core (2.6.6-1.435.2.1)
root (hd0,0)
kernel /vmlinuz-2.6.6-1.435.2.1 ro root=/dev/hda3 rhgb quiet
initrd /initrd-2.6.6-1.435.2.1.img
title Fedora Core (2.6.6-1.435)
root (hd0,0)
kernel /vmlinuz-2.6.6-1.435 ro root=/dev/hda3 rhgb quiet
initrd /initrd-2.6.6-1.435.img
title Fedora Core (2.6.6-1.427)
root (hd0,0)
kernel /vmlinuz-2.6.6-1.427 ro root=/dev/hda3 rhgb quiet
initrd /initrd-2.6.6-1.427.img
title Fedora Core (2.6.5-1.358)
root (hd0,0)
kernel /vmlinuz-2.6.5-1.358 ro root=/dev/hda3 rhgb quiet
initrd /initrd-2.6.5-1.358.img

Here is /etc/fstab (on /dev/hda3, not md0):

/dev/hda3 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/hdd1 swap swap defaults 0 0
/dev/hda2 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/sda1 /mnt/usb_hd1 vfat umask=002,gid=501 0 0

Again, thanks a bunch!

Andy
 
Old 08-15-2004, 11:18 AM   #4
andrewjschmidt
LQ Newbie
 
Registered: May 2004
Posts: 9

Original Poster
Rep: Reputation: 0
I took out the 'rhgb' and 'quiet' boot options and it booted fine from /dev/hda3. Thank you so much for your help. I think I'll now have the full 340G of space instead of 195(ish).

Andy
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding additional drives/resizing drives in RAID arrays kheldar Linux - Hardware 1 10-19-2005 02:21 PM
Please help! Regular software caused freeze of my PC bluefire Linux - General 5 05-12-2004 12:25 PM
Software RAID: 4 drives at once? GaX Linux - Hardware 2 01-08-2004 11:21 AM
Upgrading hard drives on Software raid 1 boot drives. linuxboy123 Linux - General 0 12-11-2003 04:28 PM
moving system from ide software raid to new box with scsi raid ftumsh Linux - General 0 10-28-2003 10:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration