I have used dd to create a partial/truncated image of a disk which only includes allocated spaces, then converted it to a vdi file for VirtualBox. I have successfully used the vdi image to run the Linux (Ubuntu) which was installed on the disk.
Now I wan't to run GParted to remove partitions which are located before the Linux partition (so that I can create a smaller image). But GParted doesn't work. It shows entire disk as unallocated. How can I fix it?
Additional info:
sudo parted /dev/sda unit s print
Error: Can't have a partition outside the disk! sudo fdisk -l -u /dev/sda
Disk /dev/sda: 97.7 GB, 97729379840 bytes 255 heads, 63 sectors/track, 11881 cylinders, total 190877695 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x3c36156a Device Boot Start End Blocks Id System /dev/sda1 * 2048 2459647 1228800 7 HPFS/NTFS/exFAT /dev/sda2 2459648 125339129 61439741 7 HPFS/NTFS/exFAT /dev/sda3 125339646 190877695 32769025 5 Extended /dev/sda5 125339648 190877695 32769024 83 Linux sudo sfdisk -uS -l /dev/sda
Disk /dev/sda: 11881 cylinders, 255 heads, 63 sectors/track Warning: extended partition does not start at a cylinder boundary. DOS and Linux will interpret the contents differently. Units = sectors of 512 bytes, counting from 0 Device Boot Start End #sectors Id System /dev/sda1 * 2048 2459647 2457600 7 HPFS/NTFS/exFAT /dev/sda2 2459648 125339129 122879482 7 HPFS/NTFS/exFAT /dev/sda3 125339646 190877695 65538050 5 Extended /dev/sda4 0 - 0 0 Empty /dev/sda5 125339648 190877695 65538048 83 Linux sudo sfdisk -d /dev/sda
Warning: extended partition does not start at a cylinder boundary. DOS and Linux will interpret the contents differently. # partition table of /dev/sda unit: sectors /dev/sda1 : start= 2048, size= 2457600, Id= 7, bootable /dev/sda2 : start= 2459648, size=122879482, Id= 7 /dev/sda3 : start=125339646, size= 65538050, Id= 5 /dev/sda4 : start= 0, size= 0, Id= 0 /dev/sda5 : start=125339648, size= 65538048, Id=83