Write denied on exfat usb hdd mounted locallly

As i am learning all about chroot and manjaro-chroot cmd, i came across some good video that i want to keep … However facing this write denied problem after mount.

I mounted usb hdd which was used during window os time… exfat.
I tried to mount it to a local folder, mounted but write denied.
What info of the drive do i need to provide ?

sudo fdisk -l

sudo fdisk -l /dev/sdd1  :heavy_check_mark:
Disk /dev/sdd1: 5.46 TiB, 6001172414464 bytes, 11721039872 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: 0x00000000

Device Boot Start End Sectors Size Id Type
/dev/sdd1p1 4294967295 8589934589 4294967295 2T ff BBT
/dev/sdd1p2 4294967295 8589934589 4294967295 2T ff BBT
/dev/sdd1p3 4294967295 8589934589 4294967295 2T ff BBT
/dev/sdd1p4 4294967295 5035196669 740229375 353G ff BBT

Partition 1 does not start on physical sector boundary.
Partition 2 does not start on physical sector boundary.
Partition 3 does not start on physical sector boundary.
Partition 4 does not start on physical sector boundary.

df -hT

df -hT /dev/sdd
Filesystem Type Size Used Avail Use% Mounted on
dev devtmpfs 7.8G 0 7.8G 0% /dev
df -hT /dev/sdd1
Filesystem Type Size Used Avail Use% Mounted on
/dev/sdd1 exfat 5.5T 3.9T 1.6T 72% /home/manjaro/mount-6TB

sudo blkid

sudo blkid /dev/sdd1
/dev/sdd1: LABEL=“6TB My Book” UUID=“54BA-47FC” BLOCK_SIZE=“512” TYPE=“exfat” PARTLABEL=“My Book” PARTUUID=“e5608bd6-3920-4b72-972d-6c29f1d0305e”
sudo blkid /dev/sdd
/dev/sdd: PTUUID=“8ae47c2c-592b-4a63-886d-f2fb925f7d36” PTTYPE=“gpt”

tune2fs -l

sudo tune2fs -l /dev/sdd
tune2fs 1.47.1 (20-May-2024)
tune2fs: Bad magic number in super-block while trying to open /dev/sdd
/dev/sdd contains `DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 4294967295 sectors, extended partition table (last)’ data

sudo tune2fs -l /dev/sdd1
tune2fs 1.47.1 (20-May-2024)
tune2fs: Bad magic number in super-block while trying to open /dev/sdd1
/dev/sdd1 contains a exfat file system labelled ‘6TB My Book’

Please advice first on how to able to write to the drive first…
Thanks

Removable media (such as flash drives) should be mountable using the appropriate applet in the system tray; and are mounted under /run/media/ by default; you should normally not mount them using any other method.

Why can’t i mount at other location ? Is it a habit or program limitation ? I used to mount all my external drive on all specially named folder on my home folder for purpose of vim to open it each time with keyboard shortcut.
However, my issue here is regarding write denied. I have no idea is it due to the hdd got corrupted bit or something wrong with the command. But i think i used to mount the same way like below, it used to work… :

sudo mount /dev/sdd1 ~/mount_6TB

Can someone teach me how to see where is the problem lies ?

findmnt command says mount is in ro mode?

If so, try remounting in rw mode to see what happens:

sudo mount -o remount,rw /dev/sdd1 ~/mount_6TB

Also check the disk, if it has any error will be mounted in ro mode.

You would need: sudo fdisk -l /dev/sdd for the useful information here. (Or sudo fdisk -l for all drives.)

But you can mount this partition read only?

chkdsk in Windows would be my first go-to.

If that isn’t an option, they have made improvements in fsck.exfat in recent years, and you can run it without making changes to test to start, with -n | --repair-no.

And I would have block level copy (with dd for example), if you can, before writing any changes.

sudo mount -o remount,rw /dev/sdd1 ~/mount-6TB
mount: /home/manjaro/mount-6TB: mount point not mounted or bad option.
       dmesg(1) may have more information after failed mount system call.
[  115.596775] sd 6:0:0:0: [sdd] Very big device. Trying to use READ CAPACITY(16).
[  115.681065] sd 6:0:0:0: [sdd] 11721043968 512-byte logical blocks: (6.00 TB/5.46 TiB)
[  115.681083] sd 6:0:0:0: [sdd] 4096-byte physical blocks
[  115.681466] sd 6:0:0:0: [sdd] Write Protect is off
[  115.681471] sd 6:0:0:0: [sdd] Mode Sense: 47 00 10 08
[  115.681783] sd 6:0:0:0: [sdd] No Caching mode page found
[  115.681788] sd 6:0:0:0: [sdd] Assuming drive cache: write through
[  115.746106]  sdd: sdd1
[  115.746430] sd 6:0:0:0: [sdd] Attached SCSI disk
[  115.765077] scsi 6:0:0:1: Wrong diagnostic page; asked for 1 got 8
[  115.765082] scsi 6:0:0:1: Failed to get diagnostic page 0x1
[  115.765085] scsi 6:0:0:1: Failed to bind enclosure -19
[  115.765119] ses 6:0:0:1: Attached Enclosure device
[ 4326.912544] exFAT-fs (sdd1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 5270.669551] EXT4-fs (sda2): mounted filesystem 0eef34c8-7ed8-4eb2-bffe-5f7e04864898 r/w with ordered data mode. Quota mode: none.
[12938.718254] EXT4-fs (sdc1): mounted filesystem e243610f-aeef-4cd0-8dea-3456638f11f6 r/w with ordered data mode. Quota mode: none.
[12943.146430] EXT4-fs (sdc2): mounted filesystem 3a129912-a5a6-460e-965a-e3007b28ce2b r/w with ordered data mode. Quota mode: none.
[16951.446229] perf: interrupt took too long (2560 > 2500), lowering kernel.perf_event_max_sample_rate to 78000

 sudo fdisk -l /dev/sdd                                        ✔ 
Disk /dev/sdd: 5.46 TiB, 6001174511616 bytes, 11721043968 sectors
Disk model: My Book 25EE    
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: 8AE47C2C-592B-4A63-886D-F2FB925F7D36

Device     Start         End     Sectors  Size Type
/dev/sdd1   2048 11721041919 11721039872  5.5T Microsoft basic data
sudo fsck.exfat /dev/sdd1                                  
exfatprogs version : 1.2.3
ERROR: /programming_language/raspberry programming/Learn C Programming on Raspberry Pi - 20 - typedef.b2c25917-032e-4f66-8444-8275c830750c.part: more clusters are allocated. truncate to 2097152 bytes at 0x38c01c01020. Truncate (y/N)? n
 
y

After i pressed “y”, it just 100% cpu and nothing else… Well, i will let it running (if it is indeed running , not frozen)…

I meant to block level backup. Then try a dry-run, with --repair-no.

But if you’re in a hurry to potentially make it worse… By all means. :smirk:

You could mount the drive to /run/media/ via the applet as @soundofthunder suggested, and then link it to your home directory so that it can be opened with the keyboard shortcut. I have done that with 2 Western Digital Elements external hard drives which I use daily. I download a lot of videos & pictures using Firefox add-ons, and as add-ons are restricted to downloading to ~/Downloads/ (and subdirectories of ~/Downloads/), I’ve linked those external drives to subdirectories in ~/Downloads so I can save directly to them.

Hopefully your external drives keep the same identity across remounts - I set unique volume labels on my external drives when I formatted them (8TB-Elements & 14TB-Elements), so whenever I plug them in they appear in Dolphin with those labels.

Try instead

sudo fsck.exfat -v /dev/sdd1

It only will report errors.

https://man.archlinux.org/man/fsck.exfat.8.en

An error was found, but you declined to have it fixed - probably because it looked like this “fix” would lead to loss of data.

But you need to fix the file system before you can use it.

The only option I see and what I’d do if I was unsure and the data was precious:
copy all the data off the drive -
then reformat it, make a new file system
or force repair the existing one and see whether it affects the integrity of your data.

Well, this wasn’t in the original post; but these were:

This condition can have potential sonsequences.

There is also this, which may (or may not) be a factor:

That is doomed to fail …

You cannot run a file system check using ext4 tools targeting a Microsoft file system

If anything - you should let fsck decide which tool to use

fsck /dev/sdd1

Or use the correct tool for the file system

fsck.vfat /dev/sdd1

And remember - unmount the device before run

umount /dev/sdd1

I now realize I kept misunderstanding the info - reading ext4 where exfat was written - my sincere apology.

Well, you can see now the reason of the read only mount. As each day I become lazier with the terminal, I would open gparted, first dismount partition, second verify partition, third read the log to see what’s wrong and finally repair partition.

It might be better/easier to re-partition/re-format you USB drive(s).


If you wish to keep any data existing on the USB drive:

1. Create a disk image, perhaps using Disks (gui app)

sudo pacman -S gnome-disk-utility
  • You will need enough available space – somewhere – to store this disk image. Close Disks when finished imaging.
  • Ensure that you can access the disk image to extract/save any data you wish to keep. When your data is safe, delete the disk image.
  • Clicking the image should mount it under Devices in Dolphin.

2. Fully repartition the USB drive, using GParted (gui app)

sudo pacman -S gparted
  • Create a new GPT partition table (or MSDOS if you prefer)
  • Create a new partition and format it as EXT4 (if it will only be accessed by Linux) or EXFAT (if it will be accessed by both Linux and Windows)

3. The following link relates to using Microsoft filesystems in Linux; it mainly concerns NTFS, however, it also contains other valuable information that you will likely benefit from knowing.


I hope this helps. Cheers.

Hmm… exfat != ext4 …or is it ? You overlooked or it is me … i think you overlooked.
there is fsck.ext4 and fsck.exfat … i used to save 2GB of iso file in the hdd, hence the fs that i set up was exfat, which is bigger block of fs as fat32 (fat32 does not support GB file size if i recalled properly).

And Indeed, i have tried $ fsck /dev/sdd1 … in fact , multiple times… it just NOT running at all, as if nothing happened!
Hence i started posting this thread… because i don’t know what else to do.
After i saw someone suggested fsck.exfat… i tried that and it indeed running through out the night while i am sleeping (although initially i thought it is frozen, but it is in fact running without showing status ).

Now after it did the fsck.exfat /dev/sdd1 check, now it can again run fsck /dev/sdd1 without any problem…
So, i think i can conclude that fsck /dev/sdd1 was not running, because it does not know what fs it is (due to damage in fs)… (just weird, it does not prompt much info to let me know it has error running)…

Is there no way for fsck cmd to show it progress status when it is scanning ??

This is another hdd; the hdd partition where my broken manjaro is:
I realized that when i mount this hdd same method as 6TB hdd, it is also " write permission denied" … hence suspect also got fs error… hence did a fsck also on it.

sda      8:0    0 931.5G  0 disk 
├─sda1   8:1    0   300M  0 part     **efI partition**
└─sda2   8:2    0 931.2G  0 part     **manjaro**
sudo fsck /dev/sda2                                                                                                    ✔ 
fsck from util-linux 2.40.1
e2fsck 1.47.1 (20-May-2024)
/dev/sda2: clean, 4154052/61030400 files, 153937344/244112696 blocks

This scan above said it is ok.

But this scan (below) said something wrong! ?
First of all, can i use fsck cmd to scan for a device ? (instead of scan for individual partition)

sudo fsck /dev/sda                                                                                                     ✔ 
fsck from util-linux 2.40.1
e2fsck 1.47.1 (20-May-2024)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sda

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

/dev/sda contains `DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 1953525167 sectors, extended partition table (last)' data

If fsck can be use to scan for a device (instead of partition), then please tell me what this msg above means and possible action to save it.

this is your efi partition
the file system is not ext2 or ext3 or ext4
it is fat or vfat
yet you requested it to be checked with the tool for ext2/3/4 file systems
or
the generic command fsck defaults to fsck.ext2 - don’t know

re the post before:

fsck.exfat --help
Usage: fsck.exfat
	-r | --repair        Repair interactively
	-y | --repair-yes    Repair without ask
	-n | --repair-no     No repair
	-p | --repair-auto   Repair automatically
	-a                   Repair automatically
	-V | --version       Show version
	-v | --verbose       Print debug
	-h | --help          Show help

So you do have the -v option to get more verbose output.
But you did get output - an error was found, but you declined to have it fixed:

  • EXT4 is a native Linux filesystem.
  • EXFAT is a Microsoft filesystem.

EXFAT was originally released by Microsoft to provide a filesystem compatible with both MacOS and Windows; also, to address the maximum file size limitation of FAT32.

In very recent years (2019, I think) EXFAT has been opensourced, and is now freely available in Linux.

Nope! i didn’t type the “n” there. It AUTO have a “n” there!
I didn’t press anything, and i saw the “n” was there at the end of the prompt! Don’t ask me why! it is so. I also thought it is weird… just i didn’t raise the issue here.