For the last ten years, I have been making inexpensive servers for small businesses. Each server has two identical drives mirrored with raid1. Later, SATA became available, then eSATA. In the past, when a drive failure occurred, the policy was to just replace both drives. Since the drives were internal, there wasn't much way to escape downtime or hourly charges to replace the drives.

I have just recently changed to having a small xi3 server with two external SATA drives. I couldn't do it with squeeze, but it seems that with wheezy and beyond, the external drives are easily hot pluggable. The largest reason to replace both drives before is that the cost of the second drive didn't incur enough of an expense with respect to the work to down the box and work on the drives. The other reason was that by the time one drive died, there were no more identical drives available on the market. With eSATA drives, the possibility to just replace a single drive on a small, cheap server has been realized.

I have been reading up on how LVM is now capable of supporting RAID1 mirroring, however, I have also been reading where the technology is still too new for there to be much information written about it. The answer here was really informative, but doesn't really help me determine how easily I can replace a failed drive. The option I am still most comfortable with is creating the md partitions, then making the md device a PV. Today, I can replace a failed drive with an identical drive. The new drive only has to be partitioned like the first one (I am thinking about eliminating partitions entirely and placing /boot in the lvm, which is also a recent feature). If the new drive is larger than the failed drive, I have been assured that I can create a partition that is at least as big as the md partitions on the running drive, and that will work fine, just leaving extra space on the new drive.

Please keep in mind that the goal of the servers is to provide as much functionality and reliability for the cheapest price in an environment where there is absolutely no in-house IT. There will be no RAID other than type 1 mirroring. Primarily, what I am looking for is minimal service hours after a drive failure, which I can achieve with external hotplug drives. Secondarily, I would like to allocate the available duplicated space to file storage, which is more difficult when using preset md partitions. I can read from the answer linked above that lvextend will work when the drives get bigger, however the answer was unclear about reassembly, especially with a simple raid1. This is what is more problematic with traditional raid over lvm, and is why I am investigating using lvm directly with mdraid underneath. The question "Is it ready yet? If so, where should I go to RTFM?"

To cut a long story short:

  • Is LVM's RAID1 reliable?
  • Can I convert a volume currently using LVM over dm-raid RAID1 to LVM RAID-1?
  • Alternatively, can I enlarge the dm-raid RAID1 volume when I replace a disk by a larger one?

closed as unclear what you're asking by frostschutz, Zelda, Anthon, Networker, jasonwryan Feb 20 '15 at 3:47

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    @umeboshi (Author of that other question here). I wish there was a manual to read, I don't think there really is. There is a little bit of info in some RHEL guides, other than that its random pages across the 'net, email list archives, and reading the source. It sounds like you're on Wheezy though, where LVM-RAID doesn't even support growing an array. I'd stick with mdraid, and recosider for jessie+1. Jessie appears to be usable if you're careful, but I wouldn't thrust it on someone without an on-site Linux admin. – derobert Feb 19 '15 at 17:23

You can replace a failed unit in an md RAID1 with a larger partition; there's no need to use a same sized component. However, obviously only the size of the smallest component will be used in the RAID1 mirroring.

I've used this to do live migration to larger disks:

  • fail and replace one component with a larger one (mdadm -f /dev/mdX /dev/sdX1; mdadm -r /dev/mdX /dev/sdX1; mdadm -a /dev/mdX /dev/sdY1 If you can hotswap disks then the new component may well be the same /dev entry you removed. You may need to partition the new disk before use.)
  • wait for the sync to complete
  • fail and replace the other component again with a larger one
  • wait for the sync to complete
  • resize the RAID1 with mdadm --grow --array-size=max /dev/mdX
  • resize the filesystem with e.g. resize2fs /dev/mdX (by default resize2fs will use the maximum space available)
  • all done.

Not the answer you're looking for? Browse other questions tagged or ask your own question.