LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-05-2007, 02:39 PM   #1
phenrichs
LQ Newbie
 
Registered: Nov 2007
Location: Sioux Falls, South Dakota
Distribution: Hybrid / Vmware
Posts: 5

Rep: Reputation: 0
tar and bzip extract from CD


I am putting files on DVD/CD. I use tar with the bzip2 option to archive and compress the files. I then burn to the disc. When trying to extract directly from the disc I get an error from bzip2 stating that file system is read-only, which makes sense because the dvdrom drive is read-only.

What is the option / syntax to extract directly from the disc and redirect the output of the extraction to a specific folder?
 
Old 12-05-2007, 03:50 PM   #2
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by phenrichs View Post
...I get an error from bzip2 stating that file system is read-only, which makes sense because the dvdrom drive is read-only.
Are you running bzip2 while you are in a directory on the CD-ROM? If so, it may not work because bzip2 is trying to create a local temporary file. You should run bzip2 in a directory on your target filesystem.
 
Old 12-05-2007, 04:24 PM   #3
phenrichs
LQ Newbie
 
Registered: Nov 2007
Location: Sioux Falls, South Dakota
Distribution: Hybrid / Vmware
Posts: 5

Original Poster
Rep: Reputation: 0
Right, that makes sense. So how do I tell it where to put the files that it unzips. I tried tar -xvjf export.tar.bz2 /<path to desired directory> but this gives me a message that /<path> does not exist in archive.

It seems that I have the syntax off.

Oh and thanks in advance helping.
 
Old 12-05-2007, 06:12 PM   #4
LinuxCrayon
Member
 
Registered: Nov 2007
Location: Georgia, USA
Distribution: FreeBSD
Posts: 274

Rep: Reputation: 31
While I haven't tried with a removable media, this is what has worked for me to extract to a specific directory. Say 'file1.tar' exists in directory 'tarred/'. I want to extract its contents to directory 'untarred/'. Both folders are located in '/test'. So the absolute paths are '/test/tarred/' and '/test/untarred/', respectively.

Code:
cd /test/untarred/
tar xvf /test/tarred/file1.tar
Also, I could have used
Code:
cd /test/untarred/
tar xvf ../tarred/file1.tar
for the same result. Hope that helps!
 
Old 12-05-2007, 06:44 PM   #5
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
You can specify both the source and the output directories on the tar command line:
Code:
tar -xjf /path/to/file/tripwire/tripwire-2.4.1.2-src.tar.bz2 -C ~/tmp
The output of the above command ends up in ~/tmp/tripwire-2.4.1.2-src
 
  


Reply

Tags
bzip2, tar


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
backup: dump vs tar-bzip/gzip kpachopoulos Linux - General 2 12-21-2006 07:45 AM
can not extract the tar.gz file sharad durgawad Linux - Software 3 10-05-2005 03:41 AM
using tar to extract properly xushi Slackware 9 03-05-2005 10:10 AM
How to uninstall tar / bzip/bzip2 files........ emailssent Linux - Software 2 10-11-2004 02:11 AM
extract error tar.gz eye Linux - Software 6 05-18-2003 01:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration