Gentoo Archives: gentoo-user

From: Mark Knecht <markknecht@×××××.com>
To: Gentoo User <gentoo-user@l.g.o>
Subject: [gentoo-user] Clone live system as a simple backup?
Date: Tue, 06 Mar 2012 19:52:47
Message-Id: CAK2H+eeOa2Y_ysHGgkQpxxfY9uw0VC2Dte_DWThSBDn9YP8a5Q@mail.gmail.com
1 Hi,
2 I'm interested in the idea of cloning a live, complicated hardware
3 system onto a single external hard drive as a simple backup. I would
4 like this external drive to be completely bootable. What's the best
5 way to approach doing this? I was considering just doing a Gentoo
6 install from scratch but figured maybe there's a way to clone enough
7 of the live system to get me there less painfully?
8
9 The system I'm playing with has five 500MB hard drives with most
10 partitions in linked together in various forms of RAID. (1, 5 & 6)
11 That said, the total storage that this system presents KDE and the
12 users is about 600GB.
13
14 I have an external 1TB eSATA drive which is therefore large enough
15 to hold everything on this system, albeit without the reliability of
16 RAID which is fine for this purpose.
17
18 The system looks more or less like:
19
20 /dev/sda1 -> /boot (50MB)
21 /dev/sdb1 -> /boot copy
22 /dev/sdc1 -> /boot copy
23
24 c2stable ~ # df
25 Filesystem 1K-blocks Used Available Use% Mounted on
26 rootfs 51612920 31862844 17128276 66% /
27 /dev/root 51612920 31862844 17128276 66% /
28 rc-svcdir 1024 92 932 9% /lib64/rc/init.d
29 udev 10240 476 9764 5% /dev
30 shm 6151284 0 6151284 0% /dev/shm
31 /dev/md7 389183252 350247628 19166232 95% /VirtualMachines
32 tmpfs 8388608 0 8388608 0% /var/tmp/portage
33 /dev/sda1 54416 29516 22091 58% /boot
34 c2stable ~ # cat /proc/mdstat
35 Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5]
36 [raid4]
37 md6 : active raid5 sdb6[1] sdc6[2] sda6[0]
38 494833664 blocks super 1.1 level 5, 64k chunk, algorithm 2 [3/3]
39 [UUU]
40
41 md7 : active raid6 sdb7[1] sdc7[2] sda7[0] sdd2[3] sde2[4]
42 395387904 blocks super 1.2 level 6, 16k chunk, algorithm 2 [5/5] [UUUUU]
43
44 md3 : active raid6 sdb3[1] sdc3[2] sda3[0] sdd3[3] sde3[4]
45 157305168 blocks super 1.2 level 6, 16k chunk, algorithm 2 [5/5] [UUUUU]
46
47 md126 : active raid1 sdc5[2] sda5[0] sdb5[1]
48 52436032 blocks [3/3] [UUU]
49
50 unused devices: <none>
51 c2stable ~ #
52
53 /dev/md3 is a second Gentoo installation that doesn't need to be
54 backed up at this time. md6 is an internal RAID used to back up md7
55 daily. It doesn't need to be backed up, but if the machine totally
56 failed killing all the drives that wouldn't survive so currently I
57 back up md126 to md6 daily, and then back up md6 weekly to an external
58 eSATA drive.
59
60 What I'd like to do is clone
61
62 1) /boot (sda1) including grub and everything required to make it bootable
63 2) back up the system portions of dev/md126 (/ )
64 3) Add some swap space on the external drive
65 4) back up /dev/md7 which is all of my VMs
66 5) back up /home to a separate partition on the external drive
67 6) back up some special things like /var/lib/portage/world and
68 /usr/portage/packages
69
70 My thought is that this drive is basically bootable, but over time
71 gets out-of-sync with the system. However should the system fail I've
72 got a bootable external drive with all the binary packages required to
73 get it running again quickly. However I can always boot the drive, do
74 an emerge -ek @world, and basically be back to where I am as of the
75 last backup.
76
77 The external drive will look something like:
78
79 /dev/sdg1 -> /boot
80 /dev/sdg2 -> swap
81 /dev/sdg3 -> / (not including /home, /usr/portage/distfiles, etc)
82 /dev/sdg5 -> /usr/portage/packages
83 /dev/sdg6 -> /dev/md7
84
85 etc....
86
87 I will of course have to modify grub.conf and /etc/fstab to work
88 from this drive but that's no big deal.
89
90 What are folks best ideas about how to approach doing something like this?
91
92 Thanks,
93 Mark

Replies

Subject Author
Re: [gentoo-user] Clone live system as a simple backup? gandalf@××××××××××.uk
Re: [gentoo-user] Clone live system as a simple backup? Brian Wiborg <baccenfutter@××××××.org>