Dd can’t see partition but cfdisk and GParted can

cfdiskddgparted

I am working with an external HDD and trying to backup a logical partition within an extended partition using dd like this:

sudo dd if=/dev/sdb6 of=partition6.dd

it returns:

dd: opening `/dev/sdb6': No such file or directory

I used the exact same method to backup a different partition (primary) with no issues

sudo dd if=/dev/sdb1 of=partition1.dd

Both GParted and cfdisk show sdb6 but it seems dd can't see it.

How can I backup /dev/sdb6?

Best Answer

It appears that the device file does not exist. You can verify this by doing ls /dev/sdb6.

Try running the command partprobe, or sudo partprobe as user. This should detect the devices and create the according device files.

This may return the error

Error informing the kernel about modifications to partition /dev/sdb5 -- Device or resource busy

If it does, try to temporarily disable SELinux with setenforce 0, then try partprobe again, then don't forget to reenable SELinux.

For an external hard disk, you can also solve this error by unplugging the disk (once everything is unmounted!) and plugging it back in.

Related Question