Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

After some trial and error, I've managed to backup my Ubuntu 10.04 workstation and it's time for my Laptop. It also runs 10.04, but has an encrypted /home folder.

Running the below snippet as root clearly doesn't work well with encryption, so how should I do this?

sudo -i
cd /
tar -cvpzf sysbackup-20110821.tar.gz \
    --exclude=/sysbackup-20110821.tar.gz \
    --exclude=/proc \
    --exclude=/lost+found \
    --exclude=/sys \
    --exclude=/mnt \
    --exclude=/media \
    --exclude=/dev /
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

From the ecryptfs man page, try to mount it somewhere as a regular folder, and then execute your tar command.

sudo -i
mkdir /mnt/usermount 2>/dev/null
cd /
mount -t ecryptfs /home/user /mnt/usermount -o passwd=<your_pass_phrase> no_sig_cache
tar -cvpzf sysbackup-20110821.tar.gz \
  --exclude=/sysbackup-20110821.tar.gz \
  --exclude=/proc \
  --exclude=/lost+found \
  --exclude=/sys \
  --exclude=/media \
  --exclude=/dev /
umount /mnt/usermount
rm -rf /mnt/usermount

Note above that I removed the --exclude /mnt and also created the directory /mnt/usermount just in case you don't have it.

share|improve this answer
    
What a -o mount option without arguments is supposed to do? I think you messed-up mount command line. –  enzotib Aug 22 '11 at 21:56
    
Thanks, @enzotib - corrected now –  Sudipta Chatterjee Aug 22 '11 at 22:46
    
Again, I suppose no spaces are allowed in -o arguments. Generally you find them separated by commas without spaces, like for exampe -o defaults,noatime,umask=0022 –  enzotib Aug 23 '11 at 6:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.