Re: How to read the data from the first sector of HDD




Michael Schnell wrote:

Hi Steve,

good to see you here :)

-Michael


Hello Michael & Steve,

Thanks a lot for ur kind support!!!!!!!!!!!

Be sure (a) to unmount any(!!) filesystem, otherwise you would probably
destroy it.

Can u please clarify on this??

I can program neither in C nor am I able to write shell scripts (only
"batch" files), but I would try something like this:
(1) i=0
(2) dd if=/dev/hdx of=/tmp/oldsector bs=512 count=1 skip=i
if this fails, your disk is defective or end of disk is reached (6)
(3) dd if=/tmp/newsector of=/dev/hdx bs=512 count=1 skip=i
(4) dd if=/dev/hdx of=/tmp/readsector bs=512 count=1 skip=i
(5) dd if=/tmp/oldsector of=/dev/hdx bs=512 count=1 skip=i
(6) increment i; jump to (2)

I understand ur point and thanks for the routine but can I use the dd
command in my C program, if yes then how to use that??


It is up to you to decode the MBR-boot sector, partition tables etc. People
doing embedded tend to build a file as a "disk image" which then is
somehow copied to the embedded "disk" as a means of mastering embedded
disk drives.

Steve , can u please clarify this???

Please guide me!!!!!!!!

Thanks & Regards,
Nutty

.



Relevant Pages

  • Re: NFSTDos query
    ... so in essence it's a bunch of plug-ins for a PE disk. ... |>>>That's what my response was supposted to clarify this issue since yours ... Had hoped I missed something when I was at the Bart site a while ...
    (microsoft.public.win2000.general)
  • RE: remaster ubuntu alternate
    ... take a disk from one machine and move ... to the end of the file and you can end up with a mess since it never deletes ... And to clarify on your earlier question: ... I think it only matters if you bring two drives together on the same machine ...
    (Ubuntu)
  • Re: NFSTDos query
    ... An already built PE disk? ... |>>>That's what my response was supposted to clarify this issue since yours ... Had hoped I missed something when I was at the Bart site a while ...
    (microsoft.public.win2000.general)
  • RE: Activation and set up denied
    ... please clarify, did you go to: run/type setup.exe with the disk in your drive? ... Chris Schatte ...
    (microsoft.public.office.setup)
  • Re: Server Advice Wanted.
    ... per disk on a mildle used disk on the other a hard drive ... > write out to DVDs. ... > expensive to mirror and backup. ... If a 3TB mirrored system fails, ...
    (borland.public.delphi.non-technical)