Tech Support > Operating Systems > Linux / Variants > Getting *everything* in a tar-file
Getting *everything* in a tar-file
Posted by Baard Ove Kopperud on March 6th, 2004


I *know* this is a newbie-question, but I ask
just to make sure I don't do this wrong...

I've badly miscalculated the size needed for
a distro I've installed, so now that partition
is *nearly* full. I need to repartisonate my
disk.

Instead of installing everything again, I was
toying with the idea of just putting everything
into a (compressed) tar-archive on another disk...

Problem is, although I use tar often, I'm not
*quite* sure which options need to be given
to get everything -- including device-special
files, sockets and symbolic-links...

I'm most unsure about symbolic-links (device-
and socket-files should be OK, right), I
want them to stay symbolic, and neither be
replaced by the files they points to nor removed.

-Koppe

Posted by Vilmos Soti on March 6th, 2004


baard.kopperud@bigfoot.com (Baard Ove Kopperud) writes:

Check if there is anything (good chance) installed and you can remove.

You still have to go through the partitioning and boot load installation
process. I would recommend it is easier to just reinstall the whole
thing.

Why not just create a small directory, put some sockets (mksock),
some pipes (mkfifo), devices (mknod), and soft/hard links. Then
you can play with it.

BTW symlinks are backed up symlinks, but AFAIK sockets are ignored.

Also, if you are tight on the other disk, then use bzip (j switch
for tar) since that compresses better (and slower) than gzip.

Vilmos

Posted by Sybren Stuvel on March 6th, 2004


["Followup-To:" header set to comp.os.linux.]
Baard Ove Kopperud enlightened us with:
If you *know* that, why don't you use Google to find your answer within
seconds?

Check out parted, it allows you to resize partitions non-destructively.

Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself?

Posted by mjt on March 6th, 2004


Baard Ove Kopperud wrote:

you can use 'parted' to resize it. or resize it yourself
[manually] - the tools used will depend on the filesystem
type you are using (ext2/3, reiserfs, etc).
..
--
<< http://michaeljtobler.homelinux.com/ >>
Experience is what causes a person to make
new mistakes instead of old ones.


Posted by Robert Nichols on March 6th, 2004


In article <ae685d1b.0403051727.5fdd930f@posting.google.com>,
Baard Ove Kopperud <baard.kopperud@bigfoot.com> wrote:
:I *know* this is a newbie-question, but I ask
:just to make sure I don't do this wrong...
:
:I've badly miscalculated the size needed for
:a distro I've installed, so now that partition
:is *nearly* full. I need to repartisonate my
:disk.
:
:Instead of installing everything again, I was
:toying with the idea of just putting everything
:into a (compressed) tar-archive on another disk...
:
:Problem is, although I use tar often, I'm not
:*quite* sure which options need to be given
:to get everything -- including device-special
:files, sockets and symbolic-links...

You don't want to include sockets. Those get created by running
programs and are meaningless once that program has terminated. Tar will
always skip sockets. Tar will include everything else by default. The
only option you might consider is "-S" (--sparse), which will prevent
any sparse files from being padded with zeros in the archive.

When you restore the files (as root), be sure to include the "-p" option
so that the current umask will be ignored when setting permissions on
the restored files.

--
Bob Nichols AT interaccess.com I am "rnichols"