GNOME Bugzilla – Bug 692051
Swap is shown as unknown
Last modified: 2014-01-04 19:00:50 UTC
GParted is showing the filesystem of my swap partition as unknown. Maybe it has something to do because I'm using dm-crypt for my swap partition. fdisk -lu shows the following: Disk /dev/sda: 200.0 GB, 200049647616 bytes 255 heads, 63 sectors/track, 24321 cylinders, total 390721968 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: 0x000aa70d Device Boot Start End Blocks Id System /dev/sda1 * 2048 357167103 178582528 83 Linux /dev/sda2 357169150 390721535 16776193 5 Extended /dev/sda5 357169152 390721535 16776192 82 Linux swap / Solaris Disk /dev/mapper/cryptswap1: 17.2 GB, 17178820608 bytes 255 heads, 63 sectors/track, 2088 cylinders, total 33552384 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: 0x3fbf5c7f Disk /dev/mapper/cryptswap1 doesn't contain a valid partition table
GParted uses libparted, and blkid to determine the type of file system in a partition. Since these tools examine the contents of the partition, it is entirely possible that they will be unable to determine the contents of an encrypted partition or device. Would you be able to provide the output from the following two commands? sudo parted /dev/sda unit s print and sudo blkid -c /dev/null
root@ubuntu:~# parted /dev/sda unit s print Model: ATA ST3200827AS (scsi) Disk /dev/sda: 390721968s Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 2048s 357167103s 357165056s primary ext4 boot 2 357169150s 390721535s 33552386s extended 5 357169152s 390721535s 33552384s logical root@ubuntu:~# blkid -c /dev/null /dev/sda1: UUID="05338ff8-a226-421b-90a4-1dd45199f783" TYPE="ext4" /dev/mapper/cryptswap1: UUID="4e0db487-bc9f-4f45-a447-2ca30692144e" TYPE="swap"
The output in comment #2 confirms that neither parted nor blkid recognizes the contents of /dev/sda5 as SWAP. This is to be expected with encryption. In fact the encryption is not recognized either. Normally GParted is able to recognize when LUKS encryption has been used on a partition by searching for the text "LUKS" in the partition's first sector. My guess is that this is missing in the encrypted sda5 partition. What is the output from the following command: sudo hexdump -C -n 512 /dev/sda5 If this output does not contain the LUKS header then GParted will not recognize the partition as LUKS.
root@ubuntu:~# hexdump -C -n 512 /dev/sda5 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000200 > The output in comment #2 confirms that neither parted nor blkid recognizes the > contents of /dev/sda5 as SWAP. /dev/mapper/cryptswap1 is my swap partition which is correctly shown as swap. So I'm assuming GParted is not able to check if /dev/mapper/cryptswap1 points to /dev/sda5. Is it possible to implement such a detection?
You might try the patches from the following report: Bug #627701 - option to encrypt new partitions (using LUKS)
I believe that cryptswap is considered depreciated/unsupported and has no header to identify the volume, so this can't be fixed. You need to migrate to LUKS instead. This bug should be closed.
For the reasons listed in comment #6, especially no header to identify the volume, I am closing this bug as WONTFIX.