If the system is running in a read-only mode for devices and
setting devices to read-only when they appear (e.g. partition
table scans) then we need to explictely set read-write mode
on the involved devices (e.g. /dev/sdx + /dev/sdx2 if /dev/sd2
is the target partition).
Be aware that you might have to use the --skip-bootflag option
as well then, because this option triggers parted code which
is behaving bad with read-only devices.