1 |
This is to backup my laptop from boot cdrom - how does it look? |
2 |
|
3 |
File systems; |
4 |
/dev/sda1 - /boot |
5 |
/dev/sda2 - swap |
6 |
/dev/sda3 - / |
7 |
|
8 |
So to backup; |
9 |
1. Get MBR (grub and partition table): dd if=/dev/sda |
10 |
of=/otherdisk/sda-mbr.bin bs=512 count=1 |
11 |
2. Get /boot: dd if=/dev/sda1 of=/otherdisk/sda1.bin |
12 |
3. Get /: dd if=/dev/sda3 | gzip | dd of=/otherdisk/sda3.bin.gz |
13 |
|
14 |
Then too restore onto new disk; |
15 |
1. Restore MBR: dd if=/otherdisk/sda-mbr.bin of=/dev/sda |
16 |
- no bs or count parameters required? |
17 |
2. Restore /boot: dd if=/otherdisk/sda1.bin of=/dev/sda1 |
18 |
3. Restore /: dd if=/otherdisk/sda3.bin.gz | gunzip | dd of=/dev/sda3 |
19 |
4. Setup swap partition: mkswap /dev/sda2 |
20 |
5. Boot system |
21 |
|
22 |
Caveat is the the new disk must be big enough to fit sda1/2/3. |