chewitt :
OK. I've put the test image through its paces. TL;DR version: no effect. Details below.
First I replicated the issue on the LE11.0.3 image that I've been running for the past two weeks or so. The harddisk I'm using is a Seagate
8TB Archive SMR in external enclosure with USB3 interface (which also
contains a 2-port USB3 hub). Partitions: 134MB FAT ("Microsoft
reserved" rubbish that I never got around to eradicating) and
the rest is NTFS.
After a clean reboot with a previously cleanly unmounted harddisk all is well. Then I arranged for an unclean dismount of the USB harddisk. <yank>
Relevant output of dmesg:
[ 271.328729] usb 2-2: USB disconnect, device number 2
[ 271.328762] usb 2-2.1: USB disconnect, device number 3
[ 271.330130] device offline error, dev sda, sector 264208 op
0x1:(WRITE) flags 0x0 phys_seg 1 prio class 2
[ 271.330162] Buffer I/O error on dev sda2, logical block 2, lost
async page write
[ 271.330198] device offline error, dev sda, sector 6555648 op
0x1:(WRITE) flags 0x0 phys_seg 1 prio class 2
[ 271.330217] Buffer I/O error on dev sda2, logical block 786432, lost
async page write
[ 271.434126] device offline error, dev sda, sector 2048 op 0x0:(READ)
flags 0x0 phys_seg 1 prio class 2
[ 271.434170] FAT-fs (sda1): unable to read boot sector to mark fs as
dirty
[ 271.480504] ntfs3: sda2: failed to read volume at offset 0x2c000
[ 271.480605] ntfs3: sda2: failed to read volume at offset 0x2c000
[ 271.491154] usb 1-1.2: USB disconnect, device number 3
[ 271.505444] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 271.705407] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result:
hostbyte=0x07 driverbyte=DRIVER_OK
Display More
Replugging the harddisk replicated the issue that started this whole thread: the NTFS partition is not visible from within Kodi.
Relevant output of dmesg:
[ 334.811535] sd 1:0:0:0: [sdb] Spinning up disk...
[ 335.717672] usb 1-1.2-port2: Cannot enable. Maybe the USB cable is
bad?
[ 335.830629] ..............ready
[ 349.005423] sd 1:0:0:0: [sdb] 15628053167 512-byte logical blocks:
(8.00 TB/7.28 TiB)
[ 349.048933] sd 1:0:0:0: [sdb] Write Protect is off
[ 349.048950] sd 1:0:0:0: [sdb] Mode Sense: 4f 00 00 00
[ 349.049218] sd 1:0:0:0: [sdb] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[ 349.049656] sd 1:0:0:0: [sdb] Preferred minimum I/O size 512 bytes
[ 349.049664] sd 1:0:0:0: [sdb] Optimal transfer size 33553920 bytes
[ 349.110372] sdb: sdb1 sdb2
[ 349.110747] sd 1:0:0:0: [sdb] Attached SCSI disk
[ 349.356826] FAT-fs (sdb1): Volume was not properly unmounted. Some
data may be corrupt. Please run fsck.
[ 349.448779] ntfs3: sdb2: volume is dirty and "force" flag
is not set!
Display More
Last two lines of mount output:
/dev/sda2 on /var/media/Seagate_8TB type ntfs3(rw,relatime,uid=0,gid=0,fmask=37777600133,iocharset=utf8)
/dev/sdb1 on /var/media/FAT_134MB type vfat (rw,nosuid,nodev,noexec,noatime,fmask=0133,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
However, while mount shows the partition as mounted, it is not visible from within Kodi and /var/media/Seagate_8TB/ is empty.
Unplugging and
replugging the USB drive (which seems the first option a
non-technical user would think of) doesn't fix the problem, however the mount command now doesn't show /dev/sda2 at all.
So let's run fsck /dev/sda2:
fsck from util-linux 2.38.1
Which is profoundly
unhelpful and doesn't fix anything. So that's the problem reproduced
with the standard 11.0.3 distribution image.
Then I did the same with the LibreELEC (chewitt): 11.80.0 (RPi4.aarch64) image as per the download link above. This shows one (and only one) difference with the LE11.0.3 distro image, which is the output of the fsck command:
fsck from util-linux 2.39.2
Finally I plugged the USB harddisk into my Ubuntu 18.04 laptop. (Yes, I know, I'm way overdue for upgrading. Deal with it. ) This system runs kernel version 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux.
Strangely enough, the NTFS partition mounted fine. I unmounted it and ran fsck /dev/sdb2 on it:
fsck from util-linux 2.31.1
Mounting volume... OK
Processing of $MFT and $MFTMirr completed successfully.
Checking the alternate boot sector... OK
NTFS volume version is 3.1.
NTFS partition /dev/sdb2 was processed successfully.
I'm not sure why fsck on the old Linux box doesn't see the need to repair anything; on previous fsck runs on that partition it did come up with several messages of issues that were corrected. I wish I'd saved them at the time, but of course I didn't.
Cleanly dismounting the USB disk from the Linux laptop did not make any difference on the LE side: when I plug it back in I still get the "volume is dirty" error in the dmesg output.
So in summary:
- LE is more critical when it comes to refusing to mount a "dirty" NTFS partition, and
- The fsck from util-linux 2..31.1 gives more output and seems to do more than the ones in both the distro and the test LE images that I've tried.
- The fsck included in LE11 distro and the test image both don't seem to do much more than print its version number when applied to an NTFS partition.
Item 1 could be kernel-related. 6.1.58 vs. 4.15.0 is not exactly trivial, although I wouldn't be able to explain why recent kernels would be less tolerant to NTFS issues...
It took plugging the HD into a Windows box and running chkdsk on it before LE would play ball with it again. Interestingly, chkdsk found no errors! But it still caused LE to mount the NTFS partition again. Uh-huh.
I've had NTFS issues on the Linux box after a mid-write unclean dismount (files and directories that I couldn't read, write or delete anymore from Linux) and that needed a Windows box to fix. But the partition would still mount. LE seems much more picky.
And that's it from me for today. Stay tuned - film at eleven...