The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Data Protection' started by Islandhosting, Jul 7, 2016.

Tags:
  1. Islandhosting

    Islandhosting Member

    Joined:
    May 15, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    Twitter:
    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?
     
  2. Islandhosting

    Islandhosting Member

    Joined:
    May 15, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    Twitter:
    Although I'd still like to know the answer to my question, in the meantime I got it to work by using unionfs to mount a writable temp directory over top of the read-only file system.
     
  3. NOC_Serverpoint

    NOC_Serverpoint Active Member

    Joined:
    Jul 3, 2016
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Hello,

    Is fsck possible currently on the server? In case its possible, complete an fsck and proceed with fixing the issue further.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  5. Islandhosting

    Islandhosting Member

    Joined:
    May 15, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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)
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page