Home > Tutorial > Memperbaiki Overlapping Partition di Linux

Memperbaiki Overlapping Partition di Linux

Program gparted (editor partisi GNOME) menemukan harddisk aktif /dev/sda tidak teralokasi, padahal dengan fdisk disk tersebut sudah terbagi menjadi 6 partisi. Jika disk tak terlokasi tersebut diklik, muncul pesan kesalahan berikut:
Can’t have overlapping partitions
Berikut solusinya. (Note: selalu backup partisi terlebih dahulu sebelum melakukan perubahan tabel partisi ini)

Gparted gagal mendeteksi partisi disk:
Screenshot--dev-sda - GParted

Partisi disk /dev/sda:

didik@x61:~$ sudo fdisk /dev/sda
[sudo] password for didik:
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u').
Command (m for help): p
Disk /dev/sda: 160.0 GB, 160041885696 bytes
240 heads, 63 sectors/track, 20673 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x94a94992
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2159    16322008+   7  HPFS/NTFS
/dev/sda2            2160        8212    45760120    7  HPFS/NTFS
/dev/sda3            8213       18111    74828800    7  HPFS/NTFS
/dev/sda4           18111       20673    19374985    5  Extended
/dev/sda5           18111       18627     3905536   82  Linux swap / Solaris
/dev/sda6           18627       20674    15470592   83  Linux
Command (m for help):

Error terjadi karena batas akhir suatu partisi overlap (melebihi) batas awal partisi lain. Cek dengan fdisk:

Command (m for help): v
Partition 5: head 255 greater than maximum 240
Partition 6: head 255 greater than maximum 240
Logical partition 6 not entirely in partition 4
Remaining 7692 unallocated 512-byte sectors

atau dengan parted:

didik@x61:~$ sudo parted /dev/sda unit s print
Error: Can't have overlapping partitions.

Partisi 5 dan 6 overlap dengan partisi yang sudah ada. Ubah tampilan unit partisi menjadi sector dengan perintah u.

Command (m for help): u
Changing display/entry units to sectors
Command (m for help): p
Disk /dev/sda: 160.0 GB, 160041885696 bytes
240 heads, 63 sectors/track, 20673 cylinders, total 312581808 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: 0x94a94992
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    32644079    16322008+   7  HPFS/NTFS
/dev/sda2        32645120   124165359    45760120    7  HPFS/NTFS
/dev/sda3       124166144   273823743    74828800    7  HPFS/NTFS
/dev/sda4       273825790   312575759    19374985    5  Extended
/dev/sda5       273825792   281636863     3905536   82  Linux swap / Solaris
/dev/sda6       281638912   312580095    15470592   83  Linux

atau dengan perintah fdisk:

didik@x61:~$ sudo fdisk -l -u /dev/sda

Terlihat partisi 5 dan 6 ada di partisi 4 (Extended). Partisi 6 mempunyai batas akhir melebihi batas akhir partisi 4.
Simpan konfigurasi/tabel partisi ke sebarang file sebagai backup.

didik@x61:~$ sudo sfdisk -d /dev/sda > sda-backup.txt
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
didik@x61:~$ cat sda-backup.txt
# partition table of /dev/sda
unit: sectors
/dev/sda1 : start=       63, size= 32644017, Id= 7, bootable
/dev/sda2 : start= 32645120, size= 91520240, Id= 7
/dev/sda3 : start=124166144, size=149657600, Id= 7
/dev/sda4 : start=273825790, size= 38749970, Id= 5
/dev/sda5 : start=273825792, size=  7811072, Id=82
/dev/sda6 : start=281638912, size= 30941184, Id=83

Yang ingin diedit adalah batas akhir partisi 6. Dari console fdisk, hapus partisi 6 dan buat kembali partisi 6 dengan Start dan End yang baru.

Command (m for help): d
Partition number (1-6): 6
Command (m for help): n
First sector (281638912-312575759, default 281638912):
Using default value 281638912
Last sector, +sectors or +size{K,M,G} (281638912-312575759, default 312575759):
Using default value 312575759
Command (m for help): p
Disk /dev/sda: 160.0 GB, 160041885696 bytes
240 heads, 63 sectors/track, 20673 cylinders, total 312581808 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: 0x94a94992
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    32644079    16322008+   7  HPFS/NTFS
/dev/sda2        32645120   124165359    45760120    7  HPFS/NTFS
/dev/sda3       124166144   273823743    74828800    7  HPFS/NTFS
/dev/sda4       273825790   312575759    19374985    5  Extended
/dev/sda5       273825792   281636863     3905536   82  Linux swap / Solaris
/dev/sda6       281638912   312575759    15468424   83  Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

Gparted sekarang sudah bisa melihat partisi di disk /dev/sda.

Partisi /dev/sda terlihat

Partisi /dev/sda terlihat


Referensi:
* How-to Fix Invalid MSDOS Partition Tables

Categories: Tutorial
  1. No comments yet.
  1. No trackbacks yet.
*

This blog is kept spam free by WP-SpamFree.

Skip to toolbar