LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 11-07-2006, 10:05 AM   #1
jgombos
Member
 
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
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
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

OR:
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
jgombos
Member
 
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.
 
  


Reply

Tags
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/Novell 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


All times are GMT -5. The time now is 11:51 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration