[parted-devel] Warning message if create partition when a partition is mounted

Jim Meyering jim at meyering.net
Mon Oct 12 08:20:52 UTC 2009


Curtis Gedak wrote:
> Jim Meyering wrote:
>> Curtis Gedak wrote:
>>
>>> There appears to be a regression in (alpha) parted-2.0 since parted-1.9.0.
>>>
>>> Specifically something has changed that causes a warning message to be
>>> displayed when a new partition is created and at least one partition
>>> on the device is mounted.  The warning messaged displayed is:
>>>
>>>    Warning: The kernel was unable to re-read the partition table
>>>    on /dev/sdd (Device or resource busy).  This means Linux
>>>    won't know anything about the modifications you made until
>>>    you reboot.  You should reboot your computer before doing
>>>    anything with /dev/sdd.
>>>
>>> This change occurs with (alpha) parted-2.0 that was downloaded from:
>>> ftp://alpha.gnu.org/gnu/parted/parted-2.0.tar.gz
>>>
>>
>> Hi Curtis,
>>
>> Thank you for the very detailed report!
>>
>> However, shouldn't we consider it a *feature* that parted now prints
>> this warning?  In other words, isn't it risky (and worthy of a warning)
>> to modify a partition table when one or more of its partitions is mounted?
>>
> Hi Jim,
>
> Thank you for the quick response.  I agree that a warning message
> about the device being in use is probably a good idea.
>
> The difficultly I see with this warning message is that I believe that
> it is incorrect in saying that the kernel cannot re-read the partition
> table.

Ok.  This change makes the diagnostic more accurate:

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 6a3c6b3..094e8d2 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2450,12 +2450,10 @@ _kernel_reread_part_table (PedDevice* dev)
                         ped_exception_throw (
                                 PED_EXCEPTION_WARNING,
                                 PED_EXCEPTION_IGNORE,
-                        _("The kernel was unable to re-read the partition "
-                          "table on %s (%s).  This means Linux won't know "
-                          "anything about the modifications you made "
-                          "until you reboot.  You should reboot your computer "
-                          "before doing anything with %s."),
-                                dev->path, strerror (errno), dev->path);
+                        _("WARNING: the kernel failed to re-read the partition "
+                          "table on %s (%s).  As a result, it may not "
+                          "reflect all of your changes until after reboot."),
+                                dev->path, strerror (errno));
                         return 0;
                 }
         }



More information about the parted-devel mailing list