Gene Heskett wrote:
> Then why is fdisk complaining?:
'fdisk' is an old tool and unfortunately it hasn't had the love and
care that is needed for it to keep up with the modern day formats. I
used it for years before the new IDE drives but I don't use it anymore
because of exactly what you are seeing. It does not produce results
expected from partition tables today. It doesn't even begin to handle
GPT format for example. (Laughing at calling IDE drives new. Chuckle.)
Does that mean it is buggy? Probably yes but I hate to call it buggy
when what it does what it has always done just fine. Just don't ask
it to handle newer partitions on large disks. But if you had a
classic old 10M ST-506 drive then it would handle it just fine.
It is informative to read the fdisk man page and read the BUGS
section.
man fdisk (on Wheezy 7)
There are several *fdisk programs around. Each has its problems and
strengths. Try them in the order cfdisk, fdisk, sfdisk. (Indeed,
cfdisk is a beautiful program that has strict requirements on the par-
tition tables it accepts, and produces high quality partition tables.
Use it if you can. fdisk is a buggy program that does fuzzy things -
usually it happens to produce reasonable results. Its single advantage
is that it has some support for BSD disk labels and other non-DOS par-
tition tables. Avoid it if you can. sfdisk is for hackers only -- the
user interface is terrible, but it is more correct than fdisk and more
powerful than both fdisk and cfdisk. Moreover, it can be used nonin-
teractively.)
These days there also is parted. The cfdisk interface is nicer, but
parted does much more: it not only resizes partitions, but also the
filesystems that live in them.
The Jessie 8 version seems to have been given some love and rewriten.
I didn't see a util-linux backport to Wheezy or I would suggest it.
> /dev/sda2 1919979518 1953523711 16772097 5 Extended
> Partition 2 does not start on physical sector boundary. <------here
That is an extended partition. That is not your swap partition. That
partition is one of the primary partitions that holds the logical
partitions. It is the extension to allow more than four partitions.
https://en.wikipedia.org/wiki/Extended_boot_record
And this is a good example where fdisk is showing its age. It is
worried you might violate a concept that doesn't exist anymore. If
you must use fdisk then you simply must ignore those useless warnings.
You aren't actually using sda2 other than to hold sda5.
> /dev/sda5 1919979520 1953523711 16772096 82 Linux swap / Solaris
>
> But do the math, and it is aligned. fdisk is lying? IDK.
'fdisk' didn't say that sda5 was not aligned. fdisk didn't complain
about sda5 at all. fdisk complained about sda2 but that was a
different complaint. But fdisk was happy with that sda5. It was only
you that was unhappy.
You might want to use parted for alignment checks.
root@phobia:~# parted /dev/sda align-check opt 1
1 aligned
root@phobia:~# parted /dev/sda align-check opt 5
5 aligned
root@turmoil:~# parted /dev/sda align-check opt 1
1 not aligned
Bob
Attachment:
signature.asc
Description: Digital signature