Other Check if formatted

Only shows info from mounted partitions. And it only shows sizes and mountpoints, not the filesystem type.
fs.png


rootfs - root(file-system)
devfs - virtual(file-system)
tempfs - temporary file-storage (intended to appear as a mounted file-system)

What am I missing here?

397790 said:
Only shows the available partitions. This however doesn't mean they're actually formatted.
gpart can both create and read partitions that have not been assigned a file-system (format-less/un-formatted). If a partition does not have a "format" it will still be shown.
 
Yes it is. I seem to recall that it was even explained to you a few weeks ago, including examples. See file(1).

file -s /dev/da0s1 says data.

Maybe I should dd if=/dev/da0s1 of=first-100M-of partition bs=1m count=100 and see what is there. Not sure what I would be looking for though.
 
What am I missing here?
You're overlooking the fact that the above are merely labels, and not everyone uses those.

Code:
feliner:/home/peter $ df -lh
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ada0p2    992M    275M    637M    30%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/ada0p4    1.4G    484M    852M    36%    /var
/dev/ada0p5    1.9G     30M    1.8G     2%    /tmp
/dev/ada0p6    9.7G    7.4G    1.5G    83%    /home
/dev/ada0p7     21G     18G    1.1G    94%    /usr
procfs         4.0K    4.0K      0B   100%    /proc
 
You're overlooking the fact that the above are merely labels, and not everyone uses those.

Code:
feliner:/home/peter $ df -lh
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ada0p2    992M    275M    637M    30%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/ada0p4    1.4G    484M    852M    36%    /var
/dev/ada0p5    1.9G     30M    1.8G     2%    /tmp
/dev/ada0p6    9.7G    7.4G    1.5G    83%    /home
/dev/ada0p7     21G     18G    1.1G    94%    /usr
procfs         4.0K    4.0K      0B   100%    /proc

df -T should output the file-system type regardless of the chosen label:

Code:
$ df -T
Filesystem              Type    1K-blocks    Used    Avail Capacity  Mounted on
/dev/ufs/rootfs         ufs      30222588 1742812 26061972     6%    /
devfs                   devfs           1       1        0   100%    /dev
/dev/msdosfs/MSDOSBOOT  msdosfs     51096   13520    37576    26%    /boot/msdos
tmpfs                   tmpfs       51200       4    51196     0%    /tmp
 
Why not use fstyp(8): fstyp /dev/ada0p1.

Can't recall ever using this but it sounds like just the thing I was looking for so gave it a try:
Code:
root@FreeBSD:/# gpart show ada0
=>       63  625142385  ada0  MBR  (298G)
         63       1985        - free -  (993K)
       2048    1124352     1  ntfs  [active]  (549M)
    1126400  624013312     2  ntfs  (298G)
  625139712       2736        - free -  (1.3M)

root@FreeBSD:/# fstyp /dev/ada0s1
ntfs
root@FreeBSD:/# fstyp /dev/ada0s2
fstyp: cannot seek to 3221228544: Invalid argument
fstyp: /dev/ada0s2: filesystem not recognized
 
Many thanks for pointing this out, it helped solve the following problem:-

Code:
root@FreeBSD:~ # gpart show da0
=>     63  3868609  da0  MBR  (1.8G)
       63       70       - free -  (35K)
      133  3868539    1  fat16  [active]  (1.8G)

root@FreeBSD:~ # mount -t msdosfs /dev/da0s1 /mnt/dos
mount_msdosfs: /dev/da0s1: Invalid argument
Why was it invalid?

Code:
root@FreeBSD:~ # disktype /dev/da0

--- /dev/da0
Character device, size 1.845 GiB (1980760064 bytes)
DOS/MBR partition map
Partition 1: 1.845 GiB (1980691968 bytes, 3868539 sectors from 133, bootable)
  Type 0x06 (FAT16)
  NTFS file system
    Volume size 1.845 GiB (1980690432 bytes, 3868536 sectors)

root@FreeBSD:~ # ntfs-3g /dev/da0s1 /mnt/dos
root@FreeBSD:~ # ls -al /mnt/dos
total 609
drwxrwxrwx  1 root  wheel    4096 Mar  3  2016 .
drwxr-xr-x  9 root  wheel     512 Aug 12 01:56 ..
-rwxrwxrwx  1 root  wheel    8192 Jan  1  2001 BOOTSECT.BAK
drwxrwxrwx  1 root  wheel    4096 Mar  3  2016 Boot
drwxrwxrwx  1 root  wheel       0 Apr  5  2017 System Volume Information
-rwxrwxrwx  1 root  wheel  391640 Jun 28  2014 bootmgr
-rwxrwxrwx  1 root  wheel  206312 Jan  9  2010 grldr
-rwxrwxrwx  1 root  wheel      48 Jan 26  2010 wedaolu

Now why gpart tells me I have a fat16 partition whereas it is really NTFS, I don't know, but if anyone ever gets an 'Invalid argument' when trying to mount a partition, then it's worth running sysutils/disktype to see if you really have what you think you have.

Thanks to tingo for making me aware of a useful util I was not aware of.
 
Now why gpart tells me I have a fat16 partition whereas it is really NTFS, I don't know,
Basically a partition type doesn't mean much when it comes to the actually used filesystem. They're two different properties.

In the example above: nothing is stopping me from running newfs /dev/da0s1 which would turn that into an UFS based filesystem.
 
Back
Top