Andy,
Surprisingly I have followed you!!
IF the UID / GID are different how do I fix it? I like to know these
things in advance.
I shall indeed keep a BU.
I have also discovered that if I take a simple copy of the
mozilla-thunderbird folder, and copy it to my windows machine, I can
change Thunderbird on Windows to read those folders. SO even if I make
a pig's ear of the whole thing - a high probability (!) my email is safe!!
Ed
Andy Smith wrote:
Hi Edward,
On Sun, Jul 01, 2007 at 06:10:19PM +0100, Edward Kerr wrote:
Hi Andy,
Thanks for replying.
I dropped to command line and
cd /mnt
mkdir edstemp
and got a Permission denied
..because you're still doing it as a normal user, not root. Your
computer is a multi-user system; normal users cannot simply write
files anywhere they like. Use sudo to do things as root:
$ sudo mkdir /mnt/tmphome
assuming your new home partition is /dev/sda2:
$ sudo mount /dev/sda2 /mnt/tmphome
copy entirety of current /home to what will be the new /home:
$ (cd /home && tar pcf - .) | (cd /mnt/tmphome && tar pxvf -)
then when you reinstall you can tell it to use /dev/sda2 as /home.
I would be grateful if you could explain the command line
$ (cd /home && sudo tar pcf - .) | (cd /mnt/tmp && sudo tar
Are there two commands here?
Yes, two subshells one piping into the other:
change directory to /home then use "tar" to archive the current
directory to standard output, preserving permissions:
(cd /home && sudo tar pcf - .) |
the output of the above is piped through the other subshell which
changes directory to /mnt/tmp and reads a tar-format archive from
its standard input, extracting it and preserving permissions, doing
so verbosely so you see what it is doing:
(cd /mnt/tmp && sudo tar pxvf -)
I worked out that you are tarring up the whole of my home directory then
untarring it in the /mnt/tmp directory
This makes sense, but will Ubuntu then sort out permissions etc. on
install if I tell it that sda2 is to be /home
The permissions and ownership are stored in the inode which to
simply explain is part of the file contents, so you can take them to
any system capable of mounting that filesystem properly and they
will be the same.
The only gotcha is that the owner and group of all files/directories
is stored as a number and that number is looked up in /etc/passwd
and /etc/group. You can see your current uid/gid numbers by typing
"id":
$ id
uid=1000(andy) gid=1000(andy)
groups=4(adm),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),109(lpadmin),111(scanner),113(admin),114(fuse),1000(andy)
so if a file had uid 1000 and gid 1000 then it will show as
andy:andy.
Whe you reinstall it is possible that your new users won't have the
same uid/gid as the old ones so they would show as all owned by
someone else, or by a nonexistent user. It is easy to fix, and/or
you could also take a copy of /etc/passwd and /etc/group to refer
to. Overall, the best thing to do is keep a backup of the files
around as the files (provided you do the tar or whatever correctly)
will retain all the info you need.
Cheers,
Andy
------------------------------------------------------------------------
_______________________________________________
Peterboro mailing list
[email protected]
https://mailman.lug.org.uk/mailman/listinfo/peterboro
_______________________________________________
Peterboro mailing list
[email protected]
https://mailman.lug.org.uk/mailman/listinfo/peterboro