4

Since yesterday I've been unable to mount an external hard drive using either the taskbar, or the file manager (Dolphin) which shows me the following error:

Error mounting /dev/sdf2 at /run/media/username/Backup Plus: wrong fs type, bad option, bad superblock on /dev/sdf2, missing codepage or helper program, or other error

The drive's name ("Backup Plus", the brand's name) does have a space in it, but this hasn't historically been a problem.

The drive is in NTFS. It shows up in GParted, and I can mount it through the terminal with the following command:

sudo mount /dev/sdf2 temp

I don't even need to specify the filesystem. Though if I try to mount it without setting a corresponding folder (~/temp, in this case), the command fails, telling me the drive can't be found in fstab (which is normal; I haven't added an entry for it).

I'm fairly sure there was a sizeable list of program updates either the same day the issue appeared, or the day before (so prior to a reboot). There were also other problems with the drive initially, which a CHKDSK command on my Windows partition seemed to solve.

What would prevent the drive from mounting? Is the system somehow assuming or detecting the wrong filesystem when connecting the device through the interface?

Thank you.

Edit: according to the fdisk -l command, the partition table entries are not in disk order. Apparently this isn't too serious, but I wonder if it may be relevant.

Edit: here is the output of fdisk -l /dev/sdf2 (the partition):

Disk /dev/sdf2: 3,64 TiB, 4000575389696 bytes, 7813623808 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x6c727443

Device      Boot      Start        End    Sectors   Size Id Type
/dev/sdf2p1      1970237472 3672215697 1701978226 811,6G 75 PC/IX
/dev/sdf2p2      1929382413 3883035520 1953653108 931,6G 72 unknown
/dev/sdf2p3               0          0          0     0B  0 Empty
/dev/sdf2p4        27394442   27394879        438   219K  0 Empty

Partition 2 does not start on physical sector boundary.
Partition 4 does not start on physical sector boundary.
Partition table entries are not in disk order.

Edit: output for sudo fdisk -l /dev/sdf (the full drive)

GPT PMBR size mismatch (4294967294 != 7814037166) will be corrected by write.
Disk /dev/sdf: 3,64 TiB, 4000787029504 bytes, 7814037167 sectors
Disk model: BUP Portable    
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: EE9D3032-782B-4064-A29D-CAB337DCA488

Device      Start        End    Sectors  Size Type
/dev/sdf1      40     409639     409600  200M EFI System
/dev/sdf2  411648 7814035455 7813623808  3,6T Microsoft basic data

Output for gdisk -l /dev/sdf:

GPT fdisk (gdisk) version 1.0.9.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdf: 7814037167 sectors, 3.6 TiB
Model: BUP Portable    
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): EE9D3032-782B-4064-A29D-CAB337DCA488
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 7814037133
Partitions will be aligned on 8-sector boundaries
Total free space is 3692 sectors (1.8 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40          409639   200.0 MiB   EF00  EFI System Partition
   2          411648      7814035455   3.6 TiB     0700  
6
  • 1
    I'm just guessing here, but I wonder if the difference is that Dolphin (via udisks2) uses the ntfs3 kernel module, whereas mount uses ntfs-3g? See for example NTFS keeps breaking on arch linux. Is it possible that the volume is marked "dirty"? Dec 3, 2023 at 0:21
  • The output of fdisk -l would be a good addition to your question
    – xhienne
    Dec 3, 2023 at 0:21
  • @steeldriver Thank you. Indeed, the drive is marked as dirty. I mentioned earlier that I ran CHKDSK in Windows; the output states in step 4 that there wasn't enough disk space to fix damaged clusters, but ends by saying Windows made corrections to the filesystem, and no more actions are required. Maybe the cluster issues prevented the drive from being marked as clean? I'm tempted to try "ntfsfix -d" to clear the dirty flag, but maybe I should run CHKDSK again first to see the results. Unfortunately the last check took around 13 hours to complete, so I don't think I can try again right away.
    – Julien
    Dec 3, 2023 at 2:56
  • @xhienne Right, I just added the output to the initial post.
    – Julien
    Dec 3, 2023 at 2:57
  • @Julien This is not the output of fdisk -l /dev/sdf2 that is needed here, but the output of fdisk -l /dev/sdf (sdf is the disk, sdf2 is a partition)
    – xhienne
    Dec 3, 2023 at 18:02

2 Answers 2

2

I'd try the following.

1: What NTFS driver is used?

There is an older, more stable ntfs-3g, and there's newer, ntfs3. Right now (2023) there isn't a consensus on which to use, some distros have already migrated to the newer, some stay on the older, some might switch back and forth depending on the bugs discovered in ntfs3. I myself experienced a sudden driver change recently on Fedora.

How to check: after successfully mounting, execute mount without parameters and find your partition in the output. If it says type fuseblk, it's the older ntfs-3g, if ntfs3, it's the newer one.

By the way, if that NTFS holds your important data, you might want to wait with ntfs3 for some time. E.g. see why Debian isn't using ntfs3, although people request it: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998627

2: Is everything OK with udisks2?

Dolphin uses the helper udisks2 to mount volumes. The config is in /etc/udisks2/. If you don't have mount_options.conf there, udisks2 uses the built-in defaults, but you can read through mount_options.conf.example and create your config file. Relevant options would be ntfs_drivers (influencing the driver choice) and ntfs_defaults (driver-specific, fine-grained).

BTW, you can have different setups for this specific NTFS volume and just any other attached NTFS. Read through mount_options.conf.example if you're interested.

3: How were successful mounts performed in the past, and what's the difference to right now?

You could do something like journalctl --boot=-10 --unit=udisks2 and note what udisks-related stuff the journal had 10 boots ago. Then you could run it for the current boot and compare the two outputs.

3
  • 1. Type is fuseblk. Pamac shows I have ntfs-3g installed. (I usually stick to the official repos.) 2. From what I've read, udisks2.conf seems to be fine... I also plan to reformat the drive to exFat (which I was sure I had done until the terminal said NTFS), so probably not much of a need for any custom drive setup. Glad to know that's there though. 3. journalctl: 10 boots ago, startup was almost the same, except for "Mounted /dev/sdf2 at /run/media/_username_/Backup Plus on behalf of uid 1000", which was absent from the most recent boots.
    – Julien
    Dec 3, 2023 at 1:59
  • 1
    @Julien Well, Mounted … at … on behalf … is part of the output in both ntfs-3g and ntfs cases, so in itself it wouldn't highlight any difference. If you plan to dig deeper, you might want to write down the boot number and the timestamp of this record and then investigate the non-filtered journal around that time (i.e. without the --unit option), to see, what other rows are present around that Mounted…. Around the historical mounts, you could find hints on the driver used. Around the recent failed mounts, you could find more details about the current error.
    – Anton K
    Dec 3, 2023 at 12:56
  • The -10 boot shows the "Mounted..." line hours after boot (I don't mount the drive at startup). After another boot, journalctl --boot=0 doesn't mention the drive when trying to mount with Dolphin / the taskbar. After the terminal command is logged, it's mounted (read-write) by ntfs-3g. Mount options: allow_other,nonempty,relatime,rw,fsname=/dev/sdf2,blkdev,blksize=4096. Also: Ownership and permissions disabled, configuration type 7... But I can still write on the drive. Then it says the drive is dirty and the "force" flag isn't set, so I'm sure that's the root cause. Thanks!
    – Julien
    Dec 4, 2023 at 1:14
0

I imagine the mounting issues must have come from some OS or kernel update; I think I'd had problems with another drive for maybe a month before starting this thread.

In the end, I simply reformatted my drives in exFat and haven't had any mounting problems since. This has generally worked well because exFat is compatible with both Windows and Linux.

Thanks to everyone for helping out, I've learned a good bit about drive troubleshooting on Linux.

3
  • 1
    Please don't add "thank you" as an answer. Instead, accept the answer that you found most helpful. - From Review
    – Elder Geek
    Jan 22 at 16:36
  • @ElderGeek Please note that this is the self-answer by the original poster which contains a workaround-approach to the problem.
    – AdminBee
    Jan 30 at 16:00
  • @AdminBee noted.
    – Elder Geek
    Feb 22 at 19:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .