|
2012-02-28 In place migration to Linux software RAIDSuppose that you have an existing system that is operating without mirrored disks and you want to change that; you want to add a second physical disk to the system and then wind up with software RAID mirroring of appropriate filesystems. This generally goes by the name of 'in-place migration'. Knowledge of how to do this used to be more common because back in the old days, distribution installers couldn't set up mirrored system disks during installation; these days installers can and so needing to do this by hand is much rarer. (In place migration is easy with software RAID implementations that store the metadata 'out of band', outside of the disk space being mirrored. Solaris DiskSuite can more or less trivially do in-place migration to mirrors, with only a minor pause to remount most filesystems. Unfortunately for us, Linux software RAID is not such a thing; it stores its metadata 'in-band', at either the start or the end of the partition being mirrored.) When this question came up here recently, I said that there are two ways to do in place migration: the traditional, well tested approach that everyone used to use and a theoretically possible approach that I at least have never tested. The well tested approach is not quite literally in-place; the theoretical one is, but is trickier and untested. The traditional approach goes like this:
Back in the days of Ubuntu 6.06 and similar systems we did this a lot and we never had problems (at least if we weren't shuffling filesystems around at the same time). This is not quite in-place because it involves copying the filesystem, and on a sufficiently busy filesystem it may be troublesome to get a complete and accurate copy (eg, you may need an extended downtime to halt all other activity on the filesystem). The theoretical way that is fully in-place is to set up your new partition on your new disk and then do something like this:
Depending on how long it takes to shrink the filesystem and whether or not it can be done live, this may require less downtime than the other approach. I doubt I'll ever use the theoretical way. While it's vaguely neat,
it'll clearly take a bunch of work and testing to develop into something
that can be used for real and it has only marginal advantages over the
tried and true way (especially on extN filesystems, where (One comment.)
InplaceSoftwareRaid written at 00:11:50; Add Comment
2012-02-15 The temptation of LVM mirroringOne of the somewhat obscure things that LVM can do is mirroring. If you mention this, most people will probably ask why on earth you'd want to use it; mirroring is what software RAID is for, and then you can stack LVM on top if you want to. Well, yes (and I agree with them in general). But I have an unusual situation that makes LVM mirroring very tempting right now. The background is that I'm in the process of migrating my office workstation from a pair of old 320 GB drives to a pair of somewhat newer 750 GB drives, and it's reached the time to move my LVM setup to the 750s (it's currently on a RAID-1 array on the two 320s). There are at least three convenient ways of doing this:
The drawback of the second approach is that if the 750 GB drives turn
out to be flaky or have errors, I don't have a quick and easy way to go
back to the current situation; I would have to re- (I've already changed to having the root filesystem on the new drives, but I have an acceptable fallback for that and anyways it's less important than my actual data.) The drawback of the third approach is that I would have to trust LVM mirroring, which is undoubtedly far less widely used than software RAID-1. But it's temptingly easier (and better) than just adding two more mirrors to the current RAID-1 array. If it worked without problems, it would clearly be the best answer; it has the best virtues of both of the other two solutions. (This would be a terrible choice for a production server unless we really needed to change the RAID superblock format and couldn't afford any downtime. But this is my office workstation, so the stakes are lower.) I suppose the right answer is to do a trial run of LVM mirroring in a
virtual machine, just as I did a pilot run of (4 comments.)
LVMMirroringTemptation written at 18:02:58; Add Comment
2012-02-08 Choosing the superblock format for Linux's software RAIDLinux's software RAID implementation stores metadata about the RAID
device in each physical device involved in the RAID, in what (Even if you don't actively make a decision, In my opinion, at the moment there are three sensible options to choose from: the 0.90 format and then two variants of the 'version-1' metadata format.
(You can see what format your current RAID arrays are using by looking
at Where the superblock goes is potentially important for RAID-1 arrays. A RAID-1 array with the superblock at the end can relatively easily have whatever filesystem it contains mounted read-only without the RAID running, because the filesystem will start at the start of the underlying raw partitions; this can be important sometimes. A RAID-1 array with the superblock at or near the start of the underlying partitions can't have the raw partitions used this way, because you have to look somewhat beyond the start of the raw partition to see the filesystem. (Some versions of If you want to use a modern format and are going to directly use the
RAID-1 array for a filesystem, I would use 1.0 format (this is what
I've done for my new (LVM physical volumes have their own metadata, which normally goes at
the start of the 'raw' partition that LVM is using but which can be
replicated to the end as well. See As far as I know you can't change the superblock format of an array after it has been created, at least not without destroying it and recreating it. You can sort of do this without an extra disk with sufficient work, but really you want to get it right at creation time. PS: note that in theory you can use
|
These are my WanderingThoughts GettingAround This is part of CSpace, and is written by ChrisSiebenmann. * * * Atom feeds are available; see the bottom of most pages. Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web |