FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 12-09-2009, 05:39 AM
Daniel Convissor
 
Default rsync backup of /home/.ecryptfs causes errors

Hi Folks:

I asked the following question at launchpad, but haven't received an
answer. Perhaps the folks here can help, please.

I am trying to use rsync to backup the /home/.ecryptfs in Ubuntu
9.10/Karmic, but doing so produces error messages for users who are
currently logged in. Considering this issue, how is one supposed to
cleanly backup .ecryptfs?

Here is the command I ran:

rsync -aH --delete /home/.ecryptfs /bk/rsync-home

And here is the output:

rsync: read errors mapping
"/home/.ecryptfs/ent/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWaWKXqVAx32y
...snipped for brevity on the mailing list... JjCVaJA8D.E-":
No data available (61)

rsync: read errors mapping
"/home/.ecryptfs/ent/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWaWKXqVAx32y
...snipped for brevity on the mailing list... JjCVaJA8D.E-":
No data available (61)

ERROR: .ecryptfs/ent/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWaWKXqVAx32y
...snipped for brevity on the mailing list... JjCVaJA8D.E-
failed verification -- update discarded.

rsync error: some files/attrs were not transferred (see previous errors)
(code 23) at main.c(1057)

Thanks,

--Dan

PS: Full text is on launchpad at
https://answers.launchpad.net/ubuntu/+source/ecryptfs-utils/+question/92115
I'll update the launchpad page if a good answer comes out of this.

--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-09-2009, 07:30 AM
James Taylor
 
Default rsync backup of /home/.ecryptfs causes errors

Daniel Convissor wrote:
> Hi Folks:
>
> I asked the following question at launchpad, but haven't received an
> answer. Perhaps the folks here can help, please.
>
> I am trying to use rsync to backup the /home/.ecryptfs in Ubuntu
> 9.10/Karmic, but doing so produces error messages for users who are
> currently logged in. Considering this issue, how is one supposed to
> cleanly backup .ecryptfs?

Well, surely the .ecryptfs file must be open and in use by the user that
is logged into that account, so even if these errors did not prevent you
from copying it, you would risk getting an inconsistent and thus
corrupted copy of the file if you succeeded in copying it while it was
in use, and likely lose everything it contained.

Inevitably, to take a consistent backup copy of the .ecryptfs file
you'll need to make sure the corresponding user is logged out. Is there
not a night time hour when you can be reasonably certain nobody is
logged in? Can you take the system to single user run level at the
scheduled hour to do the backups?

--
James Taylor


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-09-2009, 04:31 PM
Peter Humphrey
 
Default rsync backup of /home/.ecryptfs causes errors

On Wednesday 09 December 2009 08:30:10 James Taylor wrote:

> Inevitably, to take a consistent backup copy of the .ecryptfs file
> you'll need to make sure the corresponding user is logged out. Is there
> not a night time hour when you can be reasonably certain nobody is
> logged in? Can you take the system to single user run level at the
> scheduled hour to do the backups?

On my boxes I have a small rescue system in its own partition, which I use for
things like making backups. That guarantees that no files are open when
they're backed up.

Of course, these aren't mission-critical systems.

--
Rgds
Peter

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-09-2009, 06:43 PM
Daniel Convissor
 
Default rsync backup of /home/.ecryptfs causes errors

Hi James:

On Wed, Dec 09, 2009 at 03:30:10PM +0700, James Taylor wrote:
>
> Well, surely the .ecryptfs file must be open and in use by the user that
> is logged into that account, so even if these errors did not prevent you
> from copying it, you would risk getting an inconsistent and thus
> corrupted copy of the file if you succeeded in copying it while it was
> in use, and likely lose everything it contained.
>
> Inevitably, to take a consistent backup copy of the .ecryptfs file
> you'll need to make sure the corresponding user is logged out.

Exactly what I was thinking. I was looking for a clean/supported way of
handling all this. Below is what I came up with and my limited testing
has been positive. Note, this is my own system, so booting off "other"
users isn't a big deal. What do people think?

vvvvvvvvvvvvvvvv
#! /bin/bash

# Ensure encrypted and unencrypted versions of encrypted home
# directories don't jockey each other.
#
# First, loop through /home and check the status of each directory.
for dir in `ls -ad /home/*` ; do
user=${dir:6}
if [ -f $dir/Access-Your-Private-Data.desktop ] ; then
# This user's directory is not mounted at this time.
# Back it up.
rsync -aH --delete $dir /bk/rsync-home/$user
else
# This user's directory not encrypted at the moment, and...
if [ -d /home/.ecryptfs/$user ] ; then
# is usually encrypted. Kick them off and unmount their dir.
sync
killall -w -u $user
sync
umount /home/$user
sleep 3
sync
rsync -aH --delete $dir /bk/rsync-home/$user
else
# is ususally not encrypted. Back it up.
rsync -aH --delete $dir /bk/rsync-home/$user
fi
fi
done

# Second, back up the actual encrypted file system.
rsync -aH --delete /home/.ecryptfs /bk/rsync-home
^^^^^^^^^^^^^^^^

Thanks,

--Dan

--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 10:42 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org