I have a system with two software raid arrays. The OS is Ubuntu 9.04 and is no longer receiving updates. I'd like to update the system to 12.04 rather than trying to do the automatic update from 9.04-> 9.10-> ... -> 12.04.

My main drive has 2 partitions that are mounted at / and /home.

Is it possible to do a fresh install of linux to the partition where / is mounted while preserving user accounts and preferences (such as passwords, home dir locations, etc...)?

Additionally what do I need to do to keep my software raid array intact following the OS re-install?

  • Make a backup first. Upgrading/reinstalling certainly should be possible, but you should have a backup. – Zoredache Sep 14 '12 at 21:39

Try the Alternate (text-only) install disc. Get it for example here.

During installation (in particular the part Partitioning your disks), you will be able to manage your current software RAID array and /home partition, while marking your / partition to be re-formatted. Select the partitions and configure it to use the correct mount point manually.

This also works for LVM enabled and volumes using dm-crypt and I've used this many times, avoiding dist-uprades which tend to be a lot slower and hitting more bugs than this approach. The server flavoured disc features the same text-only intaller, by the way.

Some other thoughts:

  • Try it in a virtual machine if you're uncomfortable.
  • Make an external backup of your valuable data.
  • Verify your backups.
  • Did I mention you need to have backups?
  • When I boot the installation CD will my raid array show up, ie will I see /dev/md0? – slayton Sep 14 '12 at 23:17
  • Yes, it will. The alternate installer will scan for existing software RAID arrays and partitions. Try it out - you can stop the installation without modifications if you cancel the installation before passing the partitioner. – gertvdijk Sep 14 '12 at 23:20
  • Ok great! Another question where is the information required to assemble the array stored? – slayton Sep 14 '12 at 23:42
  • 1
    @slayton That's another question indeed. The short answer: the metadata stored with the array on all of your disks. You can view that by doing mdadm --examine /dev/sda1 for a device sda1 part of an array. – gertvdijk Sep 14 '12 at 23:47

I'd copy of the files containing the user account information (passwd, group, shadow, etc.) out into a separate partition and external storage.

Then you do the install while making sure that the user data /home partition does NOT get formatted but IS used as your /home.

Then you merge the non-system user information back into the new password, group, and shadow files.

If you're feeling ambitious and your have an actual network, the non-system accounts could go into an authentication system like LDAP instead.

I'm also fond of putting all user data in big partition with /home and a /shared directory in there, and then using bind mounts in /etc/fstab. Fewer partitions to worry about then when it comes to re-installs or managing partitions to account for storage growth.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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