Re: [DNG] why does mount expect NTFS?

2019-08-10 Thread Erik Christiansen
On 10.08.19 21:51, Hendrik Boom wrote:
> So I want to find out what's in /dev/sda4 on my hard drive.  The 
> computer has *never* had Windows on it.  So I try to mount it, and am 
> told:
> 
> april:/farhome/hendrik# mount /dev/sda4 /test
> NTFS signature is missing.
> Failed to mount '/dev/sda4': Invalid argument
> The device '/dev/sda4' 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?
> april:/farhome/hendrik#
> 
> Why would it try for and NTFS file system on a Linux machine?

To move from speculation to analysis requires information. One way to
read the filesystem type of an unmounted filesystem is with blkid, e.g.:

$ blkid /dev/sdb1
/dev/sdb1: LABEL="fred" UUID="7713e1b5-1bdf-41d1-9aa9" TYPE="ext2"

As you have not specified an fstype in the mount command, it'll normally
use the blkid libraries to discover the fstype in just this way, so
let's see what it finds.

Erik
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] why does mount expect NTFS?

2019-08-11 Thread wirelessduck--- via Dng
Could it be exfat? I sometimes see NTFS messages appear in syslog when I try to 
mount exfat drives using pmount.

> On 11 Aug 2019, at 11:51, Hendrik Boom  wrote:
> 
> So I want to find out what's in /dev/sda4 on my hard drive.  The 
> computer has *never* had Windows on it.  So I try to mount it, and am 
> told:
> 
> april:/farhome/hendrik# mount /dev/sda4 /test
> NTFS signature is missing.
> Failed to mount '/dev/sda4': Invalid argument
> The device '/dev/sda4' 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?
> april:/farhome/hendrik#
> 
> Why would it try for and NTFS file system on a Linux machine?
> 
> -- hendrik
> 
> ___
> Dng mailing list
> Dng@lists.dyne.org
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] why does mount expect NTFS?

2019-08-11 Thread marc
> Why would it try for and NTFS file system on a Linux machine?

The way I understand it is that without a filesystem type, 
mount will try all (disk-based) filesystem drivers that
you have currently loaded. And the ntfs driver generates
some debug output when it fails. So nothing to worry about.

It does make sense - sensibly enough the kernel has no other[1]
facility to work out what filesystem is really on a given 
partition - it has to invoke the filesystem driver to find out. 

regards

marc

[1] partition ids, etc may provide a clue but consider the case
of your magic new filesystem that you have just written a kernel 
driver for...
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] why does mount expect NTFS?

2019-08-11 Thread Evilham via Dng

Hey,

On dg., ag. 11 2019, Hendrik Boom wrote:


So I want to find out what's in /dev/sda4 on my hard drive.  The
computer has *never* had Windows on it.  So I try to mount it, 
and am

told:

april:/farhome/hendrik# mount /dev/sda4 /test
NTFS signature is missing.
Failed to mount '/dev/sda4': Invalid argument
The device '/dev/sda4' doesn't seem to have a valid NTFS.



Just adding two things to what marc wrote: partition number 4 
(sda4) is very often used as the extended partition in DOS 
partition tables. Regardless of its type, you should check the 
partition table; it will have the type byte set for each partition 
which says which use it's supposed to have, though it can actually 
not match the partition contents.


I recall gparted and IIRC parted show this quite nicely. man 
parted was useful (at the very least the help command was).


If it is an extended partition, then it's not supposed to be 
mountable, but you should check the 5th partition instead.



Another fun thing that will work even if you are not using a DOS 
partition table is: just hexdump it!


   dd if=/dev/sda4 bs=1M count=1 | hd | less

File systems usually have some kind of readable ASCII information 
at the beginning and amongst others an NTFS partition will be 
obvious there.

--
Evilham
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] why does mount expect NTFS?

2019-08-11 Thread Hendrik Boom
On Sun, Aug 11, 2019 at 02:13:48PM +1000, Erik Christiansen wrote:
> On 10.08.19 21:51, Hendrik Boom wrote:
> > So I want to find out what's in /dev/sda4 on my hard drive.  The 
> > computer has *never* had Windows on it.  So I try to mount it, and am 
> > told:
> > 
> > april:/farhome/hendrik# mount /dev/sda4 /test
> > NTFS signature is missing.
> > Failed to mount '/dev/sda4': Invalid argument
> > The device '/dev/sda4' 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?
> > april:/farhome/hendrik#
> > 
> > Why would it try for and NTFS file system on a Linux machine?
> 
> To move from speculation to analysis requires information. One way to
> read the filesystem type of an unmounted filesystem is with blkid, e.g.:
> 
> $ blkid /dev/sdb1
> /dev/sdb1: LABEL="fred" UUID="7713e1b5-1bdf-41d1-9aa9" TYPE="ext2"
> 
> As you have not specified an fstype in the mount command, it'll normally
> use the blkid libraries to discover the fstype in just this way, so
> let's see what it finds.

april:/farhome/hendrik# blkid /dev/sda4
/dev/sda4: PARTLABEL="Linux filesystem" 
PARTUUID="14fdecea-4672-4d03-9660-868f3fd630ec"
april:/farhome/hendrik#

And if it doesn't mention  type, should I presume that it's likely a 
partition that does not have a file system installed?  Or at 
least not one the current Linux system can handle?

-- hendrik
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] why does mount expect NTFS?

2019-08-11 Thread Tomasz Torcz
On Sun, Aug 11, 2019 at 08:18:54AM -0400, Hendrik Boom wrote:
> On Sun, Aug 11, 2019 at 02:13:48PM +1000, Erik Christiansen wrote:
> > On 10.08.19 21:51, Hendrik Boom wrote:
> > > So I want to find out what's in /dev/sda4 on my hard drive.  The 
> > > computer has *never* had Windows on it.  So I try to mount it, and am 
> > > told:
> > > 
> > > april:/farhome/hendrik# mount /dev/sda4 /test
> > > NTFS signature is missing.
> > > Failed to mount '/dev/sda4': Invalid argument
> > > The device '/dev/sda4' 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?
> > > april:/farhome/hendrik#
> > > 
> > > Why would it try for and NTFS file system on a Linux machine?
> > 
> > To move from speculation to analysis requires information. One way to
> > read the filesystem type of an unmounted filesystem is with blkid, e.g.:
> > 
> > $ blkid /dev/sdb1
> > /dev/sdb1: LABEL="fred" UUID="7713e1b5-1bdf-41d1-9aa9" TYPE="ext2"
> > 
> > As you have not specified an fstype in the mount command, it'll normally
> > use the blkid libraries to discover the fstype in just this way, so
> > let's see what it finds.
> 
> april:/farhome/hendrik# blkid /dev/sda4
> /dev/sda4: PARTLABEL="Linux filesystem" 
> PARTUUID="14fdecea-4672-4d03-9660-868f3fd630ec"
> april:/farhome/hendrik#
> 
> And if it doesn't mention  type, should I presume that it's likely a 
> partition that does not have a file system installed?  Or at 
> least not one the current Linux system can handle?

  That may be true.  You can also check with “wipefs” tool (don't worry,
without -a it won't wipe anything):

  wipefs --no-act /dev/sda4

Wipefs has a big database of various filesystem metadata, it detects
almost anything.

-- 
Tomasz TorczOnly gods can safely risk perfection,
xmpp: zdzich...@chrome.pl it's a dangerous thing for a man.  -- Alia

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] why does mount expect NTFS?

2019-08-11 Thread Erik Christiansen
On 11.08.19 08:18, Hendrik Boom wrote:
> On Sun, Aug 11, 2019 at 02:13:48PM +1000, Erik Christiansen wrote:
> > $ blkid /dev/sdb1
> > /dev/sdb1: LABEL="fred" UUID="7713e1b5-1bdf-41d1-9aa9" TYPE="ext2"
> > 
> > As you have not specified an fstype in the mount command, it'll normally
> > use the blkid libraries to discover the fstype in just this way, so
> > let's see what it finds.
> 
> april:/farhome/hendrik# blkid /dev/sda4
> /dev/sda4: PARTLABEL="Linux filesystem" 
> PARTUUID="14fdecea-4672-4d03-9660-868f3fd630ec"
> april:/farhome/hendrik#
> 
> And if it doesn't mention  type, should I presume that it's likely a 
> partition that does not have a file system installed?  Or at 
> least not one the current Linux system can handle?

That seems a fairly safe bet. I don't have a partition here that hasn't
had mkfs run on it, to confirm, but you'd expect some sort of
"unrecognised filesystem" error if there's something alien there.

You could try an explicit probe:

$ blkid -p -n ntfs,vfat,ext3,ext4 /dev/sdb1

That gives more information if there's a hit, else silent return.

But it looks like you're about ready to run mkfs on it, as there's no
sign of life there. (At least a form you can communicate with. :-)

Erik
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng