Re: fdisk does not allow overwrite default/suggested value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 16, 2019 at 03:10:26PM +0200, Istvan Gabor wrote:
> Dear util-linux developers:
> 
> I'v been using cfdisk and fdisk for a long time.
> Currently I have util-linux 2.31.1 in openSUSE Leap 42.3.
> 
> Recently I've run into this issue:
> 
> I use USB hard drive docker and the system gets
> false optimal_io_size values for hard drives.
> 
> For a detailed description of the problem, see:
> 
> Linux SSD partition alignment – problems with external USB-to-SATA
> controllers – I
> 
> https://linux-blog.anracom.com/2018/12/03/linux-ssd-partition-alignment-problems-with-external-usb-to-sata-controllers-i/
> 
> I wanted to use fdisk for partitioning a 1 TB disk.
> fdisk wanted to start the first partition at sector
> 65535 (based on the wrong optimal_io_size value, I
> guess). I tried to overwrite the suggested value with
> 2048 but got "value out of range" error.

Since v2.27 we use this patch:
https://github.com/karelzak/util-linux/commit/acb7651f8897ae73d0f45dd75bc87630001c61b9

to ignore misaligned optimal I/O size, so the question is why your
fdisk follows 65535 (it would be nice to have output from 
"LIBFDISK_DEBUG=all fdisk -l <device>").

Anyway, you can move begin of the first partition in expert menu ('x')
by command 'b'.

It's also possible to use --sector-size, this option overrides logical
and physical sector size, and internally used io-size.

> My point is that fdisk insist to use its suggested
> value and don't let the user set other value.
> 
> In my opinion it is a bad policy, the program
> should allow to overwrite the suggested value
> and use it. If it is dangerous, then there should

It would be possible to add --set-io-{min,opt,...} command line
options, I'll think about it but it's Pandora's box...

> be a specific option to enable the behavior or
> double check if the user really wants to use the
> value entered. But it should be possible to use
> other values than the offered ones, especially if the
> offered value is wrong.

The problem is that the rest of the system (mkfs, LUKS, DM/lvm, ...)
still see wrong IO limits. The right way is to fix kernel.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux