Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to mount external hard disk #1217

Closed
Fabioamd87 opened this issue Nov 13, 2023 · 15 comments
Closed

Unable to mount external hard disk #1217

Fabioamd87 opened this issue Nov 13, 2023 · 15 comments

Comments

@Fabioamd87
Copy link

Fabioamd87 commented Nov 13, 2023

When I try to mount an external hard disk, a toshiba MK1652GSX connected with a sata<-> usb3 adapter I get this error:

immagine

this error in udisksctl monitor:

fabio@Abulafia:/media/fabio$ udisksctl monitor
Monitoring the udisks daemon. Press Ctrl+C to exit.
15:07:47.196: The udisks-daemon is running (name-owner :1.9).
15:07:49.033: Added /org/freedesktop/UDisks2/jobs/39
  org.freedesktop.UDisks2.Job:
    Bytes:              0
    Cancelable:         true
    ExpectedEndTime:    0
    Objects:            /org/freedesktop/UDisks2/block_devices/sdd1
    Operation:          filesystem-mount
    Progress:           0.0
    ProgressValid:      false
    Rate:               0
    StartTime:          1699884469029754
    StartedByUID:       0
15:07:49.039: /org/freedesktop/UDisks2/jobs/39: org.freedesktop.UDisks2.Job::Completed (false, 'mount(2) system call failed: No such file or directory')
15:07:49.039: Removed /org/freedesktop/UDisks2/jobs/39

Before this disk was correctly mounted, I can't really understand what could be the issue and how to solve it.
I am using Ubuntu 23.10

I can mount correctly this drive into a folder in my home directory with "sudo mount /dev/sdd1 HD160Gb"
Also creating manually the folder in /media/fabio/ doesn't chage the issue.

Let me know if you need additional details,
thanks

@ondrejholy
Copy link
Contributor

As per https://ubuntuforums.org/showthread.php?t=2492979&p=14167581#post14167581, it seems that udisks package downgrade fixes the issue, so it seems to be regression here...

@Fabioamd87
Copy link
Author

@ondrejholy I think you are right.
I've posted this topic 3 weeks ago, do you think we are going to get a feedback or this is not the right channel to address the issue?

@tbzatek
Copy link
Member

tbzatek commented Dec 5, 2023

Please post udisksctl dump and udevadm info /dev/sdd + udevadm info /dev/sdd1. Does mounting other removable devices (e.g. USB flash drives) work for you?

@Fabioamd87
Copy link
Author

Fabioamd87 commented Dec 5, 2023

Hello, I did it on /dev/sde (the drives that gives the problem)
udisksctl_dump.txt

fabio@Abulafia:~$ udevadm info /dev/sde
P: /devices/pci0000:00/0000:00:0a.0/0000:03:00.0/usb11/11-2/11-2:1.0/host8/target8:0:0/8:0:0:0/block/sde
M: sde
U: block
T: disk
D: b 8:64
N: sde
L: 0
S: disk/by-id/usb-TOSHIBA_MK1652GSX_5A384D45465142335320202020202020-0:0
S: disk/by-path/pci-0000:03:00.0-usb-0:2:1.0-scsi-0:0:0:0
S: disk/by-diskseq/16
Q: 16
E: DEVPATH=/devices/pci0000:00/0000:00:0a.0/0000:03:00.0/usb11/11-2/11-2:1.0/host8/target8:0:0/8:0:0:0/block/sde
E: DEVNAME=/dev/sde
E: DEVTYPE=disk
E: DISKSEQ=16
E: MAJOR=8
E: MINOR=64
E: SUBSYSTEM=block
E: USEC_INITIALIZED=3159592
E: ID_BUS=usb
E: ID_MODEL=MK1652GSX
E: ID_MODEL_ENC=MK1652GSX\x20\x20\x20\x20\x20\x20\x20
E: ID_MODEL_ID=3940
E: ID_SERIAL=TOSHIBA_MK1652GSX_5A384D45465142335320202020202020-0:0
E: ID_SERIAL_SHORT=5A384D45465142335320202020202020
E: ID_VENDOR=TOSHIBA
E: ID_VENDOR_ENC=TOSHIBA\x20
E: ID_VENDOR_ID=13fd
E: ID_REVISION=0309
E: ID_TYPE=disk
E: ID_INSTANCE=0:0
E: ID_USB_MODEL=MK1652GSX
E: ID_USB_MODEL_ENC=MK1652GSX\x20\x20\x20\x20\x20\x20\x20
E: ID_USB_MODEL_ID=3940
E: ID_USB_SERIAL=TOSHIBA_MK1652GSX_5A384D45465142335320202020202020-0:0
E: ID_USB_SERIAL_SHORT=5A384D45465142335320202020202020
E: ID_USB_VENDOR=TOSHIBA
E: ID_USB_VENDOR_ENC=TOSHIBA\x20
E: ID_USB_VENDOR_ID=13fd
E: ID_USB_REVISION=0309
E: ID_USB_TYPE=disk
E: ID_USB_INSTANCE=0:0
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usb-storage
E: ID_PATH=pci-0000:03:00.0-usb-0:2:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=pci-0000_03_00_0-usb-0_2_1_0-scsi-0_0_0_0
E: ID_PART_TABLE_UUID=7dedf3c2-56bb-4966-808c-66917387f5c7
E: ID_PART_TABLE_TYPE=gpt
E: DEVLINKS=/dev/disk/by-id/usb-TOSHIBA_MK1652GSX_5A384D45465142335320202020202020-0:0 /dev/disk/by-path/pci-0000:03:00.0-usb-0:2:1.0-scsi-0:0:0:0 /dev/disk/by-diskseq/16
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:

fabio@Abulafia:~$ 
fabio@Abulafia:~$ udevadm info /dev/sde1
P: /devices/pci0000:00/0000:00:0a.0/0000:03:00.0/usb11/11-2/11-2:1.0/host8/target8:0:0/8:0:0:0/block/sde/sde1
M: sde1
R: 1
U: block
T: partition
D: b 8:65
N: sde1
L: 0
S: disk/by-path/pci-0000:03:00.0-usb-0:2:1.0-scsi-0:0:0:0-part1
S: disk/by-uuid/FAD4870BD486C8F9
S: disk/by-diskseq/16-part1
S: disk/by-label/HD160Gb
S: disk/by-partlabel/HD160Gb
S: disk/by-partuuid/914fa450-ff6c-4cb6-b0fe-170c21e2c892
S: disk/by-id/usb-TOSHIBA_MK1652GSX_5A384D45465142335320202020202020-0:0-part1
Q: 16
E: DEVPATH=/devices/pci0000:00/0000:00:0a.0/0000:03:00.0/usb11/11-2/11-2:1.0/host8/target8:0:0/8:0:0:0/block/sde/sde1
E: DEVNAME=/dev/sde1
E: DEVTYPE=partition
E: DISKSEQ=16
E: PARTN=1
E: PARTNAME=HD160Gb
E: MAJOR=8
E: MINOR=65
E: SUBSYSTEM=block
E: USEC_INITIALIZED=3325557
E: ID_BUS=usb
E: ID_MODEL=MK1652GSX
E: ID_MODEL_ENC=MK1652GSX\x20\x20\x20\x20\x20\x20\x20
E: ID_MODEL_ID=3940
E: ID_SERIAL=TOSHIBA_MK1652GSX_5A384D45465142335320202020202020-0:0
E: ID_SERIAL_SHORT=5A384D45465142335320202020202020
E: ID_VENDOR=TOSHIBA
E: ID_VENDOR_ENC=TOSHIBA\x20
E: ID_VENDOR_ID=13fd
E: ID_REVISION=0309
E: ID_TYPE=disk
E: ID_INSTANCE=0:0
E: ID_USB_MODEL=MK1652GSX
E: ID_USB_MODEL_ENC=MK1652GSX\x20\x20\x20\x20\x20\x20\x20
E: ID_USB_MODEL_ID=3940
E: ID_USB_SERIAL=TOSHIBA_MK1652GSX_5A384D45465142335320202020202020-0:0
E: ID_USB_SERIAL_SHORT=5A384D45465142335320202020202020
E: ID_USB_VENDOR=TOSHIBA
E: ID_USB_VENDOR_ENC=TOSHIBA\x20
E: ID_USB_VENDOR_ID=13fd
E: ID_USB_REVISION=0309
E: ID_USB_TYPE=disk
E: ID_USB_INSTANCE=0:0
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usb-storage
E: ID_PATH=pci-0000:03:00.0-usb-0:2:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=pci-0000_03_00_0-usb-0_2_1_0-scsi-0_0_0_0
E: ID_PART_TABLE_UUID=7dedf3c2-56bb-4966-808c-66917387f5c7
E: ID_PART_TABLE_TYPE=gpt
E: ID_FS_LABEL=HD160Gb
E: ID_FS_LABEL_ENC=HD160Gb
E: ID_FS_BLOCKSIZE=4096
E: ID_FS_SIZE=160039960064
E: ID_FS_UUID=FAD4870BD486C8F9
E: ID_FS_UUID_ENC=FAD4870BD486C8F9
E: ID_FS_TYPE=ntfs
E: ID_FS_USAGE=filesystem
E: ID_PART_ENTRY_SCHEME=gpt
E: ID_PART_ENTRY_NAME=HD160Gb
E: ID_PART_ENTRY_UUID=914fa450-ff6c-4cb6-b0fe-170c21e2c892
E: ID_PART_ENTRY_TYPE=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
E: ID_PART_ENTRY_NUMBER=1
E: ID_PART_ENTRY_OFFSET=2048
E: ID_PART_ENTRY_SIZE=312578048
E: ID_PART_ENTRY_DISK=8:64
E: DEVLINKS=/dev/disk/by-path/pci-0000:03:00.0-usb-0:2:1.0-scsi-0:0:0:0-part1 /dev/disk/by-uuid/FAD4870BD486C8F9 /dev/disk/by-diskseq/16-part1 /dev/disk/by-label/HD160Gb /dev/disk/by-partlabel/HD160Gb /dev/disk/by-partuuid/914fa450-ff6c->
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:

fabio@Abulafia:~$ 

I have no issue mouting another external 1Tb hard drive:

sda      8:0    1     0B  0 disk 
sdb      8:16   0 223,6G  0 disk 
├─sdb1   8:17   0   512M  0 part /boot/efi
└─sdb2   8:18   0 223,1G  0 part /var/snap/firefox/common/host-hunspell
                                 /
sdc      8:32   0 931,5G  0 disk 
├─sdc1   8:33   0   128M  0 part 
├─sdc2   8:34   0   529M  0 part 
├─sdc3   8:35   0   100M  0 part 
└─sdc4   8:36   0 930,8G  0 part 
sdd      8:48   0 931,5G  0 disk 
└─sdd1   8:49   0 931,5G  0 part /media/fabio/Toshiba
sde      8:64   0 149,1G  0 disk 
└─sde1   8:65   0   149G  0 part 
sr0     11:0    1  1024M  0 rom  
fabio@Abulafia:~$ 

@tbzatek
Copy link
Member

tbzatek commented Dec 5, 2023

Thanks for the dumps. I see you have ntfs filesystem there. When the error happens, is there anything related in dmesg? UDisks tries mounting with ntfs3 first and then falls back to a generic ntfs which, depending on your system, might get picked up either by ntfs-3g fuse driver or the legacy ntfs kernel filesystem driver.

You may also try running mount -t ntfs3 /dev/sde1 HD160Gb to see what difference the explicit filesystem type makes.

@Fabioamd87
Copy link
Author

yes I have 2 external NTFS disks, one works the other no.
the only difference I see it that one is an "official" external hard drive (with the enclosure and all)
the other is an home made external drive made with an 2,5"hard drive connected with a SATA <-> USB drive
the first is MBR format, the second is GPT.
I will post the output as soon as I go back home from work.

@Fabioamd87
Copy link
Author

I know to that doesn't make sense but when I try to mount from command line, I get instanctly this output in dmesg:

[  175.808180] audit: type=1107 audit(1701797341.587:239): pid=1360 uid=101 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_signal"  bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.DBus.Properties" member="PropertiesChanged" name=":1.2" mask="receive" pid=3938 label="snap.firefox.firefox" peer_pid=1436 peer_label="unconfined"
                exe="/usr/bin/dbus-daemon" sauid=101 hostname=? addr=? terminal=?'
[  175.817301] audit: type=1107 audit(1701797341.599:240): pid=1360 uid=101 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_signal"  bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.DBus.Properties" member="PropertiesChanged" name=":1.2" mask="receive" pid=3938 label="snap.firefox.firefox" peer_pid=1436 peer_label="unconfined"
                exe="/usr/bin/dbus-daemon" sauid=101 hostname=? addr=? terminal=?'

mounting with -t ntfs3 gives me an error, but nothing is printed when monitoring with dmesg -w
if I mount with no flags it works, still no messages in dmesg

fabio@Abulafia:~$ sudo mount -t ntfs3 /dev/sde1 HD160Gb/
mount: /home/fabio/HD160Gb: mount(2) system call failed: File o directory non esistente.
       dmesg(1) may have more information after failed mount system call.
fabio@Abulafia:~$ sudo mount /dev/sde1 HD160Gb/
fabio@Abulafia:~$ sudo umount /dev/sde1

fabio@Abulafia:~$

@tbzatek
Copy link
Member

tbzatek commented Dec 6, 2023

Weird. Can you try couple more things?

  1. try running depmod -a first
  2. does sudo mount -t ntfs3xxx /dev/sde1 HD160Gb/ give you the same error? You should get unknown filesystem type 'ntfs3xxx'.
  3. you mentioned the second drive that works properly. Does mounting work on it with -t ntfs3? (in case the filesystem is ntfs)
  4. does file /lib/modules/`uname -r`/kernel/fs/ntfs3/ntfs3.ko work for you?
  5. what is your kernel and util-linux version?

@Fabioamd87
Copy link
Author

Fabioamd87 commented Dec 6, 2023

  1. tried, no output is given
fabio@Abulafia:~$ sudo mount -t ntfs3xxx /dev/sde1 HD160Gb/
mount: /home/fabio/HD160Gb: unknown filesystem type 'ntfs3xxx'.
       dmesg(1) may have more information after failed mount system call.
  1. it mounts with no issues
fabio@Abulafia:~$ sudo mount -t ntfs3 /dev/sdd1 HD160Gb/
fabio@Abulafia:~$
fabio@Abulafia:~$ file /lib/modules/`uname -r`/kernel/fs/ntfs3/ntfs3.ko
/lib/modules/6.5.0-13-generic/kernel/fs/ntfs3/ntfs3.ko: cannot open `/lib/modules/6.5.0-13-generic/kernel/fs/ntfs3/ntfs3.ko' (No such file or directory)
fabio@Abulafia:~$

Kernel version: 6.5.0-13-generic
Package: util-linux Version: 2.39.1-4ubuntu2

@tbzatek
Copy link
Member

tbzatek commented Dec 7, 2023

Thanks, the expected error on unknown filesystem type looks good. This appears to be a problem on your system really. If a standalone mount command fails, then it has nothing to do with UDisks. You may still opt for using ntfs-3g fuse driver instead and configure UDisks accordingly: http://storaged.org/doc/udisks2-api/latest/mount_options.html

However, this issue (mount failing on a certain drive with a certain filesystem type) should be brought in attention to your distribution support.

You may also try running LIBMOUNT_DEBUG=all mount -t ntfs3 /dev/sde1 HD160Gb/ to see if there's anything interesting in there. Try this as root, mounting outside of home directories.

@jonnygrant
Copy link

I wonder if my NTFS drive issue is related.

https://gitlab.gnome.org/GNOME/gnome-disk-utility/-/issues/320#note_1938581

I have two USB NTFS drives, only one faces a problem

@Fabioamd87
Copy link
Author

Fabioamd87 commented Dec 9, 2023

Hello @jonnygrant I thinks yes!
I run Windows disk repair tools and it founds some issue on the disk (see attachment).
disk error.txt
Gnome disk repair tools was unable to find this issue.
Now it's automounted and i can mount it with/without the flag:

fabio@Abulafia:~$ sudo udisksctl mount -b /dev/sdd1
[sudo] password di fabio: 
Mounted /dev/sdd1 at /media/root/HD160Gb
fabio@Abulafia:~$ 
fabio@Abulafia:~$ 
fabio@Abulafia:~$ 
fabio@Abulafia:~$ sudo udisksctl unmount -b /dev/sdd1
Unmounted /dev/sdd1.
fabio@Abulafia:~$ 
fabio@Abulafia:~$ 
fabio@Abulafia:~$ 
fabio@Abulafia:~$ sudo udisksctl mount -t ntfs -b /dev/sdd1
Mounted /dev/sdd1 at /media/root/HD160Gb
fabio@Abulafia:~$ 
fabio@Abulafia:~$ 
fabio@Abulafia:~$ sudo udisksctl unmount -b /dev/sdd1
Unmounted /dev/sdd1.
fabio@Abulafia:~$ 
fabio@Abulafia:~$ 
fabio@Abulafia:~$ 
fabio@Abulafia:~$ 

Thanks for the hint!

@tbzatek I think we have a lesson learned in our troubleshooting steps.

@tbzatek
Copy link
Member

tbzatek commented Dec 11, 2023

I wonder if my NTFS drive issue is related.

https://gitlab.gnome.org/GNOME/gnome-disk-utility/-/issues/320#note_1938581

I've just replied you in that ticket. The eject issue is worth checking in detail, it's a separate issue however. For the rest of the points raised there, they're mostly common what was discussed here.

I.e. the issues are in lower layers below UDisks. If the standalone mount command fails, there's nothing we can do in UDisks either.

@tbzatek
Copy link
Member

tbzatek commented Dec 11, 2023

Hello @jonnygrant I thinks yes! I run Windows disk repair tools and it founds some issue on the disk (see attachment). disk error.txt Gnome disk repair tools was unable to find this issue. Now it's automounted and i can mount it with/without the flag:

Wow!

"chkdsk /scan" is aborting due to self-healing command failure: 0xc0000102
An unspecified error occurred (6e74667363686b2e 1285).

I think the linux tools can learn from this verbosity.

Anyway, this is not really a UDisks issue, closing.

@tbzatek tbzatek closed this as completed Dec 11, 2023
@jonnygrant
Copy link

Hello @jonnygrant I thinks yes! I run Windows disk repair tools and it founds some issue on the disk (see attachment). disk error.txt Gnome disk repair tools was unable to find this issue. Now it's automounted and i can mount it with/without the flag:

Wow!

"chkdsk /scan" is aborting due to self-healing command failure: 0xc0000102
An unspecified error occurred (6e74667363686b2e 1285).

I think the linux tools can learn from this verbosity.

Anyway, this is not really a UDisks issue, closing.

That chap's NTFS drive looks like it is failing from that log. It's luck it mounts at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants