* Unable to remove read-only seeding device from a filesystem.
@ 2014-04-09 11:00 Jan Kouba
0 siblings, 0 replies; only message in thread
From: Jan Kouba @ 2014-04-09 11:00 UTC (permalink / raw)
To: linux-btrfs
When running this script:
dd if=/dev/zero of=seed-disk.img bs=1M seek=1k count=0
dd if=/dev/zero of=test-disk.img bs=1M seek=1k count=0
# Make image of seed device
mkfs.btrfs seed-disk.img
seed_dev=`losetup -f --show seed-disk.img`
mount $seed_dev /mnt/tmp
touch /mnt/tmp/a
umount /mnt/tmp
losetup -d $seed_dev
btrfstune -S 1 seed-disk.img
# Make read-only seed device
seed_dev=`losetup -f -r --show seed-disk.img`
test_dev=`losetup -f --show test-disk.img`
mount $seed_dev /mnt/tmp
btrfs dev add $test_dev /mnt/tmp
mount -o remount,rw /mnt/tmp
# This fails
btrfs dev delete $seed_dev /mnt/tmp
# cleanup
umount /mnt/tmp
losetup -d $seed_dev
losetup -d $test_dev
rm seed-disk.img
rm test-disk.img
the command
"btrfs dev delete $seed_dev /mnt/tmp" fails with
"ERROR: error removing the device '/dev/loop0' - Permission denied" message.
If /dev/loop0 is not read-only everything works.
I tested this on ubuntu 13.10, 14.04 with stock kernel and btrfs-progs and on
ubuntu 14.04 with latest PPA kernel (3.14.0-031400-generic) and v3.14 btrfs-
progs.
Is this behaviour expected or is it a bug?
I thougt that btrfs never changes seeding devices, so I don't understand, why
it needs to be writeable in order to remove it from a filesystem.
Jan Kouba
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-04-09 11:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-09 11:00 Unable to remove read-only seeding device from a filesystem Jan Kouba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox