Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-07-2006, 10:05 AM   #1
Registered: Jul 2003
Posts: 256

Rep: Reputation: 32
How to create a floppy image under 1440k w/ dd

I've found a floppy image that is only 110592 bytes in size (SBM), and was wondering how that could have been made with dd, considering dd reads every bit literally. Or if it was not made with dd, what tool might have made it?
Old 11-07-2006, 10:31 AM   #2
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
dd is in fact literal--it will copy exactly the number of bytes you tell it.

For example, to put your image file on a floppy:

dd if=filename of=/dev/fd0 bs=110592 count=1

Or, if you prefer:
dd if=filename of=/dev/fd0 bs=27648 count=4

dd if=filename of=/dev/fd0
(With no parameters specified, dd just goes to the end of file)
Old 11-07-2006, 11:21 AM   #3
Registered: Jul 2003
Posts: 256

Original Poster
Rep: Reputation: 32
Imaging only the useful content

Ah, so the trick is knowing where the content ends. Here's the reason I'm digging into this:

I often image bootable partitions for backup purposes using dd. Rather than use a commercial tool that knows what to ignore for a given filesystem type, I'm trying to find ways to do this the GNU way without wasting too much space.

One way is to use dd to pad all the empty space with zeros (ie. dd if=/dev/zero of=/mnt/target_drive/zero.pad), so that after the drive is imaged, it compresses nicely.

Another way might be to use a defragmentation tool to pack all the data to the front of the partition, then specify a size to dd that includes the last bit of meaningful content while excluding the trailing empty space. How would I know what size to specify?

Are there any filesystems that necessarily have meaningful content at the end of a partition?

The second approach is superior because compression may not be necessary, and the restore partition can be smaller.


backup, dd, imaging

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
What is the best way to create a SLED 10 image? rsmccain SUSE / openSUSE 4 07-11-2006 12:22 PM
Help: Create boot image _InTeNsDoWn_ Linux - General 4 09-02-2005 08:59 PM
not able to create an image.... os2 Linux - Software 2 08-31-2005 06:26 PM
create floppy image using dump cccc Linux - Hardware 2 08-07-2005 02:31 PM
Create an .iso image bentman78 Linux - Software 9 07-02-2004 06:22 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:30 AM.

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