Re: Read/Write bytes directly from hard drive

From: tom (tom_at_dbservice.com)
Date: 04/22/05


Date: Fri, 22 Apr 2005 23:12:15 +0200

asharma wrote:
> We are writing a disk partitioner from scratch. We were not sure how to
> access any byte from the disk, including the master table or any other
> data. Are there any system calls that handle read/write operations?
>

int fd = open("/dev/hda", O_SYNC);

Read the first x bytes and you get the partition table of your first IDE
disk. Replace x with the size of your partition table.

tom



Relevant Pages

  • Re: Linux community software-update-anarchy polemic
    ... Remember, I'm just a monkey. ... That implies that if you have one disk per partition, ... Trust the kernel or don't trust the kernel, but either way, both ...
    (comp.os.linux.misc)
  • SUMMARY: Moving /usr From Under Root "/" To Its Own Partition
    ... One of the reasons for doing this is to end up with a smaller root ... Install the boot block and boot off the new drive. ... " In order for the root partition to be fscked and remounted ... D> temporarily on the existing disk. ...
    (SunManagers)
  • Re: Two "expert" issues I must solve before upgading
    ... I think backups are different than the other fluff you suggest - more ... out there who had a disk crash and had to start from scratch. ... >image of your current Windows 98 OS partition. ... you can restore the disk image and get back quickly ...
    (microsoft.public.windowsxp.newusers)
  • Re: Found the chkdsk log [STOP error, data unviewable etc...]
    ... The type of the file system is NTFS. ... CHKDSK is recovering lost files. ... 33013543 KB total disk space. ... partition, etc. Oh well... ...
    (microsoft.public.win2000.file_system)
  • Re: Two "expert" issues I must solve before upgading
    ... > I need an imaging program for my full backups, ... No. Don't consider disk images as file backup. ... image of your current Windows 98 OS partition. ... changes then save a disk image. ...
    (microsoft.public.windowsxp.newusers)