theweaselking: (Default)
[personal profile] theweaselking
I have a working non-RAID ubuntu server. I have a second HDD, identical in every way to the first, and I want software RAID-1. I also don't want to lose any data when setting it up, I have backups but that would still be a pain in the butt.

I found this set of instructions:
http://www.linux.com/howtos/Software-RAID-HOWTO-7.shtml
(specifically for RedHat)

And, of course, there's this set:
http://www.linux.com/howtos/Software-RAID-HOWTO-5.shtml
Which is for a base setup, assuming currently unformatted disks. It seems, uh, dangerous to try that on a live system.

The question I have is, are those first instructions good enough? Are they current enough? Are there pitfalls there that I'm not seeing? Would it be worth my while to pick up O'Reilly's "Managing RAID on Linux" before starting the process?

(And instead of a RH boot disk, I assume I could use a standard Ubuntu LiveCD, and mount the file systems manually, right?)

What about using rsync to get all the data off the drive to a spare disk, booting off the spare, setting up the RAID array with the original and the dupe, then using rsync to put the data all back onto the new RAID? Would that work? Or is that completely stupid?

(no subject)

Date: 2007-06-08 05:06 pm (UTC)
From: [identity profile] scifantasy.livejournal.com
Shoot the RAID.

(no subject)

Date: 2007-06-08 05:13 pm (UTC)
From: [identity profile] jsbowden.livejournal.com
You need to add the second disk to the existing volume group, and then concatenate the two. Since it's not from scratch, you won't get striping, so there's no speed benefit.

I know how to do this in FreeBSD, Irix, and Solaris, but I haven't done it in Linux personally, so all I can give is the general outline of what needs to happen, vs. specifics.

(no subject)

Date: 2007-06-08 05:35 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
I'm not looking for a speed benefit, I'm looking for a mirror in case of HDD problems.

And I'm afraid what you just said went zoom, right over my head. What do you mean by adding the disk to the volume group? I currently have /dev/hdd , with partitions, and I want to take /dev/hda, which has the same partition sizes but is totally blank, and make the two into a RAID. Can you start from there and try it a little slower?

(no subject)

Date: 2007-06-08 06:10 pm (UTC)
From: [identity profile] jsbowden.livejournal.com
Ah, ok, I'm getting 0 and 1 backwards again, you want a mirror.

In any event, you need the partitions you want mirrored to be plexes in a volume group. I don't know if Linux will let you do this after the fact, some OS's do, some don't. In any event, assuming it will, once you've created a volume group, and added these partitions as a plexes, you then need to add the partitions as plexes from the second drive. Once you've got them all as part of the volume group, you can then assign the mirrors.

A plex is just a name for a partition within a volume group. I suspect the name is some programmer's attempt to be cute, since a RAID volume is a multiplexed array, but I've never bothered to find out. Just accept the terminology (but don't get too attached, it's not hard and fast, and varies across vendors).

Here's an XLV file system on one of my Origins:

xlv_mgr> show all
Volume: test_data (complete)

Vol: 1; Standalone Plex: 0; Standalone Ve: 0

xlv_mgr> show test_data
VOL test_data (complete) (node=dragon)
VE test_data.data.0.0 [active]
start=0, end=215049599, (stripe)grp_size=3, stripe_unit_size=128
/dev/dsk/dks0d4s7 (71683274 blks)
/dev/dsk/dks0d5s7 (71683274 blks)
/dev/dsk/dks0d6s7 (71683274 blks)


This is a RAID1 volume that is striped:

1:47pm dragon /export/data %df -k .
Filesystem Type kbytes use avail %use Mounted on
/dev/xlv/test_data xfs 107520128 11818256 95701872 11 /export/data


By current standards, it's not terribly large (106 GB), but it's still amazingly fast by any standard (3 SCSI U160 15k RPM drives).

Each of those /dev/dsk/dksNdNsN entries is a disk partition. I could just as easily have assigned them all as mirrors instead by creating two more plexes (test_data.data.0.1 and test_data.data.0.2) and put one disk in each and designate those additional plexes as mirrors (I could have done 3 plexes and concatenated them, but then I wouldn't get the striping I get by putting them all in one plex) Something SGI does RIGHT with mirrors is that none are the 'primary', any one can fail, and it doesn't matter, because you mount the Volume Element (the /dev/xlv/[volumename] you see in my df output) and not the raw devices. Pick whatever god(s) you choose to pray to in the event you ever have to do this using Solstice Disksuite because Solaris is fucking BROKEN.

I've obviously only got a single partition on each drive (which encompasses the whole drive), but I could have broken it down further.

(no subject)

Date: 2007-06-08 06:18 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
Okay, it's basically identical to Linux mdadm, and the creation of /dev/mdX devices.

That's good.

The problem is, I'm having trouble getting there from here.

rsync is the wrong tool

Date: 2007-06-08 05:56 pm (UTC)
From: [identity profile] mhoye.livejournal.com
rsync won't give you a duplicate disk; it works at the filesystem level, not the block level. You want to use dd conv=sync,noerror drive1 drive2 with a large block size for that. Plz note that if you get the infile and outfile backwards with DD, it will copy the blank disk over the full one.

Re: rsync is the wrong tool

Date: 2007-06-08 06:01 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
rsync was to get all the data onto a *third* disk while I wiped the first two and set them up as a RAID, then rsync to put the files onto my new RAID. For that, I don't need a bit-by-bit copy.

Re: rsync is the wrong tool

Date: 2007-06-08 06:47 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
And dd will make an identical copy, but it won't make a RAID.

Re: rsync is the wrong tool

Date: 2007-06-08 07:21 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
I actually found that one. I'm working with this one, too:
http://www.linux.com/howtos/Software-RAID-HOWTO-7.shtml

But the problem with *both* of those is that they use lilo, not grub.

And I use grub.

And I have *no idea* how much of a difference it makes.

Re: rsync is the wrong tool

Date: 2007-06-09 06:32 am (UTC)
From: [identity profile] mejeep.livejournal.com
ferret gurrrrs at himself. One consulting assignment was testing Veritas LVM (logical volume manager) on HP servers, but I have none of the documentation or notes so I don't remember the names of the pieces or commands or terms for data migration, bla bla bla.

I vaguely recall how the raid array required some space in each partition for its own configuration tables. This impacts you since it interferes with migrating a pre-existing partition with pre-existing data to a raid member. My GUESS for migrating from one drive to a mirror is
- partition the NEW drive for RAID 1
- mount it via the LVM/raid stuff even though it's only one partition (half a mirror)
- make the file system, copy over all files from existing drive
- if that's happy and working, then erase the first drive, partition as a raid and rebuild the mirror to that drive (do NOT re-use any previous content)

As to GRUB booting from a mirrored ROOT, I'm confused. If the root partition is mounted READ-ONLY until the system boots, then can't the full kernel then pivot-mount it to the full raid BEFORE remounting it read/write? Yes, that means booting from one specific part of the mirror, but if that's read-only then there's no consistency problem and no need for RAID-0 drivers, eh?

(no subject)

Date: 2007-06-08 07:21 pm (UTC)
From: [identity profile] thathatedguy.livejournal.com
1/ Install rezqutypical.qwe to the original machine.
2/ Transfer the lopticular folder to the second machine's wangdangdoodle while running rezqutypical in the terminal sub-window.
3/ Perform a CRTL-LOLLY reboot on both machines simultaneously.
4/ Apply anti-coagulating agents to the phrontusus drive.
Should fix everything.

(no subject)

Date: 2007-06-09 07:21 am (UTC)
From: [identity profile] mejeep.livejournal.com
But ... the flayrod's out of skew with the treadle since spindle-sync is not in use!

(no subject)

Date: 2007-06-09 11:09 am (UTC)
From: [identity profile] thathatedguy.livejournal.com
Well, shit, just wipe both machines and install OS X.

(no subject)

Date: 2007-06-08 10:28 pm (UTC)
From: [identity profile] braneverseeking.livejournal.com
always hit the forums for Ubuntu issues

http://ubuntuforums.org/search.php?searchid=21723803

(no subject)

Date: 2007-06-09 03:50 am (UTC)
From: [identity profile] theweaselking.livejournal.com
"Sorry - no matches. Please try some different terms."

I think your search expired. Searching the site myself finds a pile of "how to make it work from scratch, wiping the drives" posts, like this one:
http://ubuntuforums.org/showthread.php?t=408461

... but nothing on my specific problem.

What search terms did you use? And can you link directly to the thread you wanted me to look at?

sorry to be slow

Date: 2007-06-10 08:04 am (UTC)
From: [identity profile] braneverseeking.livejournal.com
create raid one with existing data

http://ubuntuforums.org/showthread.php?p=145591

was the most likely looking if a bit old

Re: sorry to be slow

Date: 2007-06-10 03:55 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
Thanks for the help.

Profile

theweaselking: (Default)theweaselking
Page generated Jul. 8th, 2025 07:18 pm