I recently installed Fedora 22 on a desktop PC. I wanted to install it on a logical partition. During installation, in the Anaconda installation wizard, I chose to create a 16 GiB logical partition as swap space, and a 50 GiB logical partition for the system, boot, home, root, etc (etc. etc, not /etc
... but yes, that too... no pun intended).
This is a multi-booted system with Windows 10 preview, Ubuntu and Fedora. The disk is using MBR partition scheme. Windows is using a primary partition as system partition as the boot (a.k.a. system) partition. The Windows itself is installed on a logical partition. At least in the Windows world, a logical partition (a.k.a. "logical drive") can only be created inside an extended partition. I have created this extended partition next to the primary partition, and it ran to the end of disk. Then I had Ubuntu installed, and then Fedora.
This is what it looks like now in Disks tool in Fedora.
Why are the Fedora partitions not listed under the "extended partition"?
You can see that Ubuntu is listed under the extended partition. This is what I would expect for Fedora too, and this is the way Windows usually lists logical partitions too, as an entity living inside the extended partition.
Perhaps a better, and more general question would be: is it possible for logical partitions to exist outside of an extended partition? Outside of the boundary of an extended partition? Up until now, I only thought that primary partitions could do that.
Here is an fdisk output for the same disk.
Disk /dev/sda: 465.8 GiB, 500106780160 bytes, 976771055 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
Disklabel type: dos
Disk identifier: 0x9a3b2e4f
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 264191 262144 128M 7 HPFS/NTFS/exFAT
/dev/sda2 266238 237123583 236857346 113G f W95 Ext'd (LBA)
/dev/sda3 237123584 270678015 33554432 16G 82 Linux swap / Solaris
/dev/sda4 270678016 375535615 104857600 50G 83 Linux
/dev/sda5 266240 105123839 104857600 50G 7 HPFS/NTFS/exFAT
/dev/sda6 105125888 137123839 31997952 15.3G 82 Linux swap / Solaris
/dev/sda7 137125888 237123583 99997696 47.7G 83 Linux
Partition table entries are not in disk order.
You can see that the extended partition starts at sector 266238 and ends at sector 237123583. Partition 3 (Fedora swap) starts at sector 237123584. How is this possible?
Here is what it looks like in Windows 10 disk management tool.
I have marked in the screenshot above what I believe is the Ext4 partition that's used by Fedora. That should be it, because it's exactly 50 GiB and Windows uses binary prefixes (but unfortunately uses "MB" and "GB" to indicate it). As you can see it is listed as a primary partition. In fact all the Linux partitions I created are listed as primary partitions. This contradicts what I have just shown above in Linux. So who is right and who is wrong then?... Windows or Linux? Both can't be right about it?
Update: parted
Here is the output from parted.
Model: ATA ST3500320AS (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 135MB 134MB primary ntfs boot
2 136MB 121GB 121GB extended lba
5 136MB 53.8GB 53.7GB logical ntfs
6 53.8GB 70.2GB 16.4GB logical linux-swap(v1)
7 70.2GB 121GB 51.2GB logical ext4
3 121GB 139GB 17.2GB primary linux-swap(v1)
4 139GB 192GB 53.7GB primary ext4
This is easier to read than the output from fdisk. And unlike fdisk, here we can see that the partitions are printed in disk order. Thank you parted! This does help to shed some light on the subject. I can tell that the first 3 partitions are in the right order, as I created them with diskpart. Except that the extended partition does not run to the end of the disk. Either Ubuntu or Fedora installation process must have changed it for some reason.
Update: fstab and grub config (fulfilling request)
As requested by @Chris.C here is what my fstab and grub configuration file looks like.
# /etc/fstab
# Created by anaconda on Wed Jul 1 01:18:26 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=036c6533-ec01-428a-a38c-23c364cc220a / ext4 defaults 1 1
UUID=01d56d7c-5d48-497c-befd-05f7a7f22281 swap swap defaults 0 0
Now here is the grub configuration... I have to add this line to create code block separation.
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
set pager=1
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="${saved_entry}"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
terminal_output console
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora (4.0.4-301.fc22.x86_64) 22 (Twenty Two)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.0.4-301.fc22.x86_64-advanced-036c6533-ec01-428a-a38c-23c364cc220a' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4 --hint='hd0,msdos4' 036c6533-ec01-428a-a38c-23c364cc220a
else
search --no-floppy --fs-uuid --set=root 036c6533-ec01-428a-a38c-23c364cc220a
fi
linux16 /boot/vmlinuz-4.0.4-301.fc22.x86_64 root=UUID=036c6533-ec01-428a-a38c-23c364cc220a ro rhgb quiet LANG=en_US.UTF-8
initrd16 /boot/initramfs-4.0.4-301.fc22.x86_64.img
}
menuentry 'Fedora (0-rescue-6b81f900dbfc4da3b56fe2db6748aabc) 22 (Twenty Two)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-6b81f900dbfc4da3b56fe2db6748aabc-advanced-036c6533-ec01-428a-a38c-23c364cc220a' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4 --hint='hd0,msdos4' 036c6533-ec01-428a-a38c-23c364cc220a
else
search --no-floppy --fs-uuid --set=root 036c6533-ec01-428a-a38c-23c364cc220a
fi
linux16 /boot/vmlinuz-0-rescue-6b81f900dbfc4da3b56fe2db6748aabc root=UUID=036c6533-ec01-428a-a38c-23c364cc220a ro rhgb quiet
initrd16 /boot/initramfs-0-rescue-6b81f900dbfc4da3b56fe2db6748aabc.img
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Recovery Environment (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-2E0E4F3F0E4EFEF9' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 2E0E4F3F0E4EFEF9
else
search --no-floppy --fs-uuid --set=root 2E0E4F3F0E4EFEF9
fi
parttool ${root} hidden-
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry 'Ubuntu 15.04 (15.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-6f745b5e-bb49-40cb-bcae-b245d76b9d7d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 --hint='hd0,msdos7' 6f745b5e-bb49-40cb-bcae-b245d76b9d7d
else
search --no-floppy --fs-uuid --set=root 6f745b5e-bb49-40cb-bcae-b245d76b9d7d
fi
linux16 /boot/vmlinuz-3.19.0-15-generic root=UUID=6f745b5e-bb49-40cb-bcae-b245d76b9d7d ro quiet splash $vt_handoff
initrd16 /boot/initrd.img-3.19.0-15-generic
}
submenu 'Advanced options for Ubuntu 15.04 (15.04) (on /dev/sda7)' $menuentry_id_option 'osprober-gnulinux-advanced-6f745b5e-bb49-40cb-bcae-b245d76b9d7d' {
menuentry 'Ubuntu (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.19.0-15-generic--6f745b5e-bb49-40cb-bcae-b245d76b9d7d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 --hint='hd0,msdos7' 6f745b5e-bb49-40cb-bcae-b245d76b9d7d
else
search --no-floppy --fs-uuid --set=root 6f745b5e-bb49-40cb-bcae-b245d76b9d7d
fi
linux16 /boot/vmlinuz-3.19.0-15-generic root=UUID=6f745b5e-bb49-40cb-bcae-b245d76b9d7d ro quiet splash $vt_handoff
initrd16 /boot/initrd.img-3.19.0-15-generic
}
menuentry 'Ubuntu, with Linux 3.19.0-15-generic (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.19.0-15-generic--6f745b5e-bb49-40cb-bcae-b245d76b9d7d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 --hint='hd0,msdos7' 6f745b5e-bb49-40cb-bcae-b245d76b9d7d
else
search --no-floppy --fs-uuid --set=root 6f745b5e-bb49-40cb-bcae-b245d76b9d7d
fi
linux16 /boot/vmlinuz-3.19.0-15-generic root=UUID=6f745b5e-bb49-40cb-bcae-b245d76b9d7d ro quiet splash $vt_handoff
initrd16 /boot/initrd.img-3.19.0-15-generic
}
menuentry 'Ubuntu, with Linux 3.19.0-15-generic (upstart) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.19.0-15-generic--6f745b5e-bb49-40cb-bcae-b245d76b9d7d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 --hint='hd0,msdos7' 6f745b5e-bb49-40cb-bcae-b245d76b9d7d
else
search --no-floppy --fs-uuid --set=root 6f745b5e-bb49-40cb-bcae-b245d76b9d7d
fi
linux16 /boot/vmlinuz-3.19.0-15-generic root=UUID=6f745b5e-bb49-40cb-bcae-b245d76b9d7d ro quiet splash $vt_handoff init=/sbin/upstart
initrd16 /boot/initrd.img-3.19.0-15-generic
}
menuentry 'Ubuntu, with Linux 3.19.0-15-generic (recovery mode) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.19.0-15-generic--6f745b5e-bb49-40cb-bcae-b245d76b9d7d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 --hint='hd0,msdos7' 6f745b5e-bb49-40cb-bcae-b245d76b9d7d
else
search --no-floppy --fs-uuid --set=root 6f745b5e-bb49-40cb-bcae-b245d76b9d7d
fi
linux16 /boot/vmlinuz-3.19.0-15-generic root=UUID=6f745b5e-bb49-40cb-bcae-b245d76b9d7d ro recovery nomodeset
initrd16 /boot/initrd.img-3.19.0-15-generic
}
menuentry 'Memory test (memtest86+, serial console 115200) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/memtest86+.bin--6f745b5e-bb49-40cb-bcae-b245d76b9d7d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 --hint='hd0,msdos7' 6f745b5e-bb49-40cb-bcae-b245d76b9d7d
else
search --no-floppy --fs-uuid --set=root 6f745b5e-bb49-40cb-bcae-b245d76b9d7d
fi
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
Update: attempting to fix partitions order in fdisk
As suggested by @Chris.C I have tried fixing the partitions order using fdisk. Here is the result.
[root@sg-1 /]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.26.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): x
Expert command (m for help): f
Nothing to do. Ordering is correct already.
Expert command (m for help):
It's needless to say, but fdisk
is feeling bored, because it has nothing to do.