|
Any time your re-installing, it's possible to make a mistake and lose everything, therefore I recommend backing up all critical data to a USB drive or some other external device. Large external USB's are cheap and can be completely disconnected during the reinstallation.
If you don't have one, ask a friend to borrow theirs.
The main directories that you need to backup are /etc, /root, /home, and possibly
/var or at least parts of /var, and maybe /boot. There are several programs that you can use to backup the system. Since you said you are going to reinstall anyhow, I suggest
using tar, you could use a for loop like this:
mkdir /usb
mount -t vfat /dev/sda1 /usb # Mount the external drive (assuming FAT filesystem)
# Run this loop from / (the root directory)
for DIR in root etc home var boot
do
tar -czvf /usb/${DIR}.tgz ${DIR}
done
umount /usb # Unmount the external drive when done
Backing it all up
You may want to backup the entire drive using tar -czvf /usb/everything.tgz /
or look into the dump command. However, even if you back it all up,
I recommend at least having a these smaller tarfiles for easy access to important
files later.
To extract, use tar -xzvf root.tgz etc.
Note, do not restore the etc, boot, and var directories overtop the new install,
extract them into a separate directory, and only copy files as needed.
Partitioning drives
Note, I don't know how many partitions you separated your disk into
during your original install, but I highly recommend creating at
least two partitions during your reinstall. Create a root (/) partition,
and a home (/home) partition, then if you want to re-install or upgrade,
you can reformat / without losing any files in /home. Having
separate /var, /usr, /boot, and /tmp filesystems also have several benefits.
|