This is a condensed version with a few tweaks I added as time went by. Original was copied from previous posts in
Kubuntu 10.04 Lucid Lynx (LTS) Child thread: Pre-installation (I'll add copy of those posts as a Reply #1 to this topic)
# This is a guide for me, creating and restoring the 2 partition k/ubuntu-studio karmic I'm running.
# / partition is 18.5 Gib (52% used).
# /home parition is 331 GiB (66% used not counting /home/username/MyBackup)
# Create /home/username/MyBackup folder.
#[Edit]
# I should explain here. I don't want to back up all my /home parition. Just the configuration files.
# Hidden folders in /home/username like .config, .whatever, etc... (else it'd be huge)
#[Edit end]
# At this point I shutdown, and booted from LiveUSB and open konsole (in gnome its terminal)
# Do:
sudo -i
cd /media
mkdir sda5 sda7
mount /dev/sda5 /media/sda5 ## [sda5=/home partition] partition containing this text
mount /dev/sda7 /media/sda7 ## [sda7=/ partition]
# Then open this text with kate (in gnome its gedit) to view this text for copy/pasting later.
# Using kdesudo konqueror, create /media/sda5/username/Desktop_Hold, Move files & folders from
# /media/sda5/username/Desktop/ to /media/sda5/username/Desktop_Hold
# Create /media/sda5/username/Documents_Hold. Move all *unhidden* files and folders in
# /media/sda5/username except /media/sda5/username/MyBackup, /media/sda5/username/Documents_Hold,
# and /media/sda5/username/Desktop.
# (If /media/sda5/username/MyBackup gets included in tar it'd be a loop. The resulting tar may, though I've
# not experienced it, grow till the partition is full.)
# (Documents_Hold can't be moved into itself.)
# Only need to make --exclude= tar options for 3 user folders.
# Following where it says /home* , it should be /media/sda5. I forget this is happening in liveUSB.
# Goal is to backup hidden files & folders with user configurations. (/home*/username/. )
# Also need to exclude /home*/lost&found/. and /home*/.Trash-0/. (note trailing periods, it means contents.
# **** It's prepared.
cd /media/sda5
sudo tar -cvpzf /media/sda5/username/MyBackup/sda5-home_backup.tgz --exclude=./lost+found/. --exclude=./username/Documents_Hold --exclude=./username/MyBackup --exclude=./Trash-0/. .
# *NOTE: --exclude=./foldername skips the folder. =./foldername/. includes the folder but not it's contents.*
# Now move files & folders back from /media/sda5/username/Documents_Hold/ to /media/sda5/username --- Next:
cd /media/sda7
sudo tar -cvpzf /media/sda5/username/MyBackup/sda7-root_backup.tgz --exclude=./dev/. --exclude=./home/. --exclude=./lost+found/. --exclude=./media/. --exclude=./mnt/. --exclude=./proc/. --exclude=./root/.local/share/Trash/. --exclude=./sys/. --exclude=./.Trash-0/. .
#[Edit-2]
# I forgot to put in that using kdesudo konqueror I returned files from Documents_Hold to
# Documents, and then ones from Desktop_Hold to Desktop. Restoring /media/sda5/username to where
# it was to begin with.
#[Edit-2 end]
# Backup complete. User files are not backed up using this method. I have approx 150 GiB of them. Virtual
# machine files and what not.
# The extract is the reverse of this. Again from liveUSB, mount (in my case /dev/sda5 and sda7, on
# /media/sda5 and /media/sda7. From /media/sda5 opening this file with kate (or gedit) for copy/paste to
# konsole (or terminal):
## *WARNING* CARE NEEDS TO BE TAKEN EXTRACTING USING tar
## *WARNING* INCORRECT USE *WILL* OVERWRITE EXISTING FILESYSTEMS
## *WARNING* USE VERY, VERY, VERY... CAREFULLY.
sudo -i
cd /media/sda5
sudo tar -xvpzf /media/sda5/username/MyBackup/sda5-home_backup.tgz --overwrite
# Check if folders exist that should, like /home/lost+found and /home/.Trash-0
# If not do a mkdir of each.
# Onward:
cd /media/sda7
sudo tar -xvpzf /media/sda5/username/MyBackup/sda7-root_backup.tgz --overwrite
# This hopefully will restore the system. If I ever have to use this file for restore, at this point
# check to make sure it looks good first.reboot. (Fingers crossed)
# *NOTE: If copied to an external drive that uses FAT32 filesystem, 4 GiB limit to file size is imposed.
# Follows is my resulting tar file sizes
root@ubuntu:/media/sda5/username/MyBackup# ls -l
total 4034024
-rw-r--r-- 1 root root 295149067 2010-06-22 11:58 2010-06-22-sda5-home_backup.tgz
-rw-r--r-- 1 root root 3831615677 2010-06-22 13:51 2010-06-22-sda7-root_backup.tgz
-rw-r--r-- 1 1000 1000 4332 2010-06-22 13:12 Backup_terminology
-rw-r--r-- 1 root root 3434 2010-06-22 11:43 Backup_terminology~
-rw-r--r-- 1 root root 3434 2010-06-22 11:43 Backup_terminology_backup
drwxr-xr-x 2 1000 1000 4096 2010-06-22 16:12 karmic-kubuntustudio-i386-9.10
drwxr-xr-x 2 1000 1000 4096 2010-06-22 16:11 kubuntustudio-amd64-10.04-lucid
drwxr-xr-x 2 1000 1000 4096 2010-06-22 16:12 kubuntustudio-amd64-9.10-karmic
root@ubuntu:/media/sda5/username/MyBackup#
# *Backup_terminology and Backup_terminology are this file
# *karmic-kubuntustudio-i386-9.10, kubuntustudio-amd64-10.04-lucid and
# *kubuntustudio-amd64-9.10-karmic are folders containing previous backups
# On my install that used to include wine my resulting home_backup.tgz file was 5.3 GiG. Too big for
# transfer to my external. FAT32 max size is 4. Since I hardy ever. Almost never, used wine, I deleted it's
# folder. A person could add an option --exclude to the tar and do a separate tar of just the
# /home/username/.wine folder. I chose not to.
Kubuntu 10.04 Lucid Lynx (LTS) Child thread: Pre-installation (I'll add copy of those posts as a Reply #1 to this topic)
# This is a guide for me, creating and restoring the 2 partition k/ubuntu-studio karmic I'm running.
# / partition is 18.5 Gib (52% used).
# /home parition is 331 GiB (66% used not counting /home/username/MyBackup)
# Create /home/username/MyBackup folder.
#[Edit]
# I should explain here. I don't want to back up all my /home parition. Just the configuration files.
# Hidden folders in /home/username like .config, .whatever, etc... (else it'd be huge)
#[Edit end]
# At this point I shutdown, and booted from LiveUSB and open konsole (in gnome its terminal)
# Do:
sudo -i
cd /media
mkdir sda5 sda7
mount /dev/sda5 /media/sda5 ## [sda5=/home partition] partition containing this text
mount /dev/sda7 /media/sda7 ## [sda7=/ partition]
# Then open this text with kate (in gnome its gedit) to view this text for copy/pasting later.
# Using kdesudo konqueror, create /media/sda5/username/Desktop_Hold, Move files & folders from
# /media/sda5/username/Desktop/ to /media/sda5/username/Desktop_Hold
# Create /media/sda5/username/Documents_Hold. Move all *unhidden* files and folders in
# /media/sda5/username except /media/sda5/username/MyBackup, /media/sda5/username/Documents_Hold,
# and /media/sda5/username/Desktop.
# (If /media/sda5/username/MyBackup gets included in tar it'd be a loop. The resulting tar may, though I've
# not experienced it, grow till the partition is full.)
# (Documents_Hold can't be moved into itself.)
# Only need to make --exclude= tar options for 3 user folders.
# Following where it says /home* , it should be /media/sda5. I forget this is happening in liveUSB.
# Goal is to backup hidden files & folders with user configurations. (/home*/username/. )
# Also need to exclude /home*/lost&found/. and /home*/.Trash-0/. (note trailing periods, it means contents.
# **** It's prepared.
cd /media/sda5
sudo tar -cvpzf /media/sda5/username/MyBackup/sda5-home_backup.tgz --exclude=./lost+found/. --exclude=./username/Documents_Hold --exclude=./username/MyBackup --exclude=./Trash-0/. .
# *NOTE: --exclude=./foldername skips the folder. =./foldername/. includes the folder but not it's contents.*
# Now move files & folders back from /media/sda5/username/Documents_Hold/ to /media/sda5/username --- Next:
cd /media/sda7
sudo tar -cvpzf /media/sda5/username/MyBackup/sda7-root_backup.tgz --exclude=./dev/. --exclude=./home/. --exclude=./lost+found/. --exclude=./media/. --exclude=./mnt/. --exclude=./proc/. --exclude=./root/.local/share/Trash/. --exclude=./sys/. --exclude=./.Trash-0/. .
#[Edit-2]
# I forgot to put in that using kdesudo konqueror I returned files from Documents_Hold to
# Documents, and then ones from Desktop_Hold to Desktop. Restoring /media/sda5/username to where
# it was to begin with.
#[Edit-2 end]
# Backup complete. User files are not backed up using this method. I have approx 150 GiB of them. Virtual
# machine files and what not.
# The extract is the reverse of this. Again from liveUSB, mount (in my case /dev/sda5 and sda7, on
# /media/sda5 and /media/sda7. From /media/sda5 opening this file with kate (or gedit) for copy/paste to
# konsole (or terminal):
## *WARNING* CARE NEEDS TO BE TAKEN EXTRACTING USING tar
## *WARNING* INCORRECT USE *WILL* OVERWRITE EXISTING FILESYSTEMS
## *WARNING* USE VERY, VERY, VERY... CAREFULLY.
sudo -i
cd /media/sda5
sudo tar -xvpzf /media/sda5/username/MyBackup/sda5-home_backup.tgz --overwrite
# Check if folders exist that should, like /home/lost+found and /home/.Trash-0
# If not do a mkdir of each.
# Onward:
cd /media/sda7
sudo tar -xvpzf /media/sda5/username/MyBackup/sda7-root_backup.tgz --overwrite
# This hopefully will restore the system. If I ever have to use this file for restore, at this point
# check to make sure it looks good first.reboot. (Fingers crossed)
# *NOTE: If copied to an external drive that uses FAT32 filesystem, 4 GiB limit to file size is imposed.
# Follows is my resulting tar file sizes
root@ubuntu:/media/sda5/username/MyBackup# ls -l
total 4034024
-rw-r--r-- 1 root root 295149067 2010-06-22 11:58 2010-06-22-sda5-home_backup.tgz
-rw-r--r-- 1 root root 3831615677 2010-06-22 13:51 2010-06-22-sda7-root_backup.tgz
-rw-r--r-- 1 1000 1000 4332 2010-06-22 13:12 Backup_terminology
-rw-r--r-- 1 root root 3434 2010-06-22 11:43 Backup_terminology~
-rw-r--r-- 1 root root 3434 2010-06-22 11:43 Backup_terminology_backup
drwxr-xr-x 2 1000 1000 4096 2010-06-22 16:12 karmic-kubuntustudio-i386-9.10
drwxr-xr-x 2 1000 1000 4096 2010-06-22 16:11 kubuntustudio-amd64-10.04-lucid
drwxr-xr-x 2 1000 1000 4096 2010-06-22 16:12 kubuntustudio-amd64-9.10-karmic
root@ubuntu:/media/sda5/username/MyBackup#
# *Backup_terminology and Backup_terminology are this file
# *karmic-kubuntustudio-i386-9.10, kubuntustudio-amd64-10.04-lucid and
# *kubuntustudio-amd64-9.10-karmic are folders containing previous backups
# On my install that used to include wine my resulting home_backup.tgz file was 5.3 GiG. Too big for
# transfer to my external. FAT32 max size is 4. Since I hardy ever. Almost never, used wine, I deleted it's
# folder. A person could add an option --exclude to the tar and do a separate tar of just the
# /home/username/.wine folder. I chose not to.
Comment