Posted: Sun 25 Oct 2009, 01:39 Post subject:
Can I use dd to write to a disk at a specific offset?

I need a way to change the two media bytes on a disk at offset 15hex and 615hex without disturbing the rest of the disk.
Can I use the dd command to do this?
The problem being that any usb device that has a fat filesystem written to it using mkdosfs sets the media byte as being a hard drive.
Is it really a problem?
Don't know if this would affect the usability.

This directly affects writing a fat file system to USB floppys.
When doing the same task to FD0, the media byte is correct.

What you describe may be a help for a system I was building for a friend, where they wanted XP on a CFide adapter, but XP will not create a swap file on the CF disk.

As an aside - I have a Dane usb drive running on an XP security camera system and it identifies itself to XP as HD, (loaded pics in and out for over 3 years no fails yet) so it is possible to fool XP, but never could duplicate that device.

I want to try what you describe on a Sans or PNY stick, - are you doing a full format or please give description of DD commands.

Also have read (somewhere) that DD will backup Puppy as it is setup on a PC, any commands for that you might know.

I tried once to copy one hard drive to another using dd.
I did not know much about how to use it at all.
As a result, I trashed the contents of both hard drives.
What got me into trouble was the fact that there is very limited documentation as to if the source and destination drives should be mounted or not.
On the Puppy menu under Utility, you will find a utility called Pudd.
It goes further in telling you if a drive or partition needs to be mounted or not.
But be prepared to have a backup take a while depending on the size of the hard drive or partition.
I copied a 4 gig partition from one drive to another and let it run overnight.
I remember another user stating a partition/drive he backed up/copied, took 33 hours!
With the ever increasing size of hard drives, a good backup program is needed that does full, or incremental, backups with or without compression.
If you attempt to use the 'dd' command from the command line, I would suggest doing 'man dd' from the command line first to find out its use and options.
Also triple check that you have the mounting right for using it and the source and destination right.
All it takes is getting it wrong to trash your hard drive when you hit return.

Thank you 8-bit,
That was real useful info. I'll experiment with old drives at a later date.

Since jumping into Puppy and using the ext2 file system don't have a good way to clone or have a backup drive. PQI worked for fat32, and I used to run that exclusively even with XP, hated their NTSF5 system.
But decided to make 431 webserver systems all Linux and use Fat32 for the actual html files as it is easier to share within the intranet via usb. (and actually serve files from 8 Gb PNY Fat32 sticks)

Got an off the cuff question, never had Pup running for any length of time, and since server PC has been up for tests about 30 hours, have found the XP zonealarm systems on intranet have been receiving a UDP ping on port 631 from the server IP - something like every 4 hours. There are no shares or network wizards run for Puppy, and am wondering what process is doing this UDP thing.
Please advise where this question should be posted, if it's something unknown or unexpected

dd should be used on *unmounted* drives. And for cloning drives, it is only straightforward if the drives are exactly the same size.
Threre is a really super thread on linuxquestions.org about how to use dd in *many* useful ways, but I can't find it at the moment.

Thanks Joe for finding that -that thread is really long, but worth savinf a copy of for future reference.

dd can be used on USB drives the same as builtin drives, and can also be used on loop-mounted partition/disk images, files or even from/to pseudo-devices like /dev/zero, dev/null

Interesting thing about the name -at first I thought it meant direct-to-disk as that is the way you usually use it. But, it's real name is 'copy-and-convert', but since 'cc' is the name of a compiler, they opted to name it 'dd'!

Really useful for loads of jobs -just last week I implemented a way to use it instead of 'file' to discover some file types(since 'file' can be dangerous on unknown objects) a lot faster than running 'file obj |grep ELF' on hundreds of objects.

laptopkiller, there is no point in using tar on a single object. Suing dd will preserve all the perms effectively as nothing gets inetrpreted. dd copies bit-by-bit or block-by-block without 'reading' any filesystem realted metadata.

Joe will remember a tip I passed him not long ago about using dd to replace barry's 'truncate' program -by inserting a NULL character into a file at a given point, the file gets truncated there.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum