restorepkg can't restore from a read-only file system

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,219
463
I'm trying to restore an incremental backup from a read-only file system (zfs snapshot) but restorepkg fails because it can't create temporary files.

Is there any way to tell restorepkg to create temporary files in a different location?
Hello,

It's not possible to restore an account to a read-only filesystem because the restore process requires writing files to the account's home directory.

Thank you.
 

Islandhosting

Member
May 15, 2015
23
4
53
Canada
cPanel Access Level
Root Administrator
Twitter
Thanks for the reply, but I'm not trying to restore *to* a read-only file system, I'm trying to restore *from* a read-only file system.

/home/USERNAME is on a normal, writable file system.

/backup/.zfs/snapshot/2016-07-10/accounts/USERNAME is an incremental backup that is on a read-only file system (we implement daily incrementals using ZFS snapshots).

The restorepkg command isn't having trouble writing to /home/USERNAME, the problem is that during the process it creates temporary files in the same location that the backup is located at (/backup/.zfs/snapshot/2016-07-10/accounts/USERNAME in this example). It shouldn't need to do that, since it's copying data anyway, it should be possible to use the *destination* for the temporary files, or even a different location entirely.

I was just hoping that there was an undocumented command line switch, or maybe an environment variable that could be set to tell it to use a specific path for temp files while restoring.

In any case, it's a non-issue now. Using unionfs does the trick and now our clients have daily incremental backups that go back months without using huge amounts of disk space (thanks to ZFS)