FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 05-05-2008, 04:04 AM
Ian Graeme Hilt
 
Default tar a brand new Gentoo install to a USB drive for safe keeping?

On Sun, May 04, 2008 at 04:12:08PM -0700, Mark Knecht wrote:
> 1) I'm having trouble figuring how to best run tar. I end up with
> files at the wrong level every time so far.
>
> Assume I first mount a partition that's empty, and then mount a
> partition I want to save that contains a number of system directories
> - /, tmp, etc. lib, mnt and others:
>
> mount /dev/sda8 /mnt/gentoo [[ This is empty except for a mount
> point called TarPoint ]]
> cd /mnt/gentoo
> mount /dev/sda5 TarPoint [[ The partition I want to backup ]]
>
> Now I can see all my directories under TarPoint. What's the best way
> to run tar, creating a file called SYSTEM.tar.bz2 in /mnt/gentoo, so
> that later, when I have an empty partition on a different hard drive
> (hda) where I'm going to restore the system, I can do this
>
> mount /dev/hda11 /mnt/gentoo
> cd /mnt/gentoo
> scp mark@server:SYSTEM.tar.bz2 .
> tar xvfp SYSTEM.tar.bz2

To extract bzip2 files with tar, you need to add the "j" option.

> and I get the system directory hierarchy back again.
>
> 2) This laptop is a dual boot machine so the system clock is set to
> local when I'm in my Gentoo environment. When I drop into the install
> CD I presume it's set to UTC as is the standard. My question has to do
> with any requirements to setting time prior to making the tar ball or
> untarring to build the environment.
>
> What I'm seeing is that the command
>
> tar xcjf SYSTEM.tar.bz2

You have conflicting options there. To extract, use "x". To
create, use "c".

> generates lots of messages about file times being in the
> future. Maybe this won't matter if I use the backup later than
> 8 hours from the time I make it but in the short term will it
> cause any problems?

Any problems? Probably. They may be inconsequential though.
Follow the instructions below for a possible solution to your
problem.

First, make sure your time is set correctly under UTC with the
date command. For help with it,
<http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=5>

Then, you might try setting the TZ variable in the shell
environment to the timezone in which the tar'ed files
resided. Afterwards, untar the tarball. Not sure how this will
work in an "install" environment.

--
Ian Graeme Hilt
ian.hilt (at) gmail.com
GnuPG key: 0x4AFC1EE3
--
gentoo-user@lists.gentoo.org mailing list
 
Old 05-05-2008, 12:17 PM
Ian Graeme Hilt
 
Default tar a brand new Gentoo install to a USB drive for safe keeping?

On Mon, May 05, 2008 at 09:37:49AM +0100, Neil Bothwick wrote:
> On Mon, 5 May 2008 00:04:44 -0400, Ian Graeme Hilt wrote:
>
> > > tar xvfp SYSTEM.tar.bz2
> >
> > To extract bzip2 files with tar, you need to add the "j" option.
>
> That hasn't been needed for a long time. Tar is able to detect bzip2 and
> gzip compression and handle it automatically.

You are correct. I didn't realize it could detect. Thanks for
the info.

--
Ian Graeme Hilt
ian.hilt (at) gmail.com
GnuPG key: 0x4AFC1EE3
--
gentoo-user@lists.gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 02:35 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org