Menu

Can't copy full "/" backup to SAMBA Win 7 client

Todd K.
2015-04-06
2015-04-13
  • Todd K.

    Todd K. - 2015-04-06

    I have been playing with LuckyBackup for a few days now and really like it. After some trial and error I can make a full back up "/" of my Xubuntu "server" OS (which is on a CF card) to an internal RAID1 array or to a USB stick. What I would like to do now, is copy the backup folder from the Linux RAID array to a hard drive on my Win 7 client. I have SAMBA set up and can see the backup folder from my Win 7 machine, but when I try to copy it, I get permission errors. Digging deeper, I noticed one of the first files that throws the error is "vmlinuz" that resides on the root (/) of the Linux machine and has permissions: Owner (root - RW), Group (root - None), Other (None). All my SAMBA clients are members of root group which is how I easily set permissions for them, but root group on these files has "None" permissions. I could chmod 775 permissions recursively to have access to these restricted files, but that would mess up the original permission structure which I do not want to do.

    So is there a way to store copies of a "/" backup and copy them back to a USB when a recovery is needed or am I stuck with keeping up with the original USB stick the backup was made on? The other incentive to do backups on a local drive then copy to a client drive is the time...3 minutes on a local drive for a full backup .vs. 24 minutes to a USB stick.

    Thanks,

    Todd K.

     
  • Loukas Avgeriou

    Loukas Avgeriou - 2015-04-06

    Hi Todd,

    (for a start) there are 2 issues we have to look into here:

    1.Read/write permission of the user that runs luckybackup and the user that connects to samba.
    He/She has to be able to read from the source and read/write/chown to the destination.
    Normally, to backup the / directory of a ditribution and keep all attributes the same at the destination LB has to be run by user root (super-user):
    http://luckybackup.sourceforge.net/manual.html#waysMenu

    2.should you wish to preserve the attributes of files (owner, permissions, ACL etc) at the destination, its (the destination's) filesystem has to support the same data attributes as the source.
    Note that NTFS/FAT filesystems do not support all of ext3/ext4 attributes.
    To make a long story short, it may be Ok to backup documents or photos that we don't care about ownership (and some other stuff) from ext to ntfs but backing up the / directory to NTFS is not possible if we want a usable backup.

    If you let me know of some examples of the error messages (or even send me the whole logfile) I could provide more advice on what the issue is here.

    PS Just for my information, could you let me know of what have you excluded from the / backup that you have already accomplished?

     
  • Todd K.

    Todd K. - 2015-04-07

    Thanks Loukas,

    Here is some more info.

    1. I was running LB in super user mode. I had to to make the complete backup. I tried changing the Win 7 client user type to Administrator on the Linux machine to no avail.

    2. Would I gain anything by adding a ext4 partition to my Win 7 machine? Then I have a different problem of getting Win 7 to see it, right?

    Error messages from Win 7 client when attempting copy from SAMBA share.
    ((File Access Denied
    You need permissions to perform this action
    You require permission from the computers administrator to make changes to this file.))

    This seems to be indicating a chmod 777 or something is needed, which I do not want to do.

    Error message from Linux when attempting to tar.gz the backup contents using GUI Archive Manager:
    ((An error occurred while adding files to the archive. Permission denied))

    I tried GUI archiving the individual folders of the backup. The following folders threw the error (boot,etc,root,usr, and var)

    I was able to successfully tar.gz the backup folder using command line. Something like "tar cvpzf..." I tried to extract some files i.e. "vmlinuz" using the GUI Archive Manager and it changed the permissions. I did not try the command line extract "tar xvpzf..." though I feel it would work OK with the permissions.

    I think getting a tar.gz of the backup is workable solution to my problem. What I really want is GUI archiver that can handle permissions and such. Any suggestions welcome.

    PS I had to at least exclude "System mount folders" and "System folders" to get the backup to complete without errors. I also tried it excluding everything in the Exclude Templates. Neither backup would copy to Win 7 client or archive with GUI Archive Manger.

    Thanks,

    Todd K.

     
  • Todd K.

    Todd K. - 2015-04-09

    Update. This really not about LB anymore. Its more about my lack of understanding of all things Linux. I was only born into the Linux world about a month ago, but learning fast.

    Since I was able to tar.gz the backup using the command line (and then copy it to the Win 7 client), I knew this was something about my knowledge of starting a graphical file manager as root. I just figured it out (alt-F2, gksu thunar). Thunar?...who knew? I kept entering "gksu File Manager". I have one remaining issue where checking "System folders" in the Exclude tab DOES NOT exclude var/run like the pop-up says it should. This folder is still throwing a Permission Denied error when I try to tar.gz it with Thunar as root. I can do it if I run "gksu file-roller" as root, but the interface with file-roller is not as smooth as thunar.

     
  • Loukas Avgeriou

    Loukas Avgeriou - 2015-04-13

    please excuse my late reply Todd.

    ...and welcome to the opensource community :)
    I (and many others) am here to help as much as I can within the limits of my knowledge.

    ...a little theory:
    As you might have already understood ownership and permisions are very important attributes to linux's system files (and not only) and they should be preserved as is if you want a useable backup.

    It is possible for tar to preserve these attributes inside the tarball as well as when uncompressing.

    Have in mind that fully restoring from scratch from a file-based system backup is not always as straightforward as restoring a folder of eg photos. You have to:
    a. Restore the files (probably by using a live distro or a distro installed to a different partition)
    b. Make sure everything (partition's uuids etc) in the /etc/fstab file will be correct.
    c. Install a bootloader
    The above are general (and not detailed) guidelines.

    Also, never forget to be EXTRA careful when running a graphical file manager as root.
    If you feel comfortable with the terminal, I would suggest to run the tar command from command line as root (as super user - eg by using "sudo").
    Just remember to always understand what you are typing (commands and arguments) and not just copy and paste commands.

    I hope I did not confuse you more with all the above.
    If something is not clear enough or you need further details or for any reason do not hesitate to ask.


    As far as the back up of the run directory is concerned, you are partly correct. If you check the "system folders" exclude template, the actual pattern used is

    /run/**
    

    which means "exclude the contents of directory "/run".
    should you want the directory /run as well, add a "user defined" exclude item as follows:

    /run/***
    
     
  • Todd K.

    Todd K. - 2015-04-13

    Loukas,

    Thanks for the help...again. Now worries about the tardiness. We all have lives outside of cyberworld.

    I found your post here: https://sourceforge.net/p/luckybackup/discussion/873564/thread/8c8e3902/ when I was initially researching backup operations, as such realized there was more to full restore than just copying back files.

    I have to admit, that in the end, I have decided not to "buy" your product for a full backup solution and instead go with Clonezilla which I have already been using for years for my Windows machines. That said, LB is still in the running as a scheduled data backup solution.

    Folks like you make the seemingly arduous task of learning Linux easier.

    Cheers for that!

    Todd K.

     

Log in to post a comment.