From 422f0e9f206a145c59a71333dad20d38cbbfc0c4 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 22 Jan 2019 11:50:20 +0100 Subject: losetup: properly use --sector-size when create a new device The --partscan functionality depends on sector size. Make sure sector size is set before we force kernel to scan the device for partitions. For example: losetup -f loopfile --sector-size 4KiB --partscan --show where 'loopfile' contains GPT with 4096 sectors. Reported-by: Jeffrey Ferreira Signed-off-by: Karel Zak --- sys-utils/losetup.8 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys-utils/losetup.8') diff --git a/sys-utils/losetup.8 b/sys-utils/losetup.8 index c31d7475f..1195c697e 100644 --- a/sys-utils/losetup.8 +++ b/sys-utils/losetup.8 @@ -124,7 +124,9 @@ Force the loop driver to reread the size of the file associated with the specified loop device. .TP .BR \-P , " \-\-partscan" -Force the kernel to scan the partition table on a newly created loop device. +Force the kernel to scan the partition table on a newly created loop device. Note that the +partition table parsing depends on sector sizes. The default is sector size is 512 bytes, +otherwise you need to use use the option \fB\-\-sector\-size\fR together with \fB\-\-partscan\fR. .TP .BR \-r , " \-\-read\-only" Set up a read-only loop device. -- cgit v1.2.3-55-g7522