Wiki source for fdisk


Show raw source

[[http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git fdisk]] partition table manipulator

Fdisk displays or updates the master boot record (M.B.R.) in the first sector (sector 0) of a disk that uses the MBR style of partitioning. It does not recognize GUID Partition Table (GPT) and it is not designed for large partitions: use the more advanced [[parted GNU Parted]].

http://linux.die.net/man/8/fdisk

%%
Usage: fdisk [-b SSZ] [-u] DISK Change partition table
fdisk -l [-b SSZ] [-u] DISK List partition table(s)
fdisk -s PARTITION Give partition size(s) in blocks
fdisk -v Give fdisk version
Here DISK is something like /dev/hdb or /dev/sda
and PARTITION is something like /dev/hda7
-u: give Start and End in sector (instead of cylinder) units
-b 2048: (for certain MO disks) use 2048-byte sectors
%%
"Partitioning
When a file-system wants to optimize its block allocation to the geometry of a flash drive, it needs to know the position of the segments on the drive. On partitioned media, this also implies that each partition is aligned to the start of a segment, and this is true for all pre-formatted SD cards and other media that require special care for segment optimizations. Unfortunately, the fdisk and sfdisk tools from util-linux make it particularly hard to do this correctly, because they try to preserve an archaic geometry of 255 "heads" and 63 "sectors" and, by default, align partitions to "cylinder" boundaries. None of these units have any significance on today's hard drives or flash drives, but they are kept for backwards compatibility with existing software. The result is that most partitions are as misaligned as possible, they start on a odd-numbered 512-byte sector, which defeats all optimizations that a file-system can do to align its accesses to logical blocks and segments inside of the partition.The same problem has been discussed a lot in the light of hard drives with 4KB sectors, but it is much more significant when dealing with flash media. Current versions of fdisk ask the kernel about physical sector (BLKPBSZGET) and optimum I/O size (BLKIOOPT), but currently these are rarely reported correctly by the kernel for flash drives, because the kernel itself does not have the necessary information. SDHC cards report the segment size in sysfs, but this is not used by any partitioning tools, and all cards currently seem to report 4MB segments, even those that actually use 2MB or 8MB segments internally. The linaro-media-create tool (from [[linaroimagetools Linaro Image Tools]]) has recently been changed to align partitions to 4 MB boundaries when installing to a bootable SD card, to work around this problem."
http://lwn.net/Articles/428584/
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki