Can't restore my deleted etc from tape

Hi
I recently deleted my /etc but I had a backup on tape. I was able to boot the server with a cd-rom and mounted the /c1t0d0s0 which is where the root directory resides. However when I tried to restore the backup with tar xvf /dev/rmt/0n I wasn't successful even though I was able to use the tar command to backup a file before trying to restore.
The messages I was getting were either it can't open file or the file was read only.
How can I restore the backed etc or what should I do to get the old etc back?

  • You can first check/test the archive with "tar -tvf /dev/yourtape".
  • Then check the output and verify the full paths to the files on tape.
  • if the filepath is /etc/yourfiles you can restore from anywhere, if it is etc/yourfiles (notice, no leading slash) then you should restore from the read-write mounted location of the original root filesystem.
  • read-only could mean that you are still sitting in the path where the cdrom is (ofcourse) read-only mounted
1 Like

You should copy archive at another path, where you have rights to write. Cause command "tar" by default, try to create extraction folder in the same path - where is archive.