LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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
 
LinkBack Search this Thread
Old 04-19-2010, 01:15 PM   #1
yeehi
Member
 
Registered: May 2004
Distribution: Debian Wheezy, Parabola, Trisquel
Posts: 78

Rep: Reputation: 15
Question How to convert .tgz to .img ?


I have a file (.tgz) which is meant to be simply copied to a floppy disc.
I donīt have a floppy disc, so I would like to convert the file to a .img file, so that it looks like a floppy disc but is on my hard drive.

How do I do this? I have looked quite a lot. Surely there is some application that does it easily.

(In case it helps, this is for installation of Basic Linux, which comes on two floppy discs with ms-dos file systems.
 
Old 04-19-2010, 01:29 PM   #2
reed9
Member
 
Registered: Jan 2009
Location: Boston, MA
Distribution: Arch Linux
Posts: 653

Rep: Reputation: 141Reputation: 141
The dd command can do this. Though .tgz indicates it's a compressed archive. Are you sure you don't want whatever is in the archive?

Anyway, it would be something like
Code:
dd if=/path/to/input/file.tgz of=/path/to/output/file.img
http://www.linuxquestions.org/questi...ommand-362506/
 
Old 04-19-2010, 01:44 PM   #3
yeehi
Member
 
Registered: May 2004
Distribution: Debian Wheezy, Parabola, Trisquel
Posts: 78

Original Poster
Rep: Reputation: 15
Thank you! I got some output:

Quote:
2745+1 records in
2745+1 records out
1405907 bytes (1.4 MB) copied, 0.220642 s, 6.4 MB/s
But no file seems to have been created in the directory where I ran the command. (I ran the command from the fileś folder.)

How do I get that file?

Are you sure you don't want whatever is in the archive?
I am not exactly sure, but I think it will be ok as it is.

Last edited by yeehi; 04-19-2010 at 01:51 PM.
 
Old 04-19-2010, 01:50 PM   #4
reed9
Member
 
Registered: Jan 2009
Location: Boston, MA
Distribution: Arch Linux
Posts: 653

Rep: Reputation: 141Reputation: 141
What output directory did you put in the command?
 
Old 04-19-2010, 02:44 PM   #5
yeehi
Member
 
Registered: May 2004
Distribution: Debian Wheezy, Parabola, Trisquel
Posts: 78

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by reed9 View Post
What output directory did you put in the command?
Ooh! I didnīt put in the full path to the output directory! Anyway, I found the .img file and moved it to the correct folder.

Unfortunately, it still wonīt work, as it seems my problem is a bit more complicated:

the .img file isnīt of use as it didnīt have a DOS file system on it. I think i need to create a .img file, mount it, put a dos file system on it, copy over the file, unmount it. That is my guess. I donīt know whether that is correct, or how to do it. Also, I dont think this process I suggested will actually leave me a .img file in my folder as required.

I tried doing something like this before but it didnt work. One thing is that nautilus cant handle places - there was some error message with this.

I hope you can still help!

Thank you!
 
Old 04-19-2010, 02:52 PM   #6
reed9
Member
 
Registered: Jan 2009
Location: Boston, MA
Distribution: Arch Linux
Posts: 653

Rep: Reputation: 141Reputation: 141
Perhaps you can tell us more about the file? What is it exactly? Where did you get it?
 
Old 04-19-2010, 03:05 PM   #7
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
I am almost certain the file is an archive containing the image, else why would it be called ".tgz"?
 
Old 04-19-2010, 03:05 PM   #8
yeehi
Member
 
Registered: May 2004
Distribution: Debian Wheezy, Parabola, Trisquel
Posts: 78

Original Poster
Rep: Reputation: 15
It is a Basic Linux set up download.

The download is meant to produce stuff for two floppy discs. I wont be using floppys - I will be doing it all from a hard disk using a virtual machine.
 
Old 04-19-2010, 03:07 PM   #9
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
Perhaps the archive contains two images — one for each floppy?

And no, putting files in a compressed archive is not at all like sticking them together.
 
Old 04-19-2010, 03:30 PM   #10
reed9
Member
 
Registered: Jan 2009
Location: Boston, MA
Distribution: Arch Linux
Posts: 653

Rep: Reputation: 141Reputation: 141
I just checked. Yes, there is already an image file in the archive. That is what you want to use as the image file for VirtualBox.

The readme included in the archive is as follows:
Quote:
Welcome to BasicLinux 3.5
~~~~~~~~~~~~~~~~~~~~~~~~~
BL3 is a mini-Linux designed specifically for old PCs. It provides a slim
2.2.26 kernel, a user-friendly shell and a good assortment of utilities.
BL3 includes a web browser, comm program, mail client, telnet client, wget,
DHCP and dial-up PPP. It also has a small-footprint GUI and some graphical
applications, including the MagicPoint presentation tool.

This version of BasicLinux boots from two floppies and runs in a ramdisk.
It has an option to install itself onto a Linux harddrive partition.

Minimum requirements for the floppy version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Intel 386 or compatible
12mb RAM
two blank floppies (DOS format)

How to put BasicLinux on the floppies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In the zip file, you will find disk1.img and disk2.tgz. Floppy 2 is easy.
Simply copy disk2.tgz to an empty DOS floppy and label it floppy 2.

Floppy 1 is more complicated -- a simple copy is not enough. You have to
write the raw image (disk1.img) to the floppy.

In Linux, this is done with the dd command:
---------------------------
dd if=disk1.img of=/dev/fd0
---------------------------

In DOS, you use rawrite.exe or fdimage.exe to write raw images.
The BL3 zip file includes fdimage.exe. Here is the command:
---------------------
fdimage disk1.img a:
---------------------

WARNING: The floppy used for disk 1 must be perfect (no bad sectors).
The routines for writing raw images are not error-tolerant.


Starting BasicLinux
~~~~~~~~~~~~~~~~~~~
Insert floppy 1 and reboot the system. Floppy 1 will boot Linux and tell
you when to insert floppy 2. When floppy 2 has finished loading, remove it.

PCMCIA
~~~~~~
BL3 is able to use older PCMCIA cards (serial, IDE and PCnet). To activate
a card, insert it in the PCMCIA slot and then execute: /etc/pcmcia/start

Networking
~~~~~~~~~~
BasicLinux has good networking capabilities. To help you configure your
network interface, BasicLinux includes a file called "netsetup", which
outlines the steps to follow. Just edit "netsetup" to match your situation
and execute it.

If you have a suitable modem, you can run pppsetup to configure a connection
to your Internet Service Provider. Note: many of the modems in Windows
computers are designed to work only with Windows -- they do not work with
BasicLinux.

Installing BasicLinux to harddisk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From inside BL3, use fdisk and mke2fs to create a Linux partition on your
harddisk. Mount that partition at /hd and execute install-to-hd.

Disclaimer
~~~~~~~~~~
BasicLinux is free software. I have done my best to make it error-free,
but there is no guarantee regarding its fitness for any purpose. You use
it at your own risk.

BasicLinux 3 is designed for old PCs with limited RAM. It is not suitable
for mission-critical systems and should not be used on systems containing
irreplaceable data.
 
Old 04-19-2010, 03:45 PM   #11
yeehi
Member
 
Registered: May 2004
Distribution: Debian Wheezy, Parabola, Trisquel
Posts: 78

Original Poster
Rep: Reputation: 15
I need the .img file that comes with the download for sure. The good thing about it is that it works well as it is on the hard disk. I donīt have to change it. It is the first ĻfloppyĻ. (How I wish the second floppy were like this format!)

There are two floppys needed though. Launching that first .img file runs well but then it says insert the second floppy. It is this second floppy with which I am having trouble, because it isnīt a .img file. It is a .tgz file.

I have tried unpacking the .tgz file in the hope that it is a .img. It does not unpack to a .img. I need to somehow get that DISK2.TGZ put onto a a DOS file system floppy .img file.

Please help!

Last edited by yeehi; 04-19-2010 at 03:46 PM.
 
Old 04-19-2010, 03:51 PM   #12
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
You are supposed to copy disk2.tgz onto the second floppy as a normal file, it is not an image.
 
Old 04-19-2010, 04:10 PM   #13
yeehi
Member
 
Registered: May 2004
Distribution: Debian Wheezy, Parabola, Trisquel
Posts: 78

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by MTK358 View Post
You are supposed to copy disk2.tgz onto the second floppy as a normal file, it is not an image.
Yes, I know that I should put the DISK2.TGZ file onto a real floppy disc. That would be easy, if I had a real floppy disc and a real floppy drive. I have neither real floppy disc nor real floppy drive. I am trying to do this all off a hard disk and will use a virtual machine.

So, could somebody tell me how I could create a .img file that looks like a DOS floppy disc that has had the DISK2.TGZ file moved onto it?

I hope so!
 
Old 04-19-2010, 04:14 PM   #14
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
You're doing this in a virtual machine, right?

If you're trying to fake a real computer having a floppy drive, I doubt it's possible.

Anyway, I don't know how to make an image of a DOS floppy and copy stuff to it.
 
Old 04-19-2010, 04:22 PM   #15
yeehi
Member
 
Registered: May 2004
Distribution: Debian Wheezy, Parabola, Trisquel
Posts: 78

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by MTK358 View Post
Anyway, I don't know how to make an image of a DOS floppy and copy stuff to it.
I am running all these commands on a real installation of Ubuntu. Once I have eventually made the second floppy disc image, i will use a virtual machine for installation.

Quote:
Originally Posted by MTK358 View Post
Anyway, I don't know how to make an image of a DOS floppy and copy stuff to it.
This might help!

I have tried to follow these instructions:

Quote:
let's create an empty image, make fs
Code:

dd if=/dev/zero of=floppy.img bs=512 count=2880
mkdosfs floppy.img

now, let's create a mountpoint and mount it
Code:

sudo mkdir /media/image
sudo mount -o loop floppy.img /media/image

the mounted image appears on the desktop, but you cant write to it
open nautilus in root mode or etc and copy some files
Code:

sudo nautilus /media/image

when you are finished
Code:

sudo umount -l /media/image
I didnt get it to work properly. The mounting/unmounting didnīt work out well. Nautilus canīt handle places was the error message.
 
  


Reply

Tags
basic, convert, dos, floppy, img, linux, tgz


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to convert .img to .iso files Rory in Toronto Linux - Software 9 11-03-2013 08:54 AM
[SOLVED] openoffice.org RPMS won't convert to tgz vince4amy Slackware 3 09-16-2009 08:15 AM
How do you convert ISO to img to access RPM files MandrivaUser Linux - Software 1 10-18-2006 10:54 AM
convert .tar.gz to .tgz vivek_nz76 Slackware 6 01-06-2006 04:47 AM
convert tar.gz into .tgz lostnhell Slackware 5 09-05-2005 02:50 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration