Restore from a read-only mounted source

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Restore from a read-only mounted source

Wolfgang Dautermann
Hello List,

I am relatively new to rdiff-backup. I make backups from a backup-server
using ssh-keys and the command:
rdiff-backup root@hostname::/home/username /backups/home-username

That seems to work (unattended).

To provide easy restores (especially when I am not here), I NFS-mount
/backups/home-username to the computer of my colleges, so that one can
just copy the most recent backup of a file. Ok.

But it is not possible to mount the Backup-space read-only?

Neither a restore using "rdiff-backup -r" works (because rdiff-backup
wants to write some logfiles), not even "rdiff-backup --list-increments"
works, because the program wants to write some temporary files
(rdiff-backup-data/rdiff-backup.tmp.0)?

Yes, I found a mail on the list-archive about that read-only-problem:
http://lists.gnu.org/archive/html/rdiff-backup-users/2002-09/msg00008.html

But I would consider it a rather important feature. Otherwise users
might just _MOVE_ out (instead of copying!) files from the NFS-mounted
backup-space and make the whole backup unusable. They might delete some
files there, overwrite files there, ...)

Is there a possibility to force rdiff-backup to:
- write the temporary files somewhere else
- do not write Restore-logs or write them somewhere else?

so that one can NFS-mount the backup-space Read-only? If not: consider
that mail a a feature-request. ;-)

Bye, Wolfgang


--
FH JOANNEUM / Fahrzeugtechnik
Automotive Engineering & Railway Engineering
Austria, 8010 Graz, Alte Poststrasse 149, Tel: ++43/(0)316/5453-8418
http://www.fh-joanneum.at/fzt/


_______________________________________________
rdiff-backup-users mailing list at [hidden email]
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki
Reply | Threaded
Open this post in threaded view
|

Re: Restore from a read-only mounted source

Ben Escoto
>>>>> Wolfgang Dautermann <[hidden email]>
>>>>> wrote the following on Wed, 18 Jan 2006 11:31:53 +0100

> But it is not possible to mount the Backup-space read-only?
>
> Neither a restore using "rdiff-backup -r" works (because rdiff-backup
> wants to write some logfiles), not even "rdiff-backup --list-increments"
> works, because the program wants to write some temporary files
> (rdiff-backup-data/rdiff-backup.tmp.0)?

Hmm, this should work (and did at one point, but there aren't any
read-only tests in the suite, so it could have easily gotten broken).
What errors are you getting?  The logfile error was fixed so
rdiff-backup would continue without logging if it couldn't write a log.
(At least that is my recollection.)


--
Ben Escoto

_______________________________________________
rdiff-backup-users mailing list at [hidden email]
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Restore from a read-only mounted source

Wolfgang Dautermann
Ben Escoto wrote:
> Hmm, this should work

Yes would be fine. Even in the manpage one can read "Note that you
should not write to the mirror directory except with rdiff-backup." -
and mounting the backup-space read-only would help to ensure that...

> What errors are you getting?

/mnt is mounted read-only, in /mnt/home-daute is my backup:

If I want to see, which backups are available:

$ rdiff-backup -V
rdiff-backup 1.0.4

$ rdiff-backup --list-increments /mnt/home-daute
Traceback (most recent call last):
   File "/usr/local/bin/rdiff-backup", line 23, in ?
     rdiff_backup.Main.Main(sys.argv[1:])
   File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
285, in Main
     take_action(rps)
   File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
261, in take_action
     elif action == "list-increments": ListIncrements(rps[0])
   File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
680, in ListIncrements
     rp = require_root_set(rp)
   File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
700, in require_root_set
     single_set_fs_globals(Globals.rbdir)
   File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
722, in single_set_fs_globals
     rbdir, 1, Globals.chars_to_quote)
   File "/usr/lib/python2.3/site-packages/rdiff_backup/fs_abilities.py",
line 408, in get_fsabilities_readwrite
     return FSAbilities(desc_string).init_readwrite(
   File "/usr/lib/python2.3/site-packages/rdiff_backup/fs_abilities.py",
line 145, in init_readwrite
     subdir.mkdir()
   File "/usr/lib/python2.3/site-packages/rdiff_backup/rpath.py", line
796, in mkdir
     self.conn.os.mkdir(self.path)
OSError: [Errno 30] Read-only file system:
'/mnt/home-daute/rdiff-backup-data/rdiff-backup.tmp.0'



If I want to see, which Files were available yesterday:


$ rdiff-backup --list-at-time 2006-01-22 /mnt/home-daute/public_html/
Traceback (most recent call last):
   File "/usr/local/bin/rdiff-backup", line 23, in ?
     rdiff_backup.Main.Main(sys.argv[1:])
   File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
285, in Main
     take_action(rps)
   File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
259, in take_action
     elif action == "list-at-time": ListAtTime(rps[0])
   File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
815, in ListAtTime
     rp = require_root_set(rp)
   File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
700, in require_root_set
     single_set_fs_globals(Globals.rbdir)
   File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
722, in single_set_fs_globals
     rbdir, 1, Globals.chars_to_quote)
   File "/usr/lib/python2.3/site-packages/rdiff_backup/fs_abilities.py",
line 408, in get_fsabilities_readwrite
     return FSAbilities(desc_string).init_readwrite(
   File "/usr/lib/python2.3/site-packages/rdiff_backup/fs_abilities.py",
line 145, in init_readwrite
     subdir.mkdir()
   File "/usr/lib/python2.3/site-packages/rdiff_backup/rpath.py", line
796, in mkdir
     self.conn.os.mkdir(self.path)
OSError: [Errno 30] Read-only file system:
'/mnt/home-daute/rdiff-backup-data/rdiff-backup.tmp.0'

> The logfile error was fixed so
> rdiff-backup would continue without logging if it couldn't write a log.
> (At least that is my recollection.)

Hmm... Right. It gives a warning, but you are correct, the file is restored:

$ rdiff-backup -r 2006-01-22 /mnt/home-daute/test.txt /tmp/test.txt
Warning - Unable to open logfile: Unable to open logfile
/mnt/home-daute/rdiff-backup-data/restore.log: [Errno 30] Read-only file
system: '/mnt/home-daute/rdiff-backup-data/restore.log'

Bye, Wolfgang

--
FH JOANNEUM / Fahrzeugtechnik
Automotive Engineering & Railway Engineering
Austria, 8010 Graz, Alte Poststrasse 149, Tel: ++43/(0)316/5453-8418
http://www.fh-joanneum.at/fzt/


_______________________________________________
rdiff-backup-users mailing list at [hidden email]
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki
Reply | Threaded
Open this post in threaded view
|

Re: Restore from a read-only mounted source

Ben Escoto
>>>>> Wolfgang Dautermann <[hidden email]>
>>>>> wrote the following on Tue, 24 Jan 2006 09:32:57 +0100

> If I want to see, which backups are available:
>
> $ rdiff-backup --list-increments /mnt/home-daute
...
> OSError: [Errno 30] Read-only file system:
> '/mnt/home-daute/rdiff-backup-data/rdiff-backup.tmp.0'

This should be fixed in CVS now.  See the patches at:

http://cvs.savannah.nongnu.org/viewcvs/rdiff-backup/rdiff_backup/Main.py?root=rdiff-backup&r1=1.89.2.7&r2=1.89.2.8&makepatch=1&diff_format=u
http://cvs.savannah.nongnu.org/viewcvs/rdiff-backup/rdiff_backup/fs_abilities.py?root=rdiff-backup&r1=1.16.2.4&r2=1.16.2.5&makepatch=1&diff_format=u


--
Ben Escoto

_______________________________________________
rdiff-backup-users mailing list at [hidden email]
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki

attachment0 (196 bytes) Download Attachment