LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Convert a TAR file to an ISO. (https://www.linuxquestions.org/questions/linux-software-2/convert-a-tar-file-to-an-iso-697828/)

BloodBlight 01-16-2009 07:02 PM

Convert a TAR file to an ISO.
 
This question has been asked before, but I’m not too sure on the answer.

What I have and why I want to do it.

I have a copy of FreeDB and I am looking to convert it into an SQL database. This is being done on a Windows platform, but I do have several Linux systems. I am going to write a program to read all of the files (several million of them), but I estimated that I will need about 80GBs of space to extract a 4.5GB tar file because of the file count & size. This will give my poor Windows server a fit (and make a mess of my FAT table at the same time).

To get around this, I am looking to convert the file to an ISO (another linear file system), and mount the ISO as a drive.

If I am unable to do this, I will try to write in some support for the TAR format and read the file directly. But that takes time, and I’ll have to deal with hard linking... Not something I would look forward to.

I am fairly new to Linux, so an explanation of any commands and piping would also be welcomed with open arms.

Also, will ISO even handle that many files?

theNbomr 01-17-2009 12:47 PM

To create an ISO image file, use mkisofs, giving it the name of the output image file, the name of the directory(s) to copy into the image, and options as desired. This will make a decent first cut:
Code:

mkisofs -J -r -o your.iso /name/of/directory/with/your/files/
Naturally, the files in the tarball must first have been extracted to /name/of/directory/with/your/files/.

man mkisofs

--- rod.

BloodBlight 01-17-2009 01:19 PM

Thanks! :)

Is there a way to do it without extracting the files from the TAR though? That's the bit I'm trying to avoid.

I'm just thinking out load here, but is there any sort of util that can read though the tar and create a FAT based on what it finds? I ask this because a long time ago I built a CD for a company that had a hybrid partition. One was an ISO format and one was a Mac format (this was a while ago before Mac supported ISO), and both partitions addressed the same locations on the disk (so I could fit about 600MBs rather than 320 & 320).

theNbomr 01-17-2009 04:57 PM

By my analysis, no. Since a FAT is really just a list of pointer to places on a disk, I don't see how you can create a FAT without using disk space. You may be able to avoid using double the space by piping the output of tar into mkisofs, but a cursory look at the mkisofs man page doesn't show much promise. This makes sense, since mkisofs takes a whole directory structure rather than a simple linear stream.
My $.02...

--- rod.

BloodBlight 01-20-2009 12:40 AM

Thanks everyone.

Think I will write a module to handle tar files then. Might post a it here and on sourceforge.

Going to start a thread another thread about it though. Having an issue with the file size being reported incorrectly in the TAR. :/

BloodBlight 01-20-2009 12:49 AM

Example:

http://img186.imageshack.us/img186/7232/tarerroroc2.jpg

If that doesn't work:
http://img186.imageshack.us/my.php?i...arerroroc2.jpg

BloodBlight 01-20-2009 01:02 AM

The other thread:
https://www.linuxquestions.org/quest...-file.-698528/

jski3 02-27-2018 09:12 AM

Use:

Code:

sudo archivemount /path/to/your/tarball.tar.bz2 /mnt/tar/
cd to /mnt/tar

Code:

mkisofs -J -r -o ~/your.iso *
No extracting the files from the tarball.

jefro 02-27-2018 01:21 PM

9 year old post.

Hello and welcome to LQ jski3.


All times are GMT -5. The time now is 09:24 AM.