2

I somehow messed up my partitions when I was trying to clean reinstall Linux Mint. Now whenever I type sudo fdisk -l, it would always give me warnings:

$ sudo fdisk -l
[sudo] password for sneknotsnake:             
Disk /dev/sda: 465,78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500DM009-2DM14
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xdb92a920

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048    104447    102400    50M  7 HPFS/NTFS/exFAT
/dev/sda2          104448  72919039  72814592  34,7G  7 HPFS/NTFS/exFAT
/dev/sda3        72921086 598581903 525660818 250,7G  f W95 Ext'd (LBA)
/dev/sda4       598581904 976773119 378191216 180,3G  7 HPFS/NTFS/exFAT
/dev/sda5        72921088 219478015 146556928  69,9G 83 Linux
/dev/sda6       219480032 598581903 379101872 180,8G  7 HPFS/NTFS/exFAT

Partition 3 does not start on physical sector boundary.
Partition table entries are not in disk order.

AFAIK of my problem, it's because I'm using the "newer" HDD format that uses 4096 instead of the old 512 and my 3rd partition is not perfectly aligned. I'm not really sure, but I think it's because 72921086 % 8 equal 6 instead of 0 like the other partitions (72921086 is from /dev/sda3)

If that really is the case, then how do I realign my 3rd partition? Note that it's a container partition (IDK what it's called) for my 5th and 6th partitions. If I'm not mistaken, I only need to move the start sector by 6 so that it's perfectly aligned.

2
  • Having an extended partition is from using Windows in BIOS boot mode which requires MBR(msdos) partitioning. Microsoft has required vendors to install Windows in UEFI boot mode with gpt partitioning since 2012. You should plan on reinstalling when you get new drive using UEFI & gpt. GPT Advantages (older 2010 but still valid) see post#2 by srs5694: ubuntuforums.org/showthread.php?t=1457901 & wiki.archlinux.org/index.php/…
    – oldfred
    Jun 28, 2021 at 15:18
  • I just did it yesterday! I thought it would be a waste if I just stop in there after backing up all of my data, so I decided just reset the whole disk (my old laptop which I used to backup ran 30 hours without rest, poor thing). Here's the state of my disk now if you're curious. Jun 30, 2021 at 10:21

1 Answer 1

2

It's a non-issue.

Your sda3 is an extended partition that holds logical partitions sda5 and sda6. The only non-aligned number points to the first extended boot record (EBR). This record takes 512 bytes, one logical sector. In no circumstances this can span over two physical sectors. There is no alignment problem here.

The alignment matters for partitions that hold filesystems or other structures. You can call sda5 and sda6 structures inside sda3. The point is they are "misaligned" with respect to the beginning of sda3 (you don't see this misalignment directly) and this perfectly compensates for the misalignment of sda3 itself (the misalignment that bothers you); so they are aligned with respect to the beginning of the disk (and therefore fdisk raises no warning about them), this is what matters. In your case all partitions that need to be aligned are aligned.

If you insist on "fixing" the "problem", you should remove partitions 6, 5 and 3 (in this exact order) and re-create 3, 5 and 6 (in this exact order), so the new partition table is identical to the old, except the starting sector for sda3 is 72921080 instead of 72921086 (and consequently the number of sectors is 525660824 instead of 525660818). The end of the preceding partition (sda2) is further to the left, so there's space to do this.

This can be done without destroying the filesystems. The partitions holding the filesystems will stay at their old places and they will keep their old sizes. No resizing nor moving of any filesystem will be required.

The procedure is safe, unless you manage to destroy the filesystem(s) with some over-zealous tool. AFAIK fdisk is not over-zealous (although it will probably warn you about signatures of existing filesystems, do not destroy the signatures).

There's a remote possibility something uses the unpartitioned space between the partitions 2 and 3. By moving the beginning of sda3 you may destroy some data. It would be uncommon (and in fact suspicious) if anything used this space though.

In practice the "fix" will improve nothing. The safest thing is to do nothing.

1
  • Thanks for answering with so much detail! If that's the case, then I think I'll just leave it be, I don't think it's worth the effort anymore. I even spent all night backing up all of the important files in case I forced to do heavy partitions moving. Jun 28, 2021 at 6:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .