Mailinglist Archive: opensuse (4749 mails)

< Previous Next >
Re: [SLE] cpio and tar
  • From: Anders Karlsson <anders@xxxxxxxxxxxx>
  • Date: 29 May 2003 13:58:32 +0100
  • Message-id: <1054213112.2138.34.camel@xxxxxxxxxxxxxxxx>
On Thu, 2003-05-29 at 13:34, John Murphy wrote:
> On Thursday 29 May 2003 06:54, Anders Karlsson wrote:
> >
> > /home is getting full, you have a new partition ready. mounted on /mnt
> > where all the data is being copied to.
> >
> > cd /home ; find . | cpio -pdumvB /mnt
> >
> > When command completes, you have a perfect copy of /home in /mnt.
> I kept telling myslef for weeks I need to look into this and seen this thread.
> I have a XP/Suse machine with a partition on the XP drive formatted fat32.
> The fat32 partition is what I use to backup linux and exchange files with XP.
> I tried your example above and it still changes the permission on the files.

I assume you copied the files into somewhere on the fat32 partition?
Fat32 file system does not support unix file permissions so your files
will lose their permissions if you do that. (If I am wrong here, people
will correct me. :)

> No matter where you go outside of Suse, CD's or other drives it changes the
> permissions.

CD's use a different file system again, they do not use file permissions
like normal unix file system does.

> I was going to look into finding something that would do a
> backup for me of /home and /etc. Thought I would ask the best approach to
> take to be sure my data was there when I needed it.

You can then instead of copying the files, create a cpio archive.

cd / ; find ./home | cpio -o > /mnt/c/home.cpio

To create gzipped archive:

cd / ; find ./home | cpio -o | gzip -9 > /mnt/c/home.cpio.gz

To read/verify the archive back:

cd / ; cpio -idumvBt < /mnt/c/home.cpio

To read/verify the gzipped archive back:

cd / ; zcat /mnt/c/home.cpio.gz | cpio -idumvBt

To extract, just remove the 't' flag from cpio's options.


Anders Karlsson <anders@xxxxxxxxxxxx>
Trudheim Technology Limited
< Previous Next >
Follow Ups