Gentoo Archives: gentoo-user

From: Mark Knecht <markknecht@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] tar a brand new Gentoo install to a USB drive for safe keeping?
Date: Sun, 04 May 2008 01:06:19
Message-Id: 5bdc1c8b0805031806k7a14e6d3v910c0957bd514e98@mail.gmail.com
1 I've never done this before so it seems like right now would be a
2 great time to learn. Thanks in advance.
3
4 I've just done this installation on my laptop. For the most part it's
5 working fine. Still a few things to iron out but it's good enough that
6 I'd like to save the state of the machine so that should something
7 happen I have a way to restore where I am today. Since the disk usage
8 is currently about 4GB it seems like a great time to do it. Is this
9 possible? I think it's essentially what the stage 3 file is that I use
10 when I install, isn't it? If I can keep the whole thing under 5GB then
11 I can write it on a DVD and I'm in a really safe space for a fast
12 reinstall if something happens.
13
14 From the running system here's what things look like right now:
15
16 laptop1 ~ # df
17 Filesystem 1K-blocks Used Available Use% Mounted on
18 /dev/sda5 15820524 3641240 11375636 25% /
19 udev 10240 172 10068 2% /dev
20 /dev/sda6 1320272 189304 1063900 16% /var
21 /dev/sda7 10278304 312012 9444184 4% /home
22 shm 1003844 0 1003844 0% /dev/shm
23 laptop1 ~ #
24
25 My thought is to boot using the install CD, mount a USB drive at
26 /mnt/gentoo, then create a mount point 'backup' on the USB drive to
27 mount each of the 3 partitions I want to back up one at a time. ( /,
28 /var and /home) Then I'll mount each partition by itself and use tar
29 to create a single file for each partition where that file gets
30 written on the USB drive. When I'm done I have 3 files.
31
32 Restore would be to create the partitions anew, untar, install grub
33 from in the chroot, and reboot.
34
35 Is this a reasonable way to go? Is there something easier? (That seems
36 pretty easy to me...)
37
38 I don't want to create images of the partitions because I might want
39 to put the data onto a different drive or in a different
40 configuration. (Like no /var or something.)
41
42 If this makes sense then what commands would I want to use to do this
43 correctly. Presumably it needs to tar up links, file system
44 permissions, and everything else. Since the Quick Install guide uses
45
46 tar xjpf stage3*
47
48 to extract the main directories & files, and assuming the USB drive is
49 sdb1, would I just use
50
51 mount /dev/sdb1 /mnt/gentoo
52 mount /dev/sda5 /mnt/gentoo/backup
53 tar cjfp ./ROOT.tar.bz2 backup
54
55 and then repeat for the other two partitions? Or is there more to it?
56
57 I'm rambling here so I'll hope for a quick answer and then give it a try.
58
59 Thanks in advance,
60 Mark
61 --
62 gentoo-user@l.g.o mailing list

Replies