This is the command:

sudo sfdisk -d /dev/sda | sfdisk --force /dev/sdb

It fails because permission is denied and the entire error message looks like this:

/dev/sdb: Permission denied
sfdisk: cannot open /dev/sdb read-write
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.

I already tried formatting the sdb drive with disk utility or even removing the format and leaving it as unallocated space but nothing succeeded. How should I execute it? Thank you :)

PS: Ubuntu 12.04 are used


sudo sfdisk -d /dev/sda | sudo sfdisk --force /dev/sdb should fix the ´permission denied'. The 2nd part needs to be with the correct permissions too (the pipe cancels the previous sudo.

The comment about the warning: this warning should only be relevant if you had some old OS installed alongside ubuntu that cares about cylinder boundaries.


I would use the dd command instead.

sudo dd if=/dev/sda of=/dev/sdb
  • 1
    I would too... but he wants to copy the partition table: "sfdisk has four (main) uses: list the size of a partition, list the partitions on a device, check the partitions on a device, and - very dangerous - repartition a device." He is after the dangerous part ;) So your dd command probably should look like this: dd if=/dev/sda of=/tmp/sda-mbr.bin bs=512 count=1 and for restoring dd if= sda-mbr.bin of=/dev/sdb bs=1 count=64 skip=446 seek=446 – Rinzwind Dec 4 '12 at 21:02
  • No I am not backing up. This is just a step for creating raid-1 – Georgios Pligoropoulos Dec 28 '12 at 9:02

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.