I need to upgrade an old Debian 6 to the latest release: the server host mail and samba NT4 domain for a small office. Everything, including /boot partition, is inside a software raid. What is the best choice to run the upgrade and be able to recover in case of system not working? Is it possible to remove one disk of the RAID1, do the upgrade, check everything is OK then reconnect the disk and leave it sync all the night? In case of failure I'll start the system with the old disk and after connect the "upgraded" one to let it resync back.

Do you see any issue with this procedure? Do you have other hints?

  • I wouldn't recommend using one disk of the RAID (although it is possible). My first recommendation is: install a new Debian 9/10 server from scratch and port your services/ configs/ etc. If that's not possible: create ~127 backups of your machine, (upgrade 6 to 9/10 in a VM,) upgrade 6 to 9/10. I suppose the hardware is that old as well, so be prepared for some incompatibility (maybe chipset/ storage drivers or something) and furthermore be prepared to rewrite the config of many used services, as they could have changed drastically. – Lenniey Sep 18 at 15:15
  • Instead of a separate installation on different hardware, can I configure another additional disk to use as root and boot partition and leave home into the old raid and when tested move the updated root and boot partition into raid? – Mauro Destro Sep 18 at 18:55

Upgrading a production server is tricky because it's easy to break things and be left having to start from scratch.

The trick is to proceed and verify stepwise, and to begin with hardware. Also, virtualization is your friend.

If possible, I would:

  • Get a hardware RAID 6 volume up on the machine. Partition the volume to allow system installation on it. Also create data partitions. See this.

  • Move data storage to one of the RAID 6 data partitions. Create a temporary mount point for the partitions, copy over, then create a permanent mount point. See this and this. You can put multiple directories (/srv for file server data, /var/mail for mail) on a single partition using a bind mount. See this.

  • Create a backup image of each of the the RAID 1 system partitions. Use dd with a compression utility, something like:

    sudo dd if=/dev/sd? | bzip2 > /path/to/image-name.bz2

where sd? corresponds to the partition you're imaging and /path/to/... is on one of the RAID 6 data partitions. You'll probably need to be booted to something like a Ubuntu Live USB stick.

  • Use dd again to image the RAID 1 system partitions to the RAID 6 system partitions. Test and verify boot to the latter.

  • Upgrade OS only (not Samba or mail servers), create and fully configure KVMs for the file server and mail server respectively, and transition to each once the KVM configuration is complete.

YMMV but good luck.

  • RAID 6 is not a viable solution... is a small business server with all SATA port already taken. But i'll take your part of "dd" for boot and root partition to a file in a data store partition inside the same server and try the update: if it goes wrong I replace the boot and root partition with the "dd"-ed one. – Mauro Destro Sep 25 at 14:46
  • I do expect you'd need to add a RAID card to accomplish RAID 6, if all the system currently is capable of is software RAID 1. I recommend it because in my experience, the RAID card spec is the single most critical of any for a small business server (followed next by UPS) because it is the cheapest and best insurance for reliability and ease of administration. It's hard to sell on the basis of things not happening but these machines are business-critical (meaning server down=business down), in addition to the value of time spent on otherwise avoidable recovery. Good luck. – ebsf Sep 25 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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