I've been working with files on external drive (partition table GPT, file system BTRFS). For some reason drive turned off and now I can't remount it. Whatever I do this error shows up:
Error mounting /dev/sdc1 at /media/user/vault: mount(2) system call failed: File exists (udisks-error-quark, 0)
I've read similar questions and all of them either don't provide answer or not helpful.
- Disconnecting drive physically and reconnecting it again doesn't work.
/dev/sdc1isn't mounted. There is nothing to unmount.
- No other external drives are plugged in, folder
- Only full system reboot resolves problem, but I am losing all progress and have to start over.
UPD 1: Did a full system reboot 3rd time. Made sure system doesn't go to sleep. Still... drive disconnected, this time after 5% progress vs around 20% first two times. Noticed that at first drive was
/dev/sda1, after I reconnected drive it became
/dev/sdc1. Could this be reason why it's not remounting? And how to fix it? I need to mount drive in same path.
UPD 2: Found in journalctl:
BTRFS warning (device sdb1): duplicate device fsid:devid for <drive-uuid>:1 old:/dev/sdb1 new:/dev/sdc1. Also in logs are continuous BTRFS errors trying to read sdb1, as if it thinks it's still connected:
BTRFS error (device sdb1): bdev /dev/sdb1 errs: wr 0, rd 372, flush 0, corrupt 0, gen 0.
UPD 3: This seams relevant: BTRFS warning (device sda1): duplicate device fsid:devid. So two problems: (1) external disk powering down for no reason, (2) BTRFS fails to recognize that this is same disk, because device path changes.
UPD 4: Why duplicate device is warning, it seems it should be error...
UPD 5: Messages in moment of drive disconnect. Nothing that suggests why drive disconnected...
kernel: usb 2-2: USB disconnect, device number 4 kernel: xhci_hcd 0000:00:14.0: WARN Set TR Deq Ptr cmd failed due to incorrect slot or ep state. kernel: sd 1:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK udisksd: Cleaning up mount point /media/user/vault (device 8:17 no longer exists) systemd: media-user-vault.mount: Succeeded. systemd: media-user-vault.mount: Succeeded. systemd: Stopping Clean the /media/user/vault mount point... systemd: email@example.com: Succeeded. systemd: Stopped Clean the /media/user/vault mount point.
P.S. what is difference between journalctl and dmesg? Output is the same.
UPD 6: Another related post. But still no answer on how to solve it problem (2). Maybe you can tell BTRFS that drive is disconnected, or change device path. Didn't expected to run in such problem with BTRFS... ((
UPD 7: It seams you can reconnect drive without reboot, but unclear why. Maybe if there are read requests for file that was on recently disconnected drive btrfs expects drive to come back and with same device path. But if requests stop for some time, it deletes info about 'old' device and allows remount.
UPD 8: Time between stoping script that read disk and remount is less then retry time. Possibly process that read data must be killed, which is very sad((