I'm trying to copy the single partition /dev/sda1 to /dev/sdc1, but I'm getting the error "no space left on device" and I honestly don't get why.
I'm working on an Oracle Cloud Infrastructure (OCI) VM where /dev/sda is a 768 GB volume whose sda1 partition has been shrinked o just 32 GB (the process was ok, no data loss! I can guarantee because that volume is an Oracle Database ASM disk group, and everything works fine after shrinking).
Since OCI allows only to grow volume size, I created a new volume /dev/sdc sized 50 GB (that's the minimum size allowed) and created a partition /dev/sdc1 of just 32 GB (same size as /dev/sda1).
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdc 8:32 0 50G 0 disk
└─sdc1 8:33 0 32G 0 part
sda 8:0 0 768G 0 disk
└─sda1 8:1 0 32G 0 part
I get an error while running
# dd if=/dev/sda1 of=/dev/sdc1 bs=512b conv=noerror,sync
dd: error writing ‘/dev/sdc1’: No space left on device
22567+0 records in
22566+0 records out
5915787264 bytes (5.9 GB) copied, 42.9384 s, 138 MB/s
The two partitions are exactly the same size, as shown by fdisk
# fdisk /dev/sda
Disk /dev/sda: 824.6 GB, 824633720832 bytes, 1610612736 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
Disk label type: dos
Disk identifier: 0x7c9bf84b
Device Boot Start End Blocks Id System
/dev/sda1 2048 67108863 33553408 83 Linux
# fdisk /dev/sdc
Disk /dev/sdc: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
Disk label type: dos
Disk identifier: 0x9b11add5
Device Boot Start End Blocks Id System
/dev/sdc1 2048 67108863 33553408 83 Linux
What am I doing wrong?