Page 3 of 3 FirstFirst 123
Results 21 to 25 of 25

Thread: Snapshot / Clone a Directory/Disk for Backup purposes

  1. #21
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Snapshot / Clone a Directory/Disk for Backup purposes

    On 2013-12-24 01:56, tsu2 wrote:
    >
    > robin_listas;2610907 Wrote:



    >> That will probably crash whatever app is accessing, and perhaps corrupt
    >> some files.
    >>
    >> The service "famd" can cause these symptoms.


    > Actually, I've found this not to be the case (corruption) if you're
    > absolutely certain nothing is accessing file in the mount.


    Absolutely certain is the key word... and the command "lsof" is the one to find out if it is or not.

    > One way to verify is to look at the disk activity light. If it hasn't
    > blinked in over a minute, it's unlikely anything is happening even on a
    > "busy" machine.


    Doesn't work on my machine. I have four internal disks, sharing the same light. It always blinks,
    the kernel writes every few seconds, something of the log flush don't know what. For external disks,
    yes, the light is trusty. But still, a file can be open with no activity, with pending
    modifications, and not flushed to disk. If you remove it, the file is lost.


    > At least for me, I experienced an app that apparently was poorly
    > written, leaving a thread or process connecting to the mount point even
    > when the app was closed... So I deemed it safe to forcibly unmount in my
    > case.


    Curious.

    > But I agree that you better be sure... Particularly if you're doing a
    > command line file operation. But from what I've seen I suspect that even
    > similar file operations likely are executed differently to ensure file
    > integrity (typically using temp files which are removed after the
    > operation has completed).


    I have recently seen that the famd daemon still has a long standing bug that keeps open a filesystem
    and impedes umounting it. Every time I mount an external NFS mount, I have to restart famd in order
    to umount it. Now I'm testing to find out if the daemon is needed at all, 13.1 seems not to start it
    by default, I don't have it installed here...

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" (Elessar))

  2. #22
    Join Date
    Feb 2010
    Location
    South Dakota, USA
    Posts
    171

    Default Re: Snapshot / Clone a Directory/Disk for Backup purposes

    Quote Originally Posted by tsu2 View Post
    It's possible you might have an app running that's still accessing the mount point. Or, an app can be faulty and not close completely and properly (terminating all related processes).
    I'm thinking of something along the lines of Akondai and/or Nepomuk, which I have been contemplating to remove these programs (I don't use the KOrganizer, etc.).

    If you're <absolutely sure> you have nothing that should be accessing the mount point, you can try "force umount" (see the help and man pages).

    TSU
    Thanks for the tip

    Cliff

  3. #23
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Snapshot / Clone a Directory/Disk for Backup purposes

    On 2013-12-24 05:36, Star Gazer wrote:
    >
    > tsu2;2610891 Wrote:
    >> It's possible you might have an app running that's still accessing the
    >> mount point. Or, an app can be faulty and not close completely and
    >> properly (terminating all related processes).

    >
    > I'm thinking of something along the lines of Akondai and/or Nepomuk,
    > which I have been contemplating to remove these programs (I don't use
    > the KOrganizer, etc.).


    Don't think! Find out!

    Just use 'lsof' on the mountpoint to find out.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" (Elessar))

  4. #24
    Join Date
    Feb 2010
    Location
    South Dakota, USA
    Posts
    171

    Default Re: Snapshot / Clone a Directory/Disk for Backup purposes

    Quote Originally Posted by robin_listas View Post
    On 2013-12-24 05:36, Star Gazer wrote:
    >
    > tsu2;2610891 Wrote:
    >> It's possible you might have an app running that's still accessing the
    >> mount point. Or, an app can be faulty and not close completely and
    >> properly (terminating all related processes).

    >
    > I'm thinking of something along the lines of Akondai and/or Nepomuk,
    > which I have been contemplating to remove these programs (I don't use
    > the KOrganizer, etc.).


    Don't think! Find out!

    Just use 'lsof' on the mountpoint to find out.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" (Elessar))
    I will; I was just hoping someone would give me the correct way of getting a read-only copy of my /home/username directory instead of the task of trying several different things before I could find out, if I find out, and to speed up things on the "knowledge" side. I know that if I use "mount", the -r option would be use, or -o=ro, but I don't know what other options to use, if any.

    As a side note, I did find out that 7z (provided by p7zip) restores the access times after archiving, but as I mentioned before in this thread, it does not store user/group names (or numeric IDs) with the files, and if extracted to a empty directory, does not restore the file permissions as they were when the files were archived.

    Thanks,
    Cliff

  5. #25
    Join Date
    Feb 2010
    Location
    South Dakota, USA
    Posts
    171

    Default Re: Snapshot / Clone a Directory/Disk for Backup purposes

    I got it now ...

    sudo mount --bind /home/${USER} /media/spare/snapshot/${USER}
    sudo mount -o remount,ro,bind /home/${USER} /media/spare/snapshot/${USER}

    In this example, /media/spare/snapshot/${USER} MUST exist first. Therefore, our read-only mount point, whatever we decide to use, must first exist.

    Of course, we can use our real user name instead of ${USER} if we want to.

    mount output snippet:
    [CODE/dev/sda7 on /media/spare/snapshot/(username) type ext3 (ro,relatime,data=journal)[/CODE]

    Then you can do a backup and the atimes and ctimes won't be changed;
    I verified this, as an example with the 'find -daystart -atime 0'
    Fortunately, I begin this backup a few minutes after midnight

    After the backup is done, do:
    sudo umount /media/spare/snapshot/${USER}

    I mentioned before I had a problem with the umount before ("filesystem is busy"), but this time with this method, the file system did unmount, and I verified that too.

    Thanks everybody! It's been a very educational thread

    Cliff

Page 3 of 3 FirstFirst 123

Tags for this Thread

Posting Permissions

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