I have a large disk full of data that I'd like to upgrade to SW RAID 1 with a minimum of downtime. Taking it offline for a day or more to rsync all the files over is a non-starter. Since I've mounted SW RAID1 drives directly with "mount -t ext3 /dev/sdX" it would seem possible to flip the process around, perhaps change the partition type with fdisk or parted, and remount as SW RAID1? I'm not trying to move over the O/S, just a data paritition with LOTS of data. So far, Google pounding has resulted in howtos like this one that's otherwise quite useful, but has a big "copy all your data over" step I'd like to skip: http://sysadmin.compxtreme.ro/how-to-migrate-a-single-disk-linux-system-to-software-raid1/ But it would seem to me that a sequence roughly like this should work without having to recopy all the files. 1) umount /var/data; 2) parted /dev/sdX (change type to fd - Linux RAID auto) 3) Set some volume parameters so it's seen as a RAID1 partition "Degraded". (parted?) 4) ??? Insert mdadm magic here ??? 5) Profit! `mount /dev/md1 /var/data` Wondering if anybody has done anything like this before... -Ben
On Thu, Jul 24, 2014 at 7:11 PM, Lists <lists at benjamindsmith.com> wrote:> I have a large disk full of data that I'd like to upgrade to SW RAID 1 > with a minimum of downtime. Taking it offline for a day or more to rsync > all the files over is a non-starter. Since I've mounted SW RAID1 drives > directly with "mount -t ext3 /dev/sdX" it would seem possible to flip > the process around, perhaps change the partition type with fdisk or > parted, and remount as SW RAID1? > > I'm not trying to move over the O/S, just a data paritition with LOTS of > data. So far, Google pounding has resulted in howtos like this one > that's otherwise quite useful, but has a big "copy all your data over" > step I'd like to skip: > > http://sysadmin.compxtreme.ro/how-to-migrate-a-single-disk-linux-system-to-software-raid1/ > > But it would seem to me that a sequence roughly like this should work > without having to recopy all the files. > > 1) umount /var/data; > 2) parted /dev/sdX > (change type to fd - Linux RAID auto) > 3) Set some volume parameters so it's seen as a RAID1 partition > "Degraded". (parted?) > 4) ??? Insert mdadm magic here ??? > 5) Profit! `mount /dev/md1 /var/data` > > Wondering if anybody has done anything like this before... >Even if I found the magic place to change to make the drive think it was a raid member, I don't think I would trust getting it right with my only copy of the data. Note that you don't really have to be offline for the full duration of an rysnc to copy it. You can add another drive as a raid with a 'missing' member, mount it somewhere and rsync with the system live to get most of the data over. Then you can shut down all the applications that might be changing data for another rsync pass to pick up any changes - and that one should be fast. Then move the raid to the real mount point and either (safer) swap a new disk, keeping the old one as a backup or (more dangerous) change the partition type on the original and add it into the raid set and let the data sync up. -- Les Mikesell lesmikesell at gmail.com
On Fri, Jul 25, 2014 at 5:41 AM, Lists <lists at benjamindsmith.com> wrote:> I have a large disk full of data that I'd like to upgrade to SW RAID 1 > with a minimum of downtime. Taking it offline for a day or more to rsync > all the files over is a non-starter. Since I've mounted SW RAID1 drives > directly with "mount -t ext3 /dev/sdX" it would seem possible to flip > the process around, perhaps change the partition type with fdisk or > parted, and remount as SW RAID1? > > I'm not trying to move over the O/S, just a data paritition with LOTS of > data. So far, Google pounding has resulted in howtos like this one > that's otherwise quite useful, but has a big "copy all your data over" > step I'd like to skip: > > http://sysadmin.compxtreme.ro/how-to-migrate-a-single-disk-linux-system-to-software-raid1/For data partitions a lot of the stuff is not applicable. With respect to the madam steps, creating degraded arrays, filesystem on those degraded arrays and then copy over the data etc. is spot on IMO. I would recommend the steps in the above tutorial to really be assured that none of data is corrupted.> > But it would seem to me that a sequence roughly like this should work > without having to recopy all the files. > > 1) umount /var/data; > 2) parted /dev/sdX > (change type to fd - Linux RAID auto) > 3) Set some volume parameters so it's seen as a RAID1 partition > "Degraded". (parted?) > 4) ??? Insert mdadm magic here ??? > 5) Profit! `mount /dev/md1 /var/data` > > Wondering if anybody has done anything like this before... >'mdadm' starts initializing the array (writing on the disk), overwriting your file system on that partition. I would not recommend it but you can try it and see what happens with your experiment. Should be a no brainer since you have secondary back ups of the data elsewhere (stated in this thread). -- Arun Khan
Apparently Analagous Threads
- Problem with mdadm, raid1 and automatically adds any disk to raid
- Problem with mdadm, raid1 and automatically adds any disk to raid
- Problem with mdadm, raid1 and automatically adds any disk to raid
- Problem with mdadm, raid1 and automatically adds any disk to raid
- Problem with mdadm, raid1 and automatically adds any disk to raid