1

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.
  • Partition /dev/sdc1 isn't mounted. There is nothing to unmount.
  • No other external drives are plugged in, folder /media/user is empty.
  • 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[854]: Cleaning up mount point /media/user/vault (device 8:17 no longer exists)
systemd[1]: media-user-vault.mount: Succeeded.
systemd[1252]: media-user-vault.mount: Succeeded.
systemd[1]: Stopping Clean the /media/user/vault mount point...
systemd[1]: clean-mount-point@media-user-vault.service: Succeeded.
systemd[1]: 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((

3
  • can you post output of dmesg -T after connecting the drive, and output of journalctl -p err ? – Michael D. Jan 8 at 12:47
  • You say "Noticed that at first drive was /dev/sda1, after I reconnected drive it became /dev/sdc1". This is so because /dev/sdX file names are not persistent. There is no guarantee that a disk always gets the same name. The solution for this is to use filesystem UUIDs or labels when mounting. I don't know your distro, but here is SUSE documentation to learn more about this subject: documentation.suse.com/sles/15-GA/html/SLES-all/cha-uuid.html. – berndbausch Jan 9 at 1:50
  • I would investigate more the error btrfs duplicate fsid. There are quite a few hits, including solutions, when searching the internet. I am also interested in the output of the lsblk and blkid commands. fsid is uuid of the filesystem that owns the block - there seem to be two BTRFS devices with the same filesystem. – berndbausch Jan 9 at 2:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.