[LBo] Moving Home
Anita Lewis
a.lewis at linuxbasics.org
Sun Mar 11 12:35:13 CET 2007
On 03/10/2007 10:46 PM J. Armstrong wrote:
> If you're backing up to a USB flash drive, don't copy the files directly;=
use tar to create an archive file preserving the permissions. =
> =
> sudo tar -zcSpf home.tar.gz /home
> =
> When you set up the new system, make sure the user has the same user and =
group IDs, or be prepared to chown/chmod as required.
> =
> To restore your data from the archive:
> =
> sudo tar -zxSpf home.tar.gz
> =
I'd say "Yes and No" on this, mostly "Yes." "Yes" because by default
USB flash drives are formatted as vfat. They come already formatted that
way. However if it has been reformatted as ext2 and 'cp -a' is used,
then permissions are preserved. So, the permission loss is not because
the drive is USB, but because it is formatted vfat. You will find this
same problem if you copy to your vfat Windows partition or floppy, and
this great solution will work there as well.
Most of us would not reformat our USB flash drives, though, because we
want to be able to have that data available on Linux or on another OS.
The problem I always have with tar, and it is a problem with *me* and
not actually with tar, is that I tend to untar it wrong. For example I
make a new partition for /home. I mount it as /home. Then I untar my
tarred /home directory into it and end up with /home inside the /home
directory.
Since I get this wrong almost always on the first try, perhaps someone
else would give the details on how to do this. I guess we can assume
that we are booted on the newly installed distro and the user is already
created and is at ~/ in his home directory. The tarball is on
/media/usbdrive/home.tar.gz. Assume that he has made /home into a
separate partition on /dev/hda6 and it is mounted if that matters. What
exactly does he do now?
Thanks, Anita
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://linuxbasics.org/pipermail/qna/attachments/20070311/b40bba15/si=
gnature.pgp
More information about the QnA
mailing list