Gentoo Archives: gentoo-user

From: Ian Graeme Hilt <ian.hilt@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] tar a brand new Gentoo install to a USB drive for safe keeping?
Date: Mon, 05 May 2008 04:04:49
Message-Id: 20080505040443.GA29986@sys-0.woh.rr.com
In Reply to: Re: [gentoo-user] tar a brand new Gentoo install to a USB drive for safe keeping? by Mark Knecht
1 On Sun, May 04, 2008 at 04:12:08PM -0700, Mark Knecht wrote:
2 > 1) I'm having trouble figuring how to best run tar. I end up with
3 > files at the wrong level every time so far.
4 >
5 > Assume I first mount a partition that's empty, and then mount a
6 > partition I want to save that contains a number of system directories
7 > - /, tmp, etc. lib, mnt and others:
8 >
9 > mount /dev/sda8 /mnt/gentoo [[ This is empty except for a mount
10 > point called TarPoint ]]
11 > cd /mnt/gentoo
12 > mount /dev/sda5 TarPoint [[ The partition I want to backup ]]
13 >
14 > Now I can see all my directories under TarPoint. What's the best way
15 > to run tar, creating a file called SYSTEM.tar.bz2 in /mnt/gentoo, so
16 > that later, when I have an empty partition on a different hard drive
17 > (hda) where I'm going to restore the system, I can do this
18 >
19 > mount /dev/hda11 /mnt/gentoo
20 > cd /mnt/gentoo
21 > scp mark@server:SYSTEM.tar.bz2 .
22 > tar xvfp SYSTEM.tar.bz2
23
24 To extract bzip2 files with tar, you need to add the "j" option.
25
26 > and I get the system directory hierarchy back again.
27 >
28 > 2) This laptop is a dual boot machine so the system clock is set to
29 > local when I'm in my Gentoo environment. When I drop into the install
30 > CD I presume it's set to UTC as is the standard. My question has to do
31 > with any requirements to setting time prior to making the tar ball or
32 > untarring to build the environment.
33 >
34 > What I'm seeing is that the command
35 >
36 > tar xcjf SYSTEM.tar.bz2
37
38 You have conflicting options there. To extract, use "x". To
39 create, use "c".
40
41 > generates lots of messages about file times being in the
42 > future. Maybe this won't matter if I use the backup later than
43 > 8 hours from the time I make it but in the short term will it
44 > cause any problems?
45
46 Any problems? Probably. They may be inconsequential though.
47 Follow the instructions below for a possible solution to your
48 problem.
49
50 First, make sure your time is set correctly under UTC with the
51 date command. For help with it,
52 <http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=5>
53
54 Then, you might try setting the TZ variable in the shell
55 environment to the timezone in which the tar'ed files
56 resided. Afterwards, untar the tarball. Not sure how this will
57 work in an "install" environment.
58
59 --
60 Ian Graeme Hilt
61 ian.hilt (at) gmail.com
62 GnuPG key: 0x4AFC1EE3
63 --
64 gentoo-user@l.g.o mailing list

Replies

Subject Author
Re: [gentoo-user] tar a brand new Gentoo install to a USB drive for safe keeping? Neil Bothwick <neil@××××××××××.uk>