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

Petr Uzel petr.uzel at suse.cz
Wed Dec 2 14:40:09 UTC 2009


Hi all,

On Tue, Oct 20, 2009 at 12:10:30AM +0200, Karel Zak wrote:
> On Mon, Oct 19, 2009 at 02:29:36PM -0600, Curtis Gedak wrote:
> >
> > I assume (and I could be wrong here) that the kernel _can_ re-read the  
> > partition table because I am able to format and mount the newly created  
> > partition without a reboot.  This leads me to believe that the return  
> 
>  You can't successfully call the BLKRRPAR ioclt if there is any open
>  (used partition) -- see fs/partitions/check.c in Linux kernel. Try:
> 
>    # blockdev --rereadpt /dev/sda
>    BLKRRPART: Device or resource busy
> 
>  but you can use BLKPG_ADD_PARTITION or BLKPG_DEL_PARTITION (it means
>  explicitly add / remove the partition).

Yes, but this exactly the functionality that commit
[1d8f9bece138e4d8e58f7b059b4195aff6f39deb linux-commit: remove the use of the BLKPG ioctl]
removed from parted.

>  See libparted/arch/linux.c. It seems that BLKPG ioctls are preferred
>  method and BLKRRPAR is fallback solution only.

That's no longer true (due to that commit).

I agree that issuing a warning when modifying partition table on disk
where some of the partitions are mounted is a good idea, however,
exactly as Curtis pointed out, parted lost the ability to e.g. add new
partition to the end of disk without a reboot, which I consider a
regression.

Just an idea: perhaps parted could selectively call BLKPG ioctls after
each operation instead of deleting/adding all partitions at once as
before. This could be also done only if there are some partitions
mounted and thus BLKRRPART is not an option. What do you think?


-- 
Best regards / s pozdravem

Petr Uzel, openSUSE Boosters Team
-----------------------------------------------------------------
SUSE LINUX, s.r.o.                          e-mail: puzel at suse.cz
Lihovarská 1060/12                          http://www.suse.cz
190 00 Prague 9, CR                             
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20091202/b7a278dc/attachment.pgp>


More information about the parted-devel mailing list