You are not logged in.

#1 2020-05-01 03:55:29

stefano
Member
Registered: 2011-04-09
Posts: 258

Least painful replacement of failing system drive? [SOLVED]

I have a server with several data disks running a zfs pool and a rather small Arch system installation on an external (USB) hard drive. The  system drive is now failing and I need to replace it soon. I wonder if there is a less painful way to reinstall Arch tan starting with a blank rive and going once again through all the steps---from configuring the network, to nfs, zfs, cups, and so on. I suppose copying the system drive would not get me  very far,  but I wonder if there is a way to somehow bringing over the current configuration once I have a minimal system running. I have had rather bad luck with drives and this is the third time my system fails in a year. I am starting to dread the procedure.  I looked for advice in the forums and wiki but could not find anything relevant. But I may not be searching for the right keywords.

Last edited by stefano (2020-05-03 03:18:44)

Offline

#2 2020-05-01 04:05:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Least painful replacement of failing system drive? [SOLVED]

This is the reason that I keep my system (as well as my data) on a Raid array: it has survived multiple drive failures over the years, and I just whack another drive in, it resyncs overnight and life goes on.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2020-05-01 07:26:57

jonno2002
Member
Registered: 2016-11-21
Posts: 684

Re: Least painful replacement of failing system drive? [SOLVED]

at least try to copy the system drive first, its by far the easiest method, if rsync fails repeatedly then you'll have to do it the hard way.

do the top to bottom method using rsync
https://wiki.archlinux.org/index.php/Mi … _to_bottom
https://wiki.archlinux.org/index.php/Rs … tem_backup

Offline

#4 2020-05-01 13:45:22

stefano
Member
Registered: 2011-04-09
Posts: 258

Re: Least painful replacement of failing system drive? [SOLVED]

Thanks for the links! I knew I was missing the right keywords in my search.

I think what I was looking for is this strategy described in one of the comments on this page linked to from the archwiki:


Based on your guide, I cloned an actively running Arch system (X server logged off) successfully the following way:

->A primary partition has been created on the new SSD using fdisk, then it has been formatted with EXT4 using mkfs.ext4 and mounted to /mnt/new

->The partition has been cloned using rsync, but /mnt has to be exluded, otherwise it will be copied recursively until the new disc is full:
rsync -avHX –exclude ‘mnt’ / /mnt/new/

->arch-chroot has been run directly at the /mnt/new without the blind mounts.

->grub-mkconfig -o /boot/grub/grub.cfg
->grub-install /dev/sda
->mkinitcpio -p linux#

Reboot…works!

I only have to migrate the system drive, as all the data are on a separate Raid-like ZFS array, so I am not worried about that. Hopefully it will be quick and easy.

Offline

#5 2020-05-03 03:21:49

stefano
Member
Registered: 2011-04-09
Posts: 258

Re: Least painful replacement of failing system drive? [SOLVED]

The top-bottom strategy suggested in the Arch wiki migration page eventually worked, even if it took me a few iterations to get it right...
All in all, it would have been faster to re-install from scratch. I just hope that it'll go smoother next time, now that I know the drill.

Thanks everyone for their help.

Offline

Board footer

Powered by FluxBB