Announcement

Collapse
No announcement yet.

Back up to tarball using liveCD, from Pre-backup, Summarized MOVED(10.04 forum)

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Back up to tarball using liveCD, from Pre-backup, Summarized MOVED(10.04 forum)

    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.

    #2
    Stuff that was posted Kubuntu 10.04 Lucid Lynx (LTS) Child thread: Pre-installat

    Topic: Pre-backup, Summarized (Read 146 times)

    Pre-backup, Summarized
    « on: May 06, 2010, 08:14:15 pm »

    Hi all.
    I did finally make the move to lucid. I've condensed the old following 3 posts and edited in my summary. I've also copy pasted the old posts to the end of this 1st post, so if you've read it and them before you can skip to the 2nd one. I'm just keeping them in this post as kinda a history. I might be looking for some info contained in em someday. Hopefully someone out there gleans something out of all this.

    :^)

    2010-05-06 20:11:45 [2010-05-09|see 2nd post/reply] [2010-05-10 -> 3rd post/reply]

    Hi all,
    I'm using karmic and its configured to my liking. I'm curious to try lucid, but I'm wanting to backup my current karmic in case I need or want to restore it. I have my karmic installed on 3 partitions. I'm using tar for backup.

    I'm not sure if I have to do each partition separately. In case I do my planned backup at this point is to move all but Desktop folder within my user folder to a folder named Documents_Hold. And exclude it and Desktop from the tar. My aim is to get the hidden folders in the backup. I'm guessing upgrading to lucid will make changes in them.

    Anyway, my linux partitions are / , /home , and /usr. I'm going to try the following from terminal. Anyone know if what I've assembled (following) is enough, or too much for the tar files. And if I can restore my working karmic, should things go wrong? And thanks.

    : Plan was modified, disable internet, sudo su, and remove sudo from the tar operation commands :

    / partition:

    #sudo

    tar cvpzf /home/*User_Folder*/MyBackup/root_backup.tgz --exclude=/dev --exclude=/home --exclude=/lost+found --exclude=/proc --exclude=/media --exclude=/mnt --exclude=/sys --exclude=/usr /

    /home partition:

    #sudo

    tar cvpzf /home/*User_Folder*/MyBackup/home_backup.tgz --exclude=/home/lost+found --exclude=/home/*User_Folder*/Desktop --exclude=/home/*User_Folder*/Documents_Hold --exclude=/home/*User_Folder*/MyBackup /home

    /usr partition:

    #sudo

    tar cvpzf /home/*User_Folder*/MyBackup/usr_backup.tgz --exclude=/usr/lost+found /usr

    2010-05-09 20:26:
    1 (last?) update 2010-05-09 23:17:


    ### IT SHOULD BE NOTED - tar IS A GOOD FILE BUT CAN DO DAMAGE TO A SYSTEM IF MISHANDLED. ###
    # In this record I'm using /dev items that pertain to my particular computer's hard drive.
    # But you might be able to glean some needed info from it. There are GUI programs that may
    # accomplish backup without needing to run at command line. But I'm thirsty for experience.

    # At first I did the 3 partition backup but ran into a little trouble, and ended up restoring
    # to 2 partitions instead. It should have been 2 partitions to begin with. I'd not known a clean
    # install would have to reformat the /usr folder anyway. So the following is mostly written as
    # a guide for myself in creating and restoring the 2 partition system I'm currently running.

    # (ubuntu studio 9.10) I'm putting off upgrading to 10.04 for a while.
    # I'll let this all sink in.

    # I first did a move of all unhidden files and folders in my /home/XXXXXXXXXX to a folder I
    # created named /home/XXXXXXXXXX/Documents_Hold. Except for folders in /home/XXXXXXXXXX
    # named Desktop, MyBackup and of course Documents_Hold.
    # (Documents_Hold can't be moved into itself.)
    # This eliminates the need to make --exclude= options for all but 3 user folders. My aim is to
    # backup all the hidden files & folder that hold my user configurations.
    # (/home/XXXXXXXXXX/.* ) I'll also need to exclude /home/lost&found and /home/.Trash-0 .
    # So now I'm prepared.

    # I shut down linux, and did a boot with kubuntu 8.04 liveUSB. Opened konsole (in gnome its terminal)
    # Did from memory: (the commands are enclosed in <' '> , just the commands not the <' or '>)

    #<'sudo su'>

    #<'cd /media'>

    #<'mkdir sda5 sda7'> ## sda5=my "/home" partition

    # (my swap is sda6) ## sda7=my "/" partition

    #<'mount /dev/sda5 /media/sda5'> ## This mounts the volume this text is saved to. I then opened

    # this text with kate (in gnome its gedit) to view the rest of this text and use it for copy
    # pasting the rest of this plan. I did: (Note: no <' or '> here, copy and pasting in terminal)

    cd /media/sda5

    tar cvpzf /media/sda5/XXXXXXXXXX/MyBackup/home_backup.tgz --exclude=./lost+found/. --exclude=./XXXXXXXXXX/Desktop --exclude=./XXXXXXXXXX/Documents_Hold --exclude=./XXXXXXXXXX/MyBackup --exclude=./.Trash-0/. .

    # Now I moved the file & folders back from /media/sda5/XXXXXXXXXX/Documents_Hold/ to
    # /media/sda5/XXXXXXXXXX --- Next:

    mount /dev/sda7 /media/sda7

    ****EDIT ADDED 05-18-2010*********
    ## I'm going to try this with the --exclude= options to exclude the contents of but not the directory of the excluded stuff.
    ## i.e. --exclude=./proc/*
    ## I'll see if this works and restores the directories without any content (course it may need to be --exclude=./proc/. I'll find out
    ## and add the outcome here later. By the way I'm doing this on a vm. My native install is restored and doing fine ****

    ****ADDED 05-19-2010*************
    ## Yes, it worked. changing the --exclude options with tar to --./proc/. changed the behavior to add the directory to the tar
    ## without adding it's contents. An addition I like. No more needing to create empty directories after extract to a cleared
    ## partition.

    cd /media/sda7

    tar cvpzf /media/sda5/XXXXXXXXXX/MyBackup/root_backup.tgz --exclude=./dev/. --exclude=./home/. --exclude=./lost+found/. --exclude=./proc/. --exclude=./media/. --exclude=./mnt/. --exclude=./sys/. .

    # And the backup is complete. My user files are not backed up using this method. I have approx
    # 150 GiB of them. Virtual machine files and what not. So the restore process I use is the reverse
    # of this. Again from liveUSB and with root priveledges (sudo su), I mount the 2 partitions
    # (in my case /dev/sda5 and sda7, mounted on /media/sda5 and sda7. From /media/sda5 opening this
    # file with kate (or gedit) I copy and paste to konsole (or terminal):

    cd /media/sda5

    tar xvpzf /media/sda5/XXXXXXXXXX/MyBackup/home_backup.tgz --overwrite

    # *obsolete* I check to be sure all the folders exist that should, like /home/lost+found and /home/.Trash-0 .
    # *obsolete* If not I do a mkdir of each. These are usually empty when I do the backups. I don't know if I
    # *obsolete* need to create them if they're not there. So I do. Also
    # Since the only files & folders I'm
    # restoring don't overwrite my folders in /home/XXXXXXXXXX (/media/sda5/XXXXXXXXXX)
    # I don't have to worry about moving them for this. CARE NEEDS TO BE TAKEN. tar especially launched
    # with sudo CAN DO LOTS OF DAMAGE if mistakes are made. Onward:

    cd /media/sda7

    tar xvpzf /media/sda5/XXXXXXXXXX/MyBackup/root_backup.tgz --overwrite

    # *obsolete* Also, if you clear the partition. No reformat, but delete everything you'll have to do a mkdir
    # *obsolete* at the "/" root directory for the following empty folders. /dev , /lost+found , /proc , /media , /mnt , and /sys.
    # *obsolete* If /home doesn't exist, you'll need to mkdir /home too. On first boot you may have to use a recovery
    # *obsolete* kernel, go to a root prompt. Issue a cd /home , and a mount /dev/sda5 (partition containing /home).
    # *obsolete* Resume booting, login with password, and issue a sudo shutdown -r now .

    # This hopefully will be the end of a possible future restore. I'm hoping if I ever have to use
    # this file for restore, at this point it'll just boot. (Fingers will be crossed)
    # Again I'll have to check to make sure it looks right first.

    --------------------------------------------------------------------------------------------

    # In my previous attempt, since I had done this originally with a usr_backup.tgz file for a
    # user partition when it was in 3 partitions,., after I deleted my "/usr" partition (gparted)
    # and expanded my "/" partition to take up the space. Because I changed the partition sequence,
    # for a while my system was broke. Also a factor was the way I originally formatted the command.
    # I found it should be run as root, from the point in the file system you want to be the restore
    # point. My first try, I'd ended the tar command with like / , /home , and /usr. When extracted
    # like the home_backup.tgz would create a folder called home in the partition being used for /home.
    # I'm sure not understanding this is what lead to the following. And I found using the . instead
    # of like /media/sda5 or something within the command made it fewer characters and extracts right.
    # Just be sure your at the point you want the .tgz file extracted to.
    # So what I went thru, mistakenly was this:

    # Luckily my sda5 was the last partition on my drive. So I was able to delete what was swap (sda8)
    # and the now sda6. Create a new swap at the beginning of my extended partition so it became sda6.
    # Then created an sda7, ext3 partition for my "/" partition. Extracted my root_backup.tgz to it.
    # Had to do a restore to a mkdir and cd to /media/sda7/usr, extract the usr-backup.tgz to it.
    # Do a move from /media/sda7/usr/usr/* to /media/sda7/usr and rmdir /media/sda7/usr/usr. Again
    # I used kdesu konqueror with show hidden files checked. (in gnome gksu nautilus) I also had to
    # comment out the no longer used lines in /etc/fstab and /etc/mtab . I also edited the UUID of
    # /dev/sda7 to just that.
    # /dev/sda7.
    # /dev/sda5 was unchanged so I left it's line alone.

    # I actually used vim editor to do those. But I don't know if its needed for other than editing
    # the sudoers list.

    # I also had to boot the 2nd line in GRUB (recovery) and drop to a root prompt. Did a:

    cd /

    # If there was a home folder in there (if not I did a "mkdir home'), changed to it

    cd /home

    mount /dev/sda5 ## my "/home" partition

    exit

    # Resumed booting, did login with password, and did a sudo shutdown -r now.

    # AND FINALLY IT WORKED AGAIN.

    ########################## !! YEAH !! ##########################

    My apology to anyone who's muddled through all this. Some of the stuff is things I'd like to have
    been able to find, though I had a broken system, I had to do a little trial and error, but
    My computer's unbroken again.

    OK,

    Thinking about it, and going back through my vm's I found one of kubuntu 8.04 last accessed in Sept '09. I'm currently applying all available updates to it's installation. I'm planning to make a dupe/for backup of it. Then walk it through the upgrade path to an eventual (hopefully) lynx.

    I figured with my paranoia of upgrading my current buntu studio to lynx, this would be the best idea.

    My thanks to all buntu forum users, for all their efforts in helping each other with all the issues.

    My current machine is:

    Dell Studio 17 Laptop
    EMT64 (or EM64T)
    4 GiB Ram
    500 GiB HD

    Dual-Boot
    Win7 (100 GiB)
    Ubuntu Studio 9.10 (330 GiB)

    Well, I'm doing the upgrade ladder a rung at a time on vm. Started at 8.04, up to 9.04 but no panel. Alt+F2 access, Alt+Tab app switching. Searching for fix. Will browse 9.04 posts.

    I'm thinking, though this is an educational process, it really only gains me testing whether vmware can do the upgrades. Being a vm means it's being tested on vmware's vm, and not my actual laptop's hardware. This may be a no-where's-ville. Oh well.

    2010-05-11 14:18 PM
    Finally found how to get panel showing and widgets added to it. Right-click desktop, click +Add Panel, right-click panel, click panel options -> panel settings. I think I must have read right past it several times. And still didn't get it from searching. I found it by mistake on my own.
    OK, might as well get on with it. In

    VMware CTRL+ALT options

    are available as CTRL+ALT+Spacebar (with release Spacebar)+(F-Key or Backspace)
    Also since ctrl+alt+backspace is disabled,

    sudo apt-get install dontzap

    sudo dontzap --enable

    could be --disable I can't check now, I'm writing this in vm k-9.04

    Gparted can be run on vmware, at vm boot, click in window as it starts, quickly press Esc key to get vmware's bios screen. If you miss it and get to GRUB, use the c key for command line and type in reboot. You might need to tell message screens not to try starting something in order to get to the Esc key fast enough. Press ctrl+alt to release mouse from window. In menu choose VM -> Removable Devices -> CD/DVD -> mount an iso -> navigate to and select a gparted.iso file. In vmware's bios choose boot CD/DVD.
    If your vm disk file contains multiple partitions like mine you can resize/move, so I made my vm's /home partition smaller and expanded it's / partition to make 2 GiB shifted to it.
    Only thing is the vm disk's files grew by how much I shifted. Defragmenting didn't shrink the file sizes and from what I've been able to read about it, it's just what it is. 2 GiB extra file stored for area marked as empty by vmware. But the vm still works ok.

    back to get er done. Next is check if fully updated and step up to 9.10 .

    I had a idea, I could use the tar backup method to extract the partitions of my vm. It's at 10.04 now and working good. Repeated runs of aptitude safe-upgrade did it.
    Anyway, I used the same method as mentioned in above posts, but since I was accessing the vm, by booting 8.04 liveCD.iso I couldn't have any other way to get the tar files out, except attaching my external usb hard drive.
    That worked, so I was able to create a new vm with the partitions sized the way I wanted. However I wasn't sure how to get GRUB back on it's virtual mbr, so I installed 8.04 on it.
    Then I re-accessed it with 8.04 liveCD.iso, mounted and deleted the contents of the partitions, and extracted the tar backups to them.
    I had to edit it's /boot/grub/menu.lst (I don't know why it wasn't the new /boot/grub/grub.cfg file thing but it wasn't) and using kdesu kate I replaced the UUID=XXXXXXXXXXXXXXXXXs with /dev/sda3, and did the same in /etc/fstab and /etc/mtab. It was finicky at boot and I got to a intramfs? screen. It might have been a busybox.
    Now armed with a little more knowledge I was able to access sda3 and cd to home. I then did a mount /dev/sda1 . (space period is the mount point) to current folder. I then did a reboot and 10.04 returned and the vm was 1.2 GiB less in size.
    I'm actually enjoying this. I can only hope putting this down somewhere will help someone else. But Kubuntu LL 10.04 vm is up and running. And it seems to be all good.
    « Last Edit: May 21, 2010, 02:02:59 am by linxuser »


    This is kinda a summary
    « Reply #1 on: May 06, 2010, 09:15:04 pm »

    To recount. I first did a clean install of kubuntu karmic. I have 2 partitions for linux. / partition, and /home partition. At install time, /home can be used without reformating, keeping my user files intact. I assumed this design, back in dapper 6.06, after several broken system/reinstalls, before someone at kubuntuforums suggested it. I forget who, or I'd give them credit. So after kubuntu karmic, I added the software for ubuntustudio. And I'm liking it.

    So, I decided to find a way to keep my system software and setup, in case things go wrong. That is what my previous posts were on my trail to this. I'm sure there is software out there that does it. And likely, better. I'll do final method(s) I used in posts to follow.

    OK, I made the decision to attempt upgrade to lucid. I downloaded ubuntustudio lucid alternate amd64 DVD. I found that because of kubuntu stuff on my system I had to include, live network updates. ubuntustudio-lucid.iso was 1.7 GiB. I did the upgrade from running ubuntustudio karmic. Network updates were 500+ MB. I kept all current configurations. (grub stuff, and settings)

    This being the second time through this, I can only say the Magic System Request sequence came in handy at a stall on the first attempt.

    Magic System Request = ((Alt+SysRq)+[R-S-E-I-U-B]).

    On my keyboard with no SysRq key I used PrntScrn.

    Back to current. At this point, as best I can tell, everything's fine, and at the same place it was in karmic kubuntu+ubuntustudio. Running kernel is 2.6.32-22-generic. There is also a 2.6.31-10-rt (realtime) kernel for ubuntustudio apps.

    I did a backup to tar files for lucid. Also included are screen captures showing tar file sizes and disk usage for each. (karmic-snapshot.png, and lucid-snapshot.png)

    NOTE: I won't use persitent liveUSB for this. I tried and it maxed out the flashdrive caching the extraction. I had to boot the non-persistent menu-option, and that works fine.

    After making the lucid tar backups. I booted from my liveUSB kubuntu hardy stick. To prepare the hard drives partitions for the extraction of karmic tar backups. My hard drive info is /dev/sda5 = /home partition and /dev/sda7 = / partition. I did

    #Opened konsole

    'sudo su'
    'cd /media'
    'mkdir sda5 sda7'
    'mount /dev/sda5 /media/sda5'
    'mount /dev/sda7 /media/sda7'
    'cd sda7'

    #Opened via Alt+F2

    'kdesu konqueror'

    #Navigated to /media/sda7
    #Did 'Edit -> Selection -> Select All'
    #Did '(Hold down Ctrl)+ click on home folder, to deselect it, and a Shift+Delete to wipe it clean. Except for the empty home folder.

    #Returning to konsole, I did

    'sudo tar -xvpzf /media/sda5/ #My_User# /MyBackup/ #My# root_backup.tgz --overwrite'

    (--overwrite may not be needed)

    #When it was done, I returned to kdesu konqueror. Navigated to /media/sda5/ #My_User# /
    #Still having a folder named Document_Hold, I did 'Edit -> Selection -> Select all' then holding down Ctrl I unselected Documents_Hold folder. Right-clicked one of the selected/highlighted folders and clicked on cut.
    #Opened the Documents_Hold folder and in it right-clicked and selected paste. Navigated up to #My_User# folder.
    #I then did 'View -> Show hidden files' and 'Edit -> Selection -> Select all. Did the holding Ctrl unselecting Documents_Hold again. With the rest of the (hidden) files and folders highlighted, I did a Shift+Delete. Left just Documents_Hold folder. I clicked on Documents_Hold folder, again opening it. Did 'Edit -> Selection -> Select all'. Right clicked on a highlighted folder and clicked cut. Navigated up to #My_User# folder again and right-clicked in it, clicked paste.

    #Returned to konsole and did

    'sudo tar -xvpzf /media/sda5/ #My_User# /MyBackup/ #My# home_backup.tgz --overwrite'

    #When it was done, I closed kdesu konqueror. Returning to konsole I did

    'cd /media'
    'sync'
    'umount sda5 sda7'
    'exit'

    #And reboot.

    I discovered that grub no longer booted right, some error about char length. So I booted from liveCD kubuntu 9.10, Opened konsole (Alt_F2), 'konsole' did

    'sudo -i'
    'mount /dev/sda7 /mnt'
    'grub-install --root-directory=/mnt/ /dev/sda'

    Rebooted and I am back to kubuntu/ubuntustudio karmic.

    My experiment is O.K. I've included screen-shots of both sets of tar files. I'll restore/(same method)extract the tarfiles, back to lucid. ;^)

    I've just encountered the limitation on attachments so the second one will be with the next post.

    NOTE: I just got back from returning system to lucid. That's why the note about using persistent.

    * karmic-snapshot-scaled.png (127.63 KB, 720x384 - viewed 1 times.)
    « Last Edit: May 21, 2010, 03:14:00 am by linxuser »


    How I back up my /home partition to tarfile.tgz
    « Reply #2 on: May 10, 2010, 12:36:53 pm »

    Creating a tarfile of /home and just the configuration files and folders. (hidden like '.adobe .cache .compiz ...etc') So I get this by booting from my liveUSB kubuntu hardy stick, using 'kdesu konqueror' I create folders in my #User# folder named Documents_Hold and MyBackup. Selecting all but the Documents_Hold and MyBackup folders in my #User# folder and right-click cutting them. (the hidden files and folders aren't showing so they're not selected)
    Opening the Documents_Hold folder and in it right-click pasting them. Now opening konsole ((Alt+F2) 'konsole') I do

    'sudo su'
    'mkdir /media/sda5'
    'mount /dev/sda5 /media/sda5'
    'cd /media/sda5'

    sudo tar -cvpzf /media/sda5/ #User# /MyBackup/home_backup.tgz --exclude=./lost+found/. --exclude=./ #User# /Documents_Hold --exclude=./ #User# /MyBackup --exclude=./Trash-0/. .

    (Explaination: the -cvpzf are options, c is create, v is verbose, p is preserve permissions, z is compression type, f is archive file. the /media/sda5/ .... /home_backup.tgz is where to write it to. --exclude= is files/folders to not include. the period '.' denotes the current directory, in this case its /media/sda5. The --exclude=./lost+found/. means to exclude the contents of ./lost_found but not the folder itself. and the last period tells it to do it with the current directory. My real user folder in place of #User# )

    After it's done, I need to return the files and folders being held in Documents_Hold folder to my #User# folder. I reverse the process I did earlier in kdesu konqueror. Then closing kdesu konqueror. Returning to konsole, I do

    'cd /media'
    'sync'
    'umount /media/sda5'
    'exit'

    But now, that just backs up the current configuration of my system. Not the system's files on partition for / . I'll do that on my next post.

    * lucid-snapshot-scaled.png (126.31 KB, 720x354 - viewed 1 times.)
    « Last Edit: May 21, 2010, 03:15:08 am by linxuser »


    How I back up my / (root) parition to a tarfile.tgz
    « Reply #3 on: May 11, 2010, 11:16:18 am »

    Creating a tarfile of my / partition. It's sda7. (/dev/sda7) Since my backup.tgz files are being stored on my /home partition I need to mount both partitions. I boot my liveUSB kubuntu hardy stick. Open a konsole (Alt+F2) 'konsole' . And I do.

    'sudo su'
    'cd /media'
    'mkdir sda5 sda7'
    'mount /dev/sda5 /media/sda5'
    'mount /dev/sda7 /media/sda7'
    'cd sda7'

    'sudo tar -cvpzf /media/sda5/ #User# /MyBackup/root_backup.tgz --exclude=./dev/. --exclude=./home/. --exclude=./lost+found/. --exclude=./proc/. --exclude=./media/. --exclude=./mnt/. --exclude=./sys/. .'

    (Brief explaining: The --exclude=./dev/. excludes the contents of /dev but an empty /dev is included. This explained in previous post, and more)

    After its done, still in konsole I did

    'cd /media'
    'sync'
    'unmount /media/sda5 /media/sda7' #or I could just do 'umount sda5 sda7'
    'exit'

    And that's that. The *.tar files will have root permissions being made using sudo, but they can be moved to where you want. They only need root permission to be opened, modified, or deleted. I've made folders within my MyBackup folder for karmic and lucid. And I'm impressed with the compression. In lucid my / partition of 7.2 GiB results in a tar backup of 2.6 GiB. Nice. ;^)

    Final note: Too bad about grub having to be reinstalled, but thanks to all for all your postings. And to this internetwork of all.
    « Last Edit: May 21, 2010, 03:15:51 am by linxuser »

    Comment

    Working...
    X