0

I am trying to preform this command to tar /opt and move it to my usb with directory:

/media/usb-sdb1-1-7-1/

However I am getting an error

here is the command I am preforming:

tar czf /opt/opt.tar.gz /media/usb-sdb1-1-7-1/

here is the error

tar: Removing leading `/' from member names tar: /opt/opt.tar.gz:

Cannot open: Read-only file system tar: Error is not recoverable:

exiting now

I even tried with sudo but I got this error

sh: sudo: command not found
1
  • Are you trying to extract to archive?
    – UTF-8
    Oct 7, 2015 at 14:24

2 Answers 2

0

If you want to archive the /opt directory recursively and save that tar archive to your external USB-harddrive mounted on /media/usb-sdb1-1-7-1, use this:

tar -czvf /media/usb-sdb1-1-7-1/opt.tar.gz /opt/
0

Use tar -xzvf file.tar.gz "/media/usb-sdb1-1-7-1/" to extract the archive.

2
  • Whatever the OP wants, now he has both answers... =)
    – chaos
    Oct 7, 2015 at 14:27
  • @chaos Oops, I think yours is what he wants. He writes about it in the first line but it get unclearer in the remainder of his question.
    – UTF-8
    Oct 7, 2015 at 14:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .