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

Curtis Gedak gedakc at gmail.com
Tue Oct 13 17:22:59 UTC 2009


Jim Meyering wrote:
> 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;
>                  }
>          }
>   

Hi Jim,

By changing the text of this message, the meaning is indeed clarified.

There is still something in the back of my mind that says to me that the 
error message is merely a symptom of a change introduced in a different 
location in the code.

Of course this hunch is kind of wishy-washy to know exactly what to 
investigate.  :-\

I have quite a few things on my plate to do with GParted now, but 
hopefully soon I will have some time to try to follow up on this hunch.




More information about the parted-devel mailing list