Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Prevent kernel reading partition information from disk

    Hi all,

    I don't know if this is the right forum, but i'll try it anyway...
    Lately i get a lot of damage disks, which i'm asked to take a look at, mayby you can rescue the photo's, etc.
    Normally i take an image with ddrescue and try to mount or scrape the image later.
    To speed things up, i'm looking at building an old pc only for this cause, plugin a sata2usb cable, and automaticly make a disk image to another disk.
    One of the problems i encounter is, that the kernel always wants to read the partitions on the disk. But the table can be broken. How do i prevent the kernel from doing this?

    John T. Savage

  2. #2
    I think this will only be a problem if userland is trying to automount the filesystems from a bad partition table. You are correct, that if a partition table is present on the MBR sector then the kernel + USB storage driver + udev will create dev entries such as /dev/sda1 etc.

    For copying an entire drive in a raw form, the raw block device such as /dev/sda (with no number) should be used rather than a device node created based on the partition table eg. /dev/sda1. dd will work when the drive is not mounted and not mounted is preferable to avoid interference from other applications. I have not used used ddrescue.

    Hopefully your issue relates to a userland feature that is automouting partitions when it receives a notification that a device or device partition becomes available. Use the "mount" command to see whether the device partitions are really being mounted. udev is an example of an userland program that can manage device numbering. It might be possible to edit or add a udev rule to prevent the partition table being used to create device nodes.

    A destructive solution would be to use dd to erase the partition table on the device thereby preventing any of the files from being read by userland applications. dd will still work because the raw device node such as /dev/sda would still exist.

    You could try running your system without a graphical desktop environment running such as KDE. This is because some graphical environments have automounting and file indexing applications. Therefore, if you boot your system up without an X server running (no graphics) or not logging into the graphical environment then that might workaround the issue. You could use ssh to remotely login to control your system.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts