fdisk, windows partition

Asked by Daniel Malz

A short question, because I detected something in my fdisk. Here is it, question below.

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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: 0xebdd09e2

   Device Boot Start End Blocks Id System
/dev/sda1 * 63 131600248 65800093 7 HPFS/NTFS/exFAT
/dev/sda2 131604480 976768064 422581792+ 5 Extended
/dev/sda5 131604544 976768064 422581760+ 7 HPFS/NTFS/exFAT

Disk /dev/sdb: 64.0 GB, 64023257088 bytes
255 heads, 63 sectors/track, 7783 cylinders, total 125045424 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: 0x00073296

   Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 113326079 56662016 83 Linux
/dev/sdb2 113326080 125044735 5859328 82 Linux swap / Solaris
fdisk: unable to read /dev/mapper/cryptswap1: Inappropriate ioctl for device

1. What is a inappropriate ioctl, and do I have to worry about it (last line)?
2. /dev/sda2 and /dev/sda5 appear as different file systems about approximatly the same range ?!? It is a NTFS partition from Windows (on a 2nd HDD in my computer and there are just two partitions). Why is one partition seen as two?
Thanks a lot for your help in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu util-linux Edit question
Assignee:
No assignee Edit question
Solved by:
Chris
Solved:
Last query:
Last reply:
Revision history for this message
Best Chris (fabricator4) said :
#1

1. ioctl is "input/output control". It's a method where by userspace (your user and the fdisk command) can talk to the kernel (the operating system and the bits that it uses to communicate with hardware.

I don't think there's a problem with /dev/sdb as such because the problem is being reported for /dev/mapper. Did you enable encryption for your /home directory? If so, it would seem that the extra layer is preventing fdisk from interrogating the partition information due to the encryption layer. Try using the command on _just_ /dev/sdb and see what happens:

sudo fdisk -l /dev/sdb

Personally, I don't like ecrypting partions unless it's absolutely necessary - it can make data recovering in case of a crash sooo much harder.

2. /dev/sda1 is a the primary partition that Windows boots off. /dev/sda2 is an extended partition which is like an envelope for other partitions - they are called logical partitions. Logical partitions, in this case /dev/sda5 exist inside the extended partition.

This is done by Windows fdisk programs because that OS can only access one primary partition at a time. IOW if you boot windows off sda1 then it will not be able to see sda2 if it is another primary partition. I'm not sure if even Windows still has this actual limitation.

Ubiquity (the Ubuntu installer) will also do this when setting up a system if you use the defaults. It does this for backwards compatibility for other operating systems that have this limitation. Linux itself does not have this limitation - you can have up to four primary partitions and have all of them mounted. If more than four partitions are needed you can have three primary partition and one extended partition which can have more logical partitions inside it.

For this reason the concept of the extended partition is still important for Linux users.

Chris

Revision history for this message
Daniel Malz (daniel-malz) said :
#2

1. Yes it is encrypted and seems to be the problem, thanks a lot.
2. Ok, now I understand it.

Revision history for this message
Daniel Malz (daniel-malz) said :
#3

Thanks Chris, that solved my question.