Results 1 to 7 of 7

Thread: Backups

  1. #1
    Join Date
    Oct 2009
    Location
    New Zealand
    Posts
    36

    Default Backups

    Hi all,

    How does everyone backup their data, ie /home ??

    By that I don't mean what program do you use, but what method do you use?

    Specifically maintaining permissions etc.

    I have a problem whereby I had an old computer I was running 11.1 on, and I got a newer computer to put 11.2 on. All I did was copy my documents, pictures etc onto a usb stick and then copied them back onto my new computer. However I have a lot of problems with permissions, eg saying I do not have write permissions for this folder or file or whatever. I have been able to get around by using chmod command on the specific files.

    Is there another way perhaps I should have backed up my files that will maintain permissions. Or is it simply because I have restored them to a different computer with a different user name / computer name ?

    What is a good simple method of backing up data to say a usb stick or perhaps CD/DVD ? Is K3B data project a good way and will it maintain permissions etc if I restore from it?

    Thanks in advance.

  2. #2
    mike_9137 NNTP User

    Default Re: Backups

    doing a file copy should work fine. The problem you may be having is that the uid of the user on the new computer you copied the files to is different then the old computer. Even if the user names are the same the file permissions are based on the uid not the name of the user. try doing a su to root then chown on all the files in the directory you copied the files to. be careful not to do a chown from the root directory many things will break if root is not the owner of the files.

  3. #3
    Join Date
    Aug 2008
    Location
    San Antonio Texas
    Posts
    124

    Default Re: Backups

    tar and gzipped

  4. #4
    Join Date
    Mar 2009
    Location
    London
    Posts
    426

    Default Re: Backups

    Hi,

    I think that method should work fine, I normally copy the files in /home to a CD when I upgrade.

    Quote Originally Posted by pv1962osl View Post
    is it simply because I have restored them to a different computer with a different user name ?
    Correct.

    You could use
    Code:
    chown
    , which changes the owner of the file, instead of
    Code:
    chmod
    , which changes the permissions of the file.


    Regards,
    Barry.
    Desktop: openSUSE 11.3 (x86) LXDE
    Laptop: Arch Linux (x86_64) GNOME 3

  5. #5
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,454

    Default Re: Backups

    Use mysqldump to copy the mysql databases to a folder in /home/user, then, as user, copy everything to DVD - no permissions problems if copying done as user (obviously, mysql permissions have to be used to make the mysqldump copy to /home/user).

  6. #6
    Join Date
    Oct 2009
    Location
    New Zealand
    Posts
    36

    Default Re: Backups

    Thanks guys. Barry I actually did use chown not chmod (that was my mistake/typo).

    So just to clarify, I can just copy my files to a CD/DVD using K3B and there wont be any problem.
    What about if I want to exchange some files between 2 openSUSE boxes, or between my openSUSE box and a windows box or vise versa? Are there any complications there with file ownership/permissions?

    Someone tells me they cpio their files before copying off to media, any advantage to that?

    Thanks again.

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,401

    Default Re: Backups

    Quote Originally Posted by pv1962osl View Post
    Thanks guys. Barry I actually did use chown not chmod (that was my mistake/typo).

    So just to clarify, I can just copy my files to a CD/DVD using K3B and there wont be any problem.
    What about if I want to exchange some files between 2 openSUSE boxes, or between my openSUSE box and a windows box or vise versa? Are there any complications there with file ownership/permissions?

    Someone tells me they cpio their files before copying off to media, any advantage to that?

    Thanks again.
    First think over the difference of a user copying files (for himself for whatever reason, transport, backup) and of the system manager (root) doing these things (mostly for backup, but also for e.g. transferring data to a newly installed system where this is done for all the users of the system).
    This is just to make you aware of the different roles one has on a Unix/Linux system and the influence that may have on what and how to do things (e.g. tar behaves differently for a normal user and for root exactly for this reason). And cpio also has the same sort of mechanism, having options about preserving ownership and behaving differently for root.

    When you, as end-user, copy files to a removable medium it depends on the fs-type on that medium what is on it concerning ownership and access bits, etc. When a native Linux fs -type (like ext3) is used this is of no concern.
    The ownership on a Unix/Linux fs is by uid and gid. These are the numbers as found in /etc/passwd and /etc/group. Not the username and groupnames that are mostly presented to you by tools (like CLI ls and GUI file managers) for of obvious reasons. But on another system uid 1002 may not be the same user as on your system. That means that when you mount your removable medium on that other system, all the files are then owned by the user with uid 1002. Not by you (you even may not have a uid on that other system at all).

    The same effect often happens when tarballs are expanded on another system, uids and gids are those as on the tar creating system.

    Thus, when you have more then one system in say you home LAN, it is always better to have unique uids for the whole bunch of systems.
    Henk van Velden

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •