summaryrefslogtreecommitdiffstats
path: root/partx/partx.c
diff options
context:
space:
mode:
authorKarel Zak2009-02-26 14:23:06 +0100
committerKarel Zak2009-02-26 15:58:28 +0100
commit176303e08d7f1a7ab1211e0b4f3292d2a4648a07 (patch)
treed68047ad453f7ed555f1ce19d2a4484d617f2d9b /partx/partx.c
parentaddpart: 512-byte sectors in code, bytes in man-page (diff)
downloadkernel-qcow2-util-linux-176303e08d7f1a7ab1211e0b4f3292d2a4648a07.tar.gz
kernel-qcow2-util-linux-176303e08d7f1a7ab1211e0b4f3292d2a4648a07.tar.xz
kernel-qcow2-util-linux-176303e08d7f1a7ab1211e0b4f3292d2a4648a07.zip
partx: convert hard sector size to 512-byte sectors
The msdos PT depends on a sector size (BLKSSZGET), but partx(8) counts internally with 512-byte sectors only. The dos.c has to convert start and size to 512-byte sectors. sysfs (kernel uses 512-byte sectors only): # cat /sys/block/sdb/sdb1/{start,size} 256 16128 (note that 16128 * 512 = 8257536; 8Mb) old version: # partx /dev/sdb 1: 32- 2047 ( 2016 sectors, 1 MB) ^^^^ start, end and sectors are correct, but in 4KiB sectors The size in MB is completely wrong. new version: # partx -l /dev/sdb 1: 256- 16383 ( 16128 sectors, 8 MB) start, end and sectors are converted to 512-byte sectors. The size in MB is correct now. Note that this change is important, because "partx -a" counts the size of a new partition in 512-byte sectors for all PT formats (sun, gpt, ...). Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'partx/partx.c')
0 files changed, 0 insertions, 0 deletions