Liveappstubackupv2.2: Back up your Ubuntu-enabled squashfs File

Source: Internet
Author: User
Lub (liveappstubackup ). The current version is 2.2, with support for grub2 and 9.10. Download lub.zip, decompress it, and copy it to/usr/local/bin. (Use sudocp) Start the system to be backed up, and enter sudolub-B on the terminal as instructed. (Note that you must first install lupin-casper and so on, and the script will prompt you.) In the Backup Directory

Lub (Live Ubuntu Backup ). The current version is 2.2, with support for grub2 and 9.10.
Download and decompress lub.zip, and copy it to/usr/local/bin. (Use sudo cp)

Start the system to be backed up and enter
Sudo lub-B
Follow the instructions. (Install lupin-casper first, and the script will prompt you)

In the backup directory, the kernel and menu files used to directly start the backup image are generated. You can see the example menu in the backup directory.

The recovery process must first be directed from the backup file to the live environment, and then executed on the terminal
Sudo lub-r
Follow the instructions.

You can use lub-h to view help documentation and version information.

2.2 dual-language version, supporting grub2
Download lub.zip

1.2 English version, archival
Download lub.sh.zip

Help document: Use lub-h to view
Code:Ubuntu @ ubuntu-laptop :~ $ Lub-h
Live ubuntu backup by billbear
This program will help you back up the running ubuntu system to compress the backup file into a startup squashfs.
Start the backup file and run the program again.
You can restore the backup file to another machine.
You can migrate ubuntu from a virtual machine to a real machine.
You can migrate the wubi-installed system to a real partition.

Installation:
You only need to copy the script to any place and grant the execution permission.
I like to put it in/usr/local/bin, so that no absolute path needs to be written every time I run it.

Usage:
Sudo path to this script-B
Is a backup, and
Sudo path to this script-r
Yes.
You can also use
Sudo bash to this script path-B
And
Sudo bash to this script path-r

Note that it cannot be used
Sudo sh path to this script-B
And
Sudo sh path to this script-r

Backup:
The program depends on squashfs-tools to work.
In addition, you must install lupin-casper to make a boot backup.
Run the following command on the terminal to install them:
Sudo apt-get install squashfs-tools lupin-casper
Then you can use this command to back up the running ubuntu system:
Sudo path to this script-B
If the script is in/usr/local/bin
Sudo lub-B
Then follow the prompts.
You can specify the backup storage path and the files and directories to be excluded.
You do not need to detach a mobile hard disk, windows partition, or any partition that you manually mount. They will be ignored automatically.
Therefore, you can directly store backups to mobile hard disks, windows partitions, and so on.
Be careful: Make sure you have enough space to store the backup.
The script will generate several other files required for startup.
Read the menu. lst generated in the backup storage directory, which will show you how to start the backup file directly.

Recovery:
Read the menu. lst generated in the backup storage directory, which will show you how to start the backup file directly.
After live ubuntu backup is started, open a terminal and enter
Sudo path to this script-r
If the script has been stored in/usr/local/bin during backup
Sudo lub-r
And restore as prompted.
Note: This script does not provide the Partition Function (you can only format but cannot create a partition, delete a partition or adjust the partition size ).
Only partitions that have been backed up can be restored.
Therefore, we recommend that you install gparted before the backup so that you can use the partition tool to recover the backup.
In addition, if an error occurs in the Partition Table, the backup cannot be restored until the error is fixed.
You can specify Several partitions and Their mount points.
If you do not have a swap partition, you can create a swap file for you (if you do ).
A new fstab is automatically generated and grub is installed.
If necessary, you can change the host name, user name, and password.

The backup system must be running.
Enter sudo lub-B as prompted.
Code:Ubuntu @ ubuntu-laptop :~ $ Sudo lub-B
Back up the system. We recommend that you exit other programs. Continue? (Y/n)
Y
Specify an empty directory (absolute path) to store the backup. You can drag and drop the directory from the Nautilus File Manager to this point. You can use a mobile hard disk.
If this parameter is not specified, it will be stored in/home/ubuntu/backup-20090524

Specify the file/directory to be excluded and write one line. You can drag and drop this point from the Nautilus File Manager. End with a blank line.

Start backup? (Y/n)
Y
Parallel mksquashfs: Using 1 processor
Creating little endian 3.1 filesystem on/home/ubuntu/backup-20090524/backup20090524.squashfs, block size 131072.
[===================================================== ===========================] 92925/93032 99% File/tmp/bind/var/log/lelekit/history changed size while reading filesystem, attempting to re-read
[===================================================== ===========================] 92930/93032 99% File/tmp/bind/var/log/auth. log changed size while reading filesystem, attempting to re-read
[===================================================== ===========================] 93001/93032 99% File/tmp/bind/var/log/messages changed size while reading filesystem, attempting to re-read
[===================================================== ===========================] 93006/93032 99% File/tmp/bind/var/log/syslog changed size while reading filesystem, attempting to re-read
[===================================================== ===========================] 93013/93032 99% File/tmp/bind/var/log/user. log changed size while reading filesystem, attempting to re-read
[===================================================== =================================] 93032/93032 100%
Exportable Little endian filesystem, data block size 131072, compressed data, compressed metadata, compressed fragments, duplicates are removed
Filesystem size 789719.00 Kbytes (771.21 Mbytes)
40.17% of uncompressed filesystem size (1966107.66 Kbytes)
Inode table size 1155385 bytes (1128.31 Kbytes)
29.20% of uncompressed inode table size (3957443 bytes)
Directory table size 1113938 bytes (1087.83 Kbytes)
46.99% of uncompressed directory table size (2370406 bytes)
Number of duplicate files found 8348
Number of inodes 115900
Number of files 87876
Number of fragments 6597
Number of symbolic links 14964
Number of device nodes 95
Number of fifo nodes 3
Number of socket nodes 35
Number of directories 12927
Number of uids 14
Root (0)
Syslog (1, 101)
Ubuntu (1000)
Daemon (1)
Polkituser (109)
Libuuid (100)
Lp (7)
Man (6)
Avahi-autoipd (104)
Gestation (105)
News (9)
Messagebus (108)
Di-ip (103)
Klog (1, 102)
Number of gids 29
Video (44)
Audio (29)
Tty (5)
Kmem (15)
Disk (6)
Adm (4)
Daemon (1)
Dip (30)
Lp (7)
Fuse (104)
Shadow (42)
Ssl-cert (105)
Messagebus (117)
Crontab (107)
Mail (8)
Lpadmin (106)
Mlocate (108)
Utmp (43)
Ssh (1, 109)
Games (60)
Polkituser (118)
Root (0)
Staff (50)
Libuuid (101)
Src (40)
Admin (1, 121)
Avahi-autoipd (110)
Gestation (111)
Klog (1, 103)
Backed up to/home/ubuntu/backup-20090524. Please read the menu. lst in it :)

Let's look at the backup. In addition to the backup file itself, there are also kernels for Direct start:
Code:Ubuntu @ ubuntu-laptop :~ $ Ls/home/ubuntu/backup-20090524/
Backup20090524.squashfs menu. lst
Initrd. img-2.6.28-11-generic vmlinuz-2.6.28-11-generic

Let's see how to start the backup file-it's all written in the notes of menu. lst.
Note:
You can store all backups on a built-in hard disk for startup;
You can store all backups on the mobile hard disk and start them from the mobile hard disk;
You can also place the kernel on the built-in hard disk, squashfs on the mobile hard disk, and boot the kernel from the built-in hard disk to start the backup of the mobile hard disk)
Code:Ubuntu @ ubuntu-laptop :~ $ Cat/home/ubuntu/backup-20090524/menu. lst
# This menu. lst is for grub4dos. Can be used for gnu grub with slight modifications


# How to directly start your backup20090524.squashfs on a windows machine:
# Download the latest grub4dos from the http://download.gna.org/grub4dos
# Decompress the downloaded grub4dos and copy grldr and grldr. mbr to the c: root directory.
# Copy this menu. lst to the c: root directory.
# Then create a "casper" directory in the root directory of any partition and copy the backup20090524.squashfs, initrd. img-2.6.28-11-generic, vmlinuz-2.6.28-11-generic to it
# Add the following line of text to the end of boot. ini (not including)
# C: \ grldr. mbr = "grub4dos"
##### For Windows Vista, you can create a boot. ini file and write it as follows:
##### [Boot loader]
##### [Operating systems]
##### C: \ grldr. mbr = "grub4dos"
# Restart grub4dos.


# How to directly start your backup20090524.squashfs on a linux machine:
# Create a "casper" folder in the root directory of any partition (note gnu grub cannot read NTFS, so casper cannot be put there) and copy backup20090524.squashfs, initrd. img-2.6.28-11-generic, vmlinuz-2.6.28-11-generic to it
# Copy the following two Live Ubuntu Backup boot items to the end of/boot/grub/menu. lst and change the "find -- set-root" line to "root (hd ?,?) "(The partition where you created the" casper "folder)


Default 0
Timeout 10

Title Live Ubuntu Backup 20090524
Find -- set-root/casper/vmlinuz-2.6.28-11-generic
Kernel/casper/vmlinuz-2.6.28-11-generic boot = casper ro ignore_uuid
Initrd/casper/initrd. img-2.6.28-11-generic

Title Live Ubuntu Backup 20090524, Recovery Mode
Find -- set-root/casper/vmlinuz-2.6.28-11-generic
Kernel/casper/vmlinuz-2.6.28-11-generic boot = casper ro single ignore_uuid
Initrd/casper/initrd. img-2.6.28-11-generic
Ubuntu @ ubuntu-laptop :~ $


To recover the backup file, it is best to start the backup file first. Restoring the backup in other environments is unpredictable. Of course, the same version of livecd should guide us to recover our backup theoretically. The following is the recovery operation (which can also be called installation) after the backup file is started)
Code:Ubuntu @ ubuntu :~ $ Sudo lub-r
Your backup will be restored. Continue? (Y/n)
Y
Specifies the squashfs backup file (absolute path ). You can drag and drop from the Nautilus File Manager. If you are starting from the backup squashfs, press enter to use the squashfs file started this time.

Which partition is used /?
1)/dev/sda1 ntfs 5198 MB 5)/dev/sda7 swap 625 MB
2)/dev/sda10 swap 280 MB 6)/dev/sda8 jfs 1464 MB
3)/dev/sda5 reiserfs 206 MB 7)/dev/sda9 ext2 1291 MB
4)/dev/sda6 reiserfs 6087 MB 8)/dev/sdb1 vfat 8015 MB
#? 4
You choose/dev/sda6, which contains the following files/directories:
Bin cdrom etc initrd. img media opt root selinux sys usr vmlinuz
Boot dev home lib mnt proc sbin srv tmp var
OK? (Y/n)
Y
Format this partition? (Y/n)
Y
Format/dev/sda6 as follows:
1) ext2
2) ext3
3) ext4
4) reiserfs
5) jfs
6) xfs
#? 3
Which partition is used as the swap?
1)/dev/sda1 ntfs 5198 MB 6)/dev/sda8 jfs 1464 MB
2)/dev/sda10 swap 280 MB 7)/dev/sda9 ext2 1291 MB
3)/dev/sda5 reiserfs 206 MB 8)/dev/sdb1 vfat 8015 MB
4) 9) None
5)/dev/sda7 swap 625 MB 10) none, and end the partition settings.
#? 7
You choose/dev/sda9, which contains the following files/directories:
Lost + found
OK? (Y/n)
Y
/Dev/sda9 will be formatted as swap.
Which partition is used as/home?
1)/dev/sda1 ntfs 5198 MB 6)/dev/sda8 jfs 1464 MB
2)/dev/sda10 swap 280 MB 7)
3)/dev/sda5 reiserfs 206 MB 8)/dev/sdb1 vfat 8015 MB
4) 9) None
5)/dev/sda7 swap 625 MB 10) none, and end the partition settings.
#? 6
You choose/dev/sda8, which contains the following files/directories:
Billbear
OK? (Y/n)
Y
Format this partition? (Y/n)
Y
Format/dev/sda8 as follows:
1) ext2
2) ext3
3) ext4
4) reiserfs
5) jfs
6) xfs
#? 6
Which partition is used as/boot?
1)/dev/sda1 ntfs 5198 MB 6)
2)/dev/sda10 swap 280 MB 7)
3)/dev/sda5 reiserfs 206 MB 8)/dev/sdb1 vfat 8015 MB
4) 9) None
5)/dev/sda7 swap 625 MB 10) none, and end the partition settings.
#? 3
You choose/dev/sda5, which contains the following files/directories:
Abi-2.6.28-11-generic memtest86 +. bin.
Config-2.6.28-11-generic System. map-2.6.28-11-generic
Grub vmcoreinfo-2.6.28-11-generic
Initrd. img-2.6.28-11-generic vmlinuz-2.6.28-11-generic
OK? (Y/n)
Y
Format this partition? (Y/n)
Y
Format/dev/sda5 as follows:
1) ext2
2) ext3
3) ext4
4) reiserfs
5) jfs
6) xfs
#? 1
Which partition is used as/tmp?
1)/dev/sda1 ntfs 5198 MB 6)
2)/dev/sda10 swap 280 MB 7)
3) 8)/dev/sdb1 vfat 8015 MB
4) 9) None
5)/dev/sda7 swap 625 MB 10) none, and end the partition settings.
#? 10
Start formatting the partition (if any partition needs to be formatted ). Continue? (Y/n)
Y
Formatting/dev/sda6
Done

Formatting/dev/sda8
Done

Formatting/dev/sda5
Done

Formatting/dev/sda9
Setting up swapspace version 1, size = 1261064 KiB
No label, UUID = a3491a9c-8226-4a29-bcf7-608b5a4e553f
Done

If you have other partitions for the target system, open another terminal and mount them in the appropriate place under/tmp/target. Then press Enter.

Where can I install GRUB stage1?
We recommend that you install it in/dev/sda or/dev/sda5.
1)/dev/sda, MBR 6)/dev/sda7, swap
2)/dev/sdb, MBR 7)/dev/sda8, xfs
3)/dev/sda10, swap 8)/dev/sda9, swap
4)/dev/sda5, ext2 9)/dev/sdb1, vfat
5)/dev/sda6, ext4 10) not installed (not recommended)
#? 1
Recovery will begin immediately. Continue? (Y/n)
Y
......
Enter a new host name. If this parameter is left blank, the old host name is used.
Old Host Name: ubuntu-laptop
New Host Name:
Billbear-pc
Change User Name ubuntu? (Y/n)
Y
New User Name:
Billbear
Do you want to change the user billbear password? (Y/n)
Y
Enter a new UNIX Password:
Enter a new UNIX Password:
Passwd: the password is successfully updated.
If the password change is unsuccessful, you still have a chance. Do you want to change the user billbear password again? (Y/n)
N
Done :)
Ubuntu @ ubuntu :~ $
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.