Re: "mount -t ntfs" vs "mount.ntfs" ?

2022-02-02 Thread David Wright
On Wed 02 Feb 2022 at 11:16:18 (+0100), Yvan Masson wrote:
> 
> > > > > Slightly off-topic question: using pre-5.15 kernel, how can I
> > > > > mount a
> > > > > partition with kernel driver?
> > > > 
> > > > You can't, the NTFS kernel driver first appeared in Linux 5.15.
> > > > 
> > >   From what I understand, there was a read-only driver before 5.15:
> > > - see for example
> > > https://superuser.com/questions/139452/kernel-ntfs-driver-vs-ntfs-3g
> > > or
> > > https://www.paragon-software.com/us/home/ntfs3-driver-faq/
> > > - kernel build config (/boot/config-) also mentions ntfs, even
> > > for
> > > pre-5.15 kernels
> > 
> > Sorry, you are correct, I was mistaken, it's been in the kernel tree
> > [1] for over a decade. However I can't find it mentioned in the config
> > for the Debian kernels on my machine so I'm assuming Debian don't
> > enable it (I'm looking in /boot/config-5.10.0-11-amd64). But you say
> > you found in in you kernel configs?
> > 
> > [1] 
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/fs/ntfs
> > 
> My mistake here, sorry :-) Indeed, Debian stable kernel's config does
> not mention NTFS, so my question is off-topic in this mailing list.

Not at all. Debian's kernel contain ntfs¹ in the source, and it's
not considered unusual to build custom kernels.

> For Linux Mint 20.3 LiveCD, kernel is 5.4.0-91.102 from Ubuntu, and
> its config mentions `CONFIG_NTFS=m`. Module is present in
> /lib/modules/5.4.0-91-generic/kernel/fs/. So I should be able to mount
> read-only with this driver, but don't know how.

Perhaps it is enough to   modprobe ntfs   (as root) before attempting
to mount the filesystem.

¹ It helps that ntfs-3g and ntfs3 have now have proper names. The
  former is the one that I use, though almost exclusively as read only².

  Buster's 4.19 kernel has NTFS in the source, but I've never tried it,
  mainly because they don't configure it in the repository's images.
  The documentation there hints that it is the 2nd generation ntfs
  driver as it refers back to an earlier version, which one might
  suppose is the first generation.

² On the one occasion I wrote anything, it was to remove that little
  bit of vomit that Windows writes on its partitions. Having converted
  a disk from MBR to GPT with gdisk, so that I could boot from it,
  Windows could no longer mount the partition until it was removed —
  it would just hang.

Cheers,
David.



Re: "mount -t ntfs" vs "mount.ntfs" ?

2022-02-02 Thread Yvan Masson



Slightly off-topic question: using pre-5.15 kernel, how can I
mount a
partition with kernel driver?


You can't, the NTFS kernel driver first appeared in Linux 5.15.


  From what I understand, there was a read-only driver before 5.15:
- see for example
https://superuser.com/questions/139452/kernel-ntfs-driver-vs-ntfs-3g
or
https://www.paragon-software.com/us/home/ntfs3-driver-faq/
- kernel build config (/boot/config-) also mentions ntfs, even
for
pre-5.15 kernels


Sorry, you are correct, I was mistaken, it's been in the kernel tree
[1] for over a decade. However I can't find it mentioned in the config
for the Debian kernels on my machine so I'm assuming Debian don't
enable it (I'm looking in /boot/config-5.10.0-11-amd64). But you say
you found in in you kernel configs?

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/fs/ntfs

My mistake here, sorry :-) Indeed, Debian stable kernel's config does 
not mention NTFS, so my question is off-topic in this mailing list.


For Linux Mint 20.3 LiveCD, kernel is 5.4.0-91.102 from Ubuntu, and its 
config mentions `CONFIG_NTFS=m`. Module is present in 
/lib/modules/5.4.0-91-generic/kernel/fs/. So I should be able to mount 
read-only with this driver, but don't know how.


OpenPGP_signature
Description: OpenPGP digital signature


Re: "mount -t ntfs" vs "mount.ntfs" ?

2022-02-01 Thread Tixy
On Tue, 2022-02-01 at 17:56 +0100, Yvan Masson wrote:
> 
> Le 01/02/2022 à 14:24, Tixy a écrit :
> > On Tue, 2022-02-01 at 13:39 +0100, Yvan Masson wrote:
> > > Le 31/01/2022 à 18:02, Christian Britz a écrit :
> > > > 
> > > > 
> > > > On 2022-01-31 11:43 UTC+0100, Yvan Masson wrote:
> > > > 
> > > > > Thanks for the links, I missed that NTF3 was already included
> > > > > in the
> > > > > kernel I use (from Debian testing). So in my case ntfs3g is
> > > > > able to
> > > > > mount a rescued partition, while NTFS3 is not (thanks Andrei
> > > > > for
> > > > > confirming what I supposed): this means that in some cases,
> > > > > NTFS3 is not
> > > > > as mature as ntfs3g.
> > > > 
> > > > As far as I know, NTFS3 is not enabled in any Debian kernel. 🤔
> > > > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998627
> > > > 
> > > Which probably explains why I could not mount using `mount -t
> > > ntfs` :-)
> > > 
> > > Slightly off-topic question: using pre-5.15 kernel, how can I
> > > mount a
> > > partition with kernel driver?
> > 
> > You can't, the NTFS kernel driver first appeared in Linux 5.15.
> > 
>  From what I understand, there was a read-only driver before 5.15:
> - see for example 
> https://superuser.com/questions/139452/kernel-ntfs-driver-vs-ntfs-3g 
> or 
> https://www.paragon-software.com/us/home/ntfs3-driver-faq/
> - kernel build config (/boot/config-) also mentions ntfs, even
> for 
> pre-5.15 kernels

Sorry, you are correct, I was mistaken, it's been in the kernel tree
[1] for over a decade. However I can't find it mentioned in the config
for the Debian kernels on my machine so I'm assuming Debian don't
enable it (I'm looking in /boot/config-5.10.0-11-amd64). But you say
you found in in you kernel configs?

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/fs/ntfs

-- 
Tixy




Re: "mount -t ntfs" vs "mount.ntfs" ?

2022-02-01 Thread Yvan Masson


Le 01/02/2022 à 14:24, Tixy a écrit :

On Tue, 2022-02-01 at 13:39 +0100, Yvan Masson wrote:

Le 31/01/2022 à 18:02, Christian Britz a écrit :



On 2022-01-31 11:43 UTC+0100, Yvan Masson wrote:


Thanks for the links, I missed that NTF3 was already included in the
kernel I use (from Debian testing). So in my case ntfs3g is able to
mount a rescued partition, while NTFS3 is not (thanks Andrei for
confirming what I supposed): this means that in some cases, NTFS3 is not
as mature as ntfs3g.


As far as I know, NTFS3 is not enabled in any Debian kernel. 🤔
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998627


Which probably explains why I could not mount using `mount -t ntfs` :-)

Slightly off-topic question: using pre-5.15 kernel, how can I mount a
partition with kernel driver?


You can't, the NTFS kernel driver first appeared in Linux 5.15.


From what I understand, there was a read-only driver before 5.15:
- see for example 
https://superuser.com/questions/139452/kernel-ntfs-driver-vs-ntfs-3g or 
https://www.paragon-software.com/us/home/ntfs3-driver-faq/
- kernel build config (/boot/config-) also mentions ntfs, even for 
pre-5.15 kernels


OpenPGP_signature
Description: OpenPGP digital signature


Re: "mount -t ntfs" vs "mount.ntfs" ?

2022-02-01 Thread Tixy
On Tue, 2022-02-01 at 13:39 +0100, Yvan Masson wrote:
> Le 31/01/2022 à 18:02, Christian Britz a écrit :
> > 
> > 
> > On 2022-01-31 11:43 UTC+0100, Yvan Masson wrote:
> > 
> > > Thanks for the links, I missed that NTF3 was already included in the
> > > kernel I use (from Debian testing). So in my case ntfs3g is able to
> > > mount a rescued partition, while NTFS3 is not (thanks Andrei for
> > > confirming what I supposed): this means that in some cases, NTFS3 is not
> > > as mature as ntfs3g.
> > 
> > As far as I know, NTFS3 is not enabled in any Debian kernel. 🤔
> > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998627
> > 
> Which probably explains why I could not mount using `mount -t ntfs` :-)
> 
> Slightly off-topic question: using pre-5.15 kernel, how can I mount a 
> partition with kernel driver?

You can't, the NTFS kernel driver first appeared in Linux 5.15.

-- 
Tixy



Re: "mount -t ntfs" vs "mount.ntfs" ?

2022-02-01 Thread Yvan Masson


Le 31/01/2022 à 18:02, Christian Britz a écrit :



On 2022-01-31 11:43 UTC+0100, Yvan Masson wrote:


Thanks for the links, I missed that NTF3 was already included in the
kernel I use (from Debian testing). So in my case ntfs3g is able to
mount a rescued partition, while NTFS3 is not (thanks Andrei for
confirming what I supposed): this means that in some cases, NTFS3 is not
as mature as ntfs3g.


As far as I know, NTFS3 is not enabled in any Debian kernel. 🤔
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998627


Which probably explains why I could not mount using `mount -t ntfs` :-)

Slightly off-topic question: using pre-5.15 kernel, how can I mount a 
partition with kernel driver? I just tried using a Linux Mint live USB 
(kernel 5.4), and using `mount -t ntfs` and `mount.ntfs` result in the 
same `mount` output (which is via ntfs3g) :


$ mount
…
/dev/sda1 on /mnt/part1 type fuseblk (rw,relatime,user_id=0, group_id=0, 
allow_other,blksize=4096)


OpenPGP_signature
Description: OpenPGP digital signature


Re: "mount -t ntfs" vs "mount.ntfs" ?

2022-01-31 Thread Christian Britz



On 2022-01-31 11:43 UTC+0100, Yvan Masson wrote:

> Thanks for the links, I missed that NTF3 was already included in the 
> kernel I use (from Debian testing). So in my case ntfs3g is able to 
> mount a rescued partition, while NTFS3 is not (thanks Andrei for 
> confirming what I supposed): this means that in some cases, NTFS3 is not 
> as mature as ntfs3g.

As far as I know, NTFS3 is not enabled in any Debian kernel. 🤔
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998627



Re: "mount -t ntfs" vs "mount.ntfs" ?

2022-01-31 Thread Yvan Masson


Le 31/01/2022 à 16:19, Michael Stone a écrit :

On Mon, Jan 31, 2022 at 11:43:10AM +0100, Yvan Masson wrote:
Thanks for the links, I missed that NTF3 was already included in the 
kernel I use (from Debian testing). So in my case ntfs3g is able to 
mount a rescued partition, while NTFS3 is not (thanks Andrei for 
confirming what I supposed): this means that in some cases, NTFS3 is 
not as mature as ntfs3g.


It could also mean that the kernel module is being more careful and the 
fuse module is delivering bogus data. Just because something mounts 
doesn't necessarily mean that everything is ok...


You are right, I should be careful with the data. For now everything 
seems OK.


OpenPGP_signature
Description: OpenPGP digital signature


Re: "mount -t ntfs" vs "mount.ntfs" ?

2022-01-31 Thread Michael Stone

On Mon, Jan 31, 2022 at 11:43:10AM +0100, Yvan Masson wrote:
Thanks for the links, I missed that NTF3 was already included in the 
kernel I use (from Debian testing). So in my case ntfs3g is able to 
mount a rescued partition, while NTFS3 is not (thanks Andrei for 
confirming what I supposed): this means that in some cases, NTFS3 is 
not as mature as ntfs3g.


It could also mean that the kernel module is being more careful and the 
fuse module is delivering bogus data. Just because something mounts 
doesn't necessarily mean that everything is ok...




Re: "mount -t ntfs" vs "mount.ntfs" ?

2022-01-31 Thread Yvan Masson


Le 28/01/2022 à 17:51, David Wright a écrit :

On Fri 28 Jan 2022 at 11:34:44 (+0100), Yvan Masson wrote:


I had to recover a NTFS partition from a broken drive (I used GNU
ddrescue with a domain log file generated by partclone), so I now have
a file "recovered_partition.img":

$ file recovered_partition.img
recovered_partition.img: DOS/MBR boot sector, code offset 0x52+2,
OEM-ID "NTFS", sectors/cluster 8, Media descriptor 0xf8,
sectors/track 63, heads 255, hidden sectors 567296, dos < 4.0
BootSector (0x80), FAT (1Y bit by descriptor); NTFS, sectors/track 63,
sectors 1917202431, $MFT start cluster 786432, $MFTMirror start
cluster 2, bytes/RecordSegment 2^(-1*246), clusters/index block 1,
serial number 0606854f86854cf02; contains bootstrap BOOTMGR

If I use `mount -t ntfs`, it fails:

$ sudo mount -t ntfs recovered_partition.img /mnt/
Failed to read last sector (1917202430): Argument invalide
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
or it was not setup correctly (e.g. by not using mdadm --build ...),
or a wrong device is tried to be mounted,
or the partition table is corrupt (partition is smaller than NTFS),
or the NTFS boot sector is corrupt (NTFS size is not valid).
Failed to mount '/dev/loop0': Argument invalide
The device '/dev/loop0' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

However, it works perfectly with `mount.ntfs`:

$ sudo mount.ntfs recovered_partition.img /mnt/sshfs/
Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an
unsafe state. Please resume and shutdown Windows fully (no hibernation
or fast restarting.)
Could not mount read-write, trying read-only

Could it be because `mount` uses kernel driver and `mount.ntfs` uses
ntfs-3g, and that the latter has better "quality" even for read-only?
(Note that this sentence is a complete guess)


Perhaps it's worth perusing:

https://superuser.com/questions/139452/kernel-ntfs-driver-vs-ntfs-3g
https://www.paragon-software.com/us/home/ntfs3-driver-faq/

I'm not sure what "quality" means here. One would hope that files
would yield the same contents regardless of which driver is used,
allowing for whatever your "broken" means, and for the failure to
shutdown Windows cleanly.

Cheers,
David.

Thanks for the links, I missed that NTF3 was already included in the 
kernel I use (from Debian testing). So in my case ntfs3g is able to 
mount a rescued partition, while NTFS3 is not (thanks Andrei for 
confirming what I supposed): this means that in some cases, NTFS3 is not 
as mature as ntfs3g.


Regards,
Yvan


OpenPGP_signature
Description: OpenPGP digital signature


Re: "mount -t ntfs" vs "mount.ntfs" ?

2022-01-28 Thread David Wright
On Fri 28 Jan 2022 at 11:34:44 (+0100), Yvan Masson wrote:
> 
> I had to recover a NTFS partition from a broken drive (I used GNU
> ddrescue with a domain log file generated by partclone), so I now have
> a file "recovered_partition.img":
> 
> $ file recovered_partition.img
> recovered_partition.img: DOS/MBR boot sector, code offset 0x52+2,
> OEM-ID "NTFS", sectors/cluster 8, Media descriptor 0xf8,
> sectors/track 63, heads 255, hidden sectors 567296, dos < 4.0
> BootSector (0x80), FAT (1Y bit by descriptor); NTFS, sectors/track 63,
> sectors 1917202431, $MFT start cluster 786432, $MFTMirror start
> cluster 2, bytes/RecordSegment 2^(-1*246), clusters/index block 1,
> serial number 0606854f86854cf02; contains bootstrap BOOTMGR
> 
> If I use `mount -t ntfs`, it fails:
> 
> $ sudo mount -t ntfs recovered_partition.img /mnt/
> Failed to read last sector (1917202430): Argument invalide
> HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
>or it was not setup correctly (e.g. by not using mdadm --build ...),
>or a wrong device is tried to be mounted,
>or the partition table is corrupt (partition is smaller than NTFS),
>or the NTFS boot sector is corrupt (NTFS size is not valid).
> Failed to mount '/dev/loop0': Argument invalide
> The device '/dev/loop0' doesn't seem to have a valid NTFS.
> Maybe the wrong device is used? Or the whole disk instead of a
> partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
> 
> However, it works perfectly with `mount.ntfs`:
> 
> $ sudo mount.ntfs recovered_partition.img /mnt/sshfs/
> Metadata kept in Windows cache, refused to mount.
> Falling back to read-only mount because the NTFS partition is in an
> unsafe state. Please resume and shutdown Windows fully (no hibernation
> or fast restarting.)
> Could not mount read-write, trying read-only
> 
> Could it be because `mount` uses kernel driver and `mount.ntfs` uses
> ntfs-3g, and that the latter has better "quality" even for read-only?
> (Note that this sentence is a complete guess)

Perhaps it's worth perusing:

https://superuser.com/questions/139452/kernel-ntfs-driver-vs-ntfs-3g
https://www.paragon-software.com/us/home/ntfs3-driver-faq/

I'm not sure what "quality" means here. One would hope that files
would yield the same contents regardless of which driver is used,
allowing for whatever your "broken" means, and for the failure to
shutdown Windows cleanly.

Cheers,
David.



Re: "mount -t ntfs" vs "mount.ntfs" ?

2022-01-28 Thread Andrei POPESCU
On Vi, 28 ian 22, 11:34:44, Yvan Masson wrote:
> 
> Could it be because `mount` uses kernel driver and `mount.ntfs` uses
> ntfs-3g, and that the latter has better "quality" even for read-only? (Note
> that this sentence is a complete guess)

Try 'ls -l /sbin/mount.ntfs' ;)


Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser


signature.asc
Description: PGP signature