linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: ERROR: ioctl(DEV_REPLACE_START) failed on "/mnt": Read-only file system
@ 2016-07-13 10:24 Tamas Baumgartner-Kis
  2016-07-13 16:28 ` Chris Murphy
  0 siblings, 1 reply; 4+ messages in thread
From: Tamas Baumgartner-Kis @ 2016-07-13 10:24 UTC (permalink / raw)
  To: linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 2102 bytes --]

Hi Duncan,

many many thanks for your nice explanation and pointing it out
what could happened.

> This reveals the problem.  You have single chunks in addition
> to the raid1 chunks.  Current btrfs will refuse to mount
> writable with a device missing in such a case, in ordered
> to prevent further damage.


> But meanwhile, while the above btrfs fi df reveals
> the problem as we see it on the existing filesystem,
> it says nothing about how it got that way.  Your
> sequence above doesn't mention mounting the
> degraded raid1 writable once, for it to create those
> single-mode chunks that are now blocking writable
> mount, but that's one way it could have happened.


You're right, I booted first in to the installed system on the harddisk
and ended up in the rescueshell because obviously the "degraded" option
in the fstab is missing. So I mounted the harddisk manually with
the "degraded" option. But after that I decided to do the repairing
in a LiveSystem... I assume that is where the problem come from.
Because in the LiveSystem I wasn't able to mount the harddisk only
with the degraded option.

So as you mentioned either you fix the missing harddisk during the
running of the System or after that you have one shot (for example in
a LiveSystem), otherwise you have to copy from the readonly mounted
harddisk.

> Another way would be if the balance-conversion from
> single mode to raid1 never properly completed in the
> first place.  But I'm assuming it did and that you
> had a full raid1 btrfs fi df report at one point.

> A third way would be if some other bug triggered
> btrfs to suddenly start writing single mode
> chunks.  There were some bugs like that in the
> past, but they've been fixed for some time.  But
> perhaps there are similar newer bugs, or perhaps
> you ran the filesystem on an old kernel with
> that bug.

Thank you and kind regards
    Tamas Baumgartner-Kis

-- 
Tamás Baumgartner-Kis
Rechenzentrum der Universität Freiburg
Phone: +49 761 203 4605
E-Mail: Tamas.Baumgartner-Kis@rz.uni-freiburg.de


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5264 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread
* ERROR: ioctl(DEV_REPLACE_START) failed on "/mnt": Read-only file system
@ 2016-07-12 11:46 Tamas Baumgartner-Kis
  2016-07-13  7:21 ` Duncan
  0 siblings, 1 reply; 4+ messages in thread
From: Tamas Baumgartner-Kis @ 2016-07-12 11:46 UTC (permalink / raw)
  To: linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 2573 bytes --]

Hi,


I have a problem with the current BTRFS 4.6


I'm running a Archlinux in a KVM to test BTRFS.

First I played with one device and subvolumes.

After that I added a second device to make a raid1.

# btrfs device add /dev/sdb /mnt
# btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt


To make a stresstest I removed the first device and wanted to
boot, but unfortunately the system couldn't boot.

So I booted into a liveSystem:

#uname -a
Linux archiso 4.6.3-1-ARCH #1 SMP PREEMPT Fri Jun 24 21:19:13 CEST 2016
x86_64 GNU/Linux

First I tried to mount the "leftover" device with the degraded option

# mount -o degraded /dev/sda /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sda,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.


but this works only if I also use the read-only option.

# mount -oro,degraded /dev/sda /mnt

If I try then to replace the missing device I got an error

# btrfs replace start -B 1 /dev/sdb /mnt
ERROR: ioctl(DEV_REPLACE_START) failed on "/mnt": Read-only file system

Hire are some additional info about the system

#  btrfs --version
btrfs-progs v4.6



# btrfs fi show
Label: 'hdd0'  uuid: 97b5c51a-65d3-4a84-9382-9b99756ca4ab
	Total devices 2 FS bytes used 1.09GiB
	devid    2 size 10.00GiB used 3.56GiB path /dev/sda
	*** Some devices missing



# btrfs fi df /mnt
Data, RAID1: total=2.00GiB, used=1.04GiB
Data, single: total=1.00GiB, used=640.00KiB
System, RAID1: total=32.00MiB, used=16.00KiB
System, single: total=32.00MiB, used=0.00B
Metadata, RAID1: total=256.00MiB, used=54.02MiB
Metadata, single: total=256.00MiB, used=256.00KiB
GlobalReserve, single: total=32.00MiB, used=0.00B



# dmesg
[ 9753.746858] BTRFS info (device sda): allowing degraded mounts
[ 9753.746863] BTRFS info (device sda): disk space caching is enabled
[ 9753.746865] BTRFS: has skinny extents
[ 9753.819035] BTRFS: missing devices(1) exceeds the limit(0), writeable
mount is not allowed
[ 9753.838758] BTRFS: open_ctree failed
[ 9800.077556] BTRFS info (device sda): allowing degraded mounts
[ 9800.077561] BTRFS info (device sda): disk space caching is enabled
[ 9800.077562] BTRFS: has skinny extents


Is this a mistake I'm doing or is this some how a bug?

Kind Regards
    Tamas Baumgartner-Kis

-- 
Tamás Baumgartner-Kis
Rechenzentrum der Universität Freiburg
Phone: +49 761 203 4605
E-Mail: Tamas.Baumgartner-Kis@rz.uni-freiburg.de


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5264 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-13 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-13 10:24 ERROR: ioctl(DEV_REPLACE_START) failed on "/mnt": Read-only file system Tamas Baumgartner-Kis
2016-07-13 16:28 ` Chris Murphy
  -- strict thread matches above, loose matches on Subject: below --
2016-07-12 11:46 Tamas Baumgartner-Kis
2016-07-13  7:21 ` Duncan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).