On Wed, 2013-11-27 at 15:37 +0100, Vratislav Podzimek wrote:
On Tue, 2013-11-26 at 10:43 -0600, David Lehman wrote:
> On Tue, 2013-11-26 at 14:57 +0100, Vratislav Podzimek wrote:
> > If there is an existing format, but we cannot recognize it we shouldn't
consider
> > it resizable.
>
> This is going to need a slightly more complicated fix. If a device is
> truly unformatted we should be able to resize it. See blivet commit
> e411bd44f47d85, which I now believe I did wrong. I think I should have
> set the name attribute -- not the type attr -- to the udev-provided
> fstype so all the places where we check for a type of None would still
> work and the UI stuff, which should use name instead of type, would all
> show something other than "Unknown".
Patch changing that sent to the list.
But still, how could we deal with the cases like the one described in
that bug? If there is a format we don't recognize how can we resize it?
If the device was truly unformatted, would it's format has the 'exists'
attribute set to True? I thought that is what makes a difference between
an unformatted device and a device with format we don't recognize.
The format exists in either case. It is ridiculous to refuse resize of
an unformatted device (IMO). The issue is this: it is impossible to
differentiate with 100% certainty an unformatted device from a device
with formatting we (or blkid) cannot understand. There are some formats
that blkid does not understand, in which case it will report an
unformatted device. In other cases, blkid reports a format type, but we
don't have a class for that type. In either case, the device ends up
with a DeviceFormat. So -- in the case of a device whose formatting is
reported to us by blkid as something we don't know what to do with,
meaning it ends up with a DeviceFormat -- that leaves us one good
option: present any type blkid reported to us in the GUI and still allow
resize -- after all, the user should be paying attention when they
repartition their disks. I do not care how many people whine to me that
"you should have hit me over the head harder while I intentionally
destroyed all of my data!" -- it is not my responsibility to keep you
from being reckless or careless.
Or would it be worth to mark devices that have the minSize = size as
"Not resizable"? That would also resolve that bug though in a completely
different way.
I think we should show the type reported by blkid (if any), allow
resize, and let people take responsibility for their own actions.
David