# Problem mounting NTFS



## Zack (Jun 30, 2015)

I have an SD card. Here is the output from `gpart show`.

```
=>  63  62333889  da0  MBR  (30G)
  63  10485720  1  ntfs  (5.0G)
  10485783  51848169  - free -  (25G)
```
To create this I used these commands.

```
gpart create -s mbr da0
gpart add -s 5G -t ntfs da0
newfs_msdos -F32 /dev/da0s1
```

So far everything seems so good. No errors when creating the partition. The problem happens when i try and mount it.

```
# ntfs-3g /dev/da0s1 /mnt
NTFS signature is missing.
Failed to mount '/dev/da0s1': Invalid argument
The device '/dev/da0s1' 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?
```
And this is the output while trying to `ntfsmount` and then from `ntfsfix`

```
Failed to startup volume: Invalid argument.
Failed to mount '/dev/da0s1': Invalid argument.
The device '/dev/da0s1' doesn't have a valid NTFS.
Maybe you selected the wrong device? Or the whole disk instead of a
partition (e.g. /dev/hda, not /dev/hda1)? Or the other way around?
Mount failed.
```


```
Mounting volume... Failed to startup volume: Invalid argument.
FAILED
Attempting to correct errors... FAILED
Failed to startup volume: Invalid argument.
Volume is corrupt. You should run chkdsk.
```

I also tried mounting using `mount` to mount the partition.

```
# mount -t ntfs /dev/da0s1 /mnt
mount: /dev/da0s1: Operation not supported by device
```
Fuse is enabled in etc/rc.conf

```
# cat /etc/rc.conf | grep fuse
fuse_enable="YES"
```
I am able to mount other devices. So I believe it is an error in the creation process. If there is a more suitable section for this thread please place it there.

I have tried to remove sysutils/ntfs-3g and replace it with sysutils/ntfsprogs to no avail. I read a post from here:
https://javaz.org/2012/02/freebsd-create-ntfs-partition/
These are the steps I took when using `ntfsprogs`

```
gpart create -s mbr da0
da0 created
gpart add -t fat32 da0
da0s1 added
mkntfs -L test /dev/da0s1
Cluster size has been automatically set to 4096 bytes.
Initializing device with zeroes:  99%Failed to complete writing to /dev/da0s1 after three retries.
This should not happen.
```


----------



## tobik@ (Jul 1, 2015)

You need to create a filesystem first, just creating the partition is not enough. See mkntfs(8).


----------



## Zack (Jul 1, 2015)

tobik said:


> You need to create a filesystem first, just creating the partition is not enough. See mkntfs(8).


I edited the post above and hadn't realized you posted. Yes I have tried that too. I also forgot a step that I will add.


----------



## tobik@ (Jul 1, 2015)

sysutils/fusefs-ntfs contains `mkntfs`, too. Can you try it with that version? sysutils/ntfsprogs is just an older version of sysutils/fusefs-ntfs.

What's your goal anyway? It does not sound like you need NTFS specifically?

`newfs_msdos -F32 /dev/da0s1` creates a FAT32 filesystem which you can mount with mount_msdosfs(8). If you just need something that's compatible with Windows and FreeBSD out of the box that's what you should use IMO.


----------



## Zack (Jul 1, 2015)

tobik said:


> sysutils/fusefs-ntfs contains `mkntfs`, too. Can you try it with that version? sysutils/ntfsprogs is just an older version of sysutils/fusefs-ntfs.
> 
> What's your goal anyway? It does not sound like you need NTFS specifically?
> 
> `newfs_msdos -F32 /dev/da0s1` creates a FAT32 filesystem which you can mount with mount_msdosfs(8). If you just need something that's compatible with Windows and FreeBSD out of the box that's what you should use IMO.


Yes but that didn't work either. It doesn't seem to create a FAT32 filesystem on the device..

```
#gpart create -s mbr da0
da0 created
#gpart add -t fat32 da0
da0s1 added
#newfs_msdos -F32 /dev/da0s1
/dev/da0s1: 62318528 sectors in 973727 FAT32 clusters (32768 bytes/cluster)
BytesPerSec=512 SecPerClust=64 ResSectors=32 FATs=2 Media=0xf0 SecPerTrack=63 Heads=255 HiddenSecs=0 HugeSectors=62333838 FATsecs=7608 RootCluster=2 FSInfo=1 Backup=2
```
Mounting it

```
#mount_msdosfs /dev/da0s1 /mnt
mount_msdosfs: /dev/da0s1: Invalid argument

# ntfsmount /dev/da0s1 /mnt
Failed to startup volume: Invalid argument.
Failed to mount '/dev/da0s1': Invalid argument.
The device '/dev/da0s1' doesn't have a valid NTFS.
Maybe you selected the wrong device? Or the whole disk instead of a
partition (e.g. /dev/hda, not /dev/hda1)? Or the other way around?
Mount failed.
```
I don't see what I'm doing wrong here. Any ideas?

EDIT:
From following the same steps but instead using `mkntfs` from sysutils/fuse-ntfs I received:

```
# mkntfs /dev/da0s1
/dev/da0s1 is not a block device.
Refusing to make a filesystem here!
```

I tried the same steps using `newfs_msdos -F32 /dev/da0s1` on a USB stick instead of an SD card and it worked perfect. Maybe the SD card is bad?


----------



## tobik@ (Jul 1, 2015)

I just replicated what you did and it works here (with either `newfs_msdosfs -F32 /dev/da0s1` or `mkntfs -Ff /dev/da0s1`). Maybe your SD card is faulty? Do you see any error message in `dmesg`?

EDIT: Too late... Same thought as you.


----------



## Zack (Jul 1, 2015)

Hm, must be the SD card then, it is safe to say that after we have both replicated it with no errors on devices.


----------



## Zack (Jul 2, 2015)

Still having a bit of trouble with this! I am not able to mount any NTFS devices at all. Same old error message...
`ntfs-3g /dev/da0s1 /mnt`

```
# ntfs-3g /dev/da0s1 /mnt
NTFS signature is missing.
Failed to mount '/dev/da0s1': Invalid argument
The device '/dev/da0s1' 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?
```
`ntfsfix`

```
# ntfsfix /dev/da0s1
Mounting volume... NTFS signature is missing.
FAILED
Attempting to correct errors... NTFS signature is missing.
FAILED
Failed to startup volume: Invalid argument
NTFS signature is missing.
Trying the alternate boot sector
Error reading alternate bootsector: Invalid argument
NTFS signature is missing.
Unrecoverable error
Volume is corrupt. You should run chkdsk.
```
I believe it has to be a problem with the program here on FreeBSD. On Debian it mounts just fine, after taking those steps. It is a brand spankin' new USB.


----------



## sk8harddiefast (Jul 6, 2015)

Put the disk on Debian and just reformat it with gparted. That's I do when I want to format a disk. Yes. Is against FreeBSD. I know. But gparted is an extremely useful tool. The reason that gparted doesn't ported yet is wrong. Just because doesn't support UFS and ZFS filesystems. But in reality every usb and external HDD we always format it on NTFS just because the files we want to take with us to our friends home must be in NTFS. Our friends, don't run FreeBSD. Not even Linux. So the HDD must be in a compatible FS. That's only one FS. NTFS! And there is only one easy and powerful tool for that. Is gparted!
PS: ntfs-3g working here perfect


----------



## protocelt (Jul 6, 2015)

sk8harddiefast said:


> Put the disk on Debian and just reformat it with gparted. That's I do when I want to format a disk. Yes. Is against FreeBSD. I know. But gparted is an extremely useful tool. The reason that gparted doesn't ported yet is wrong. Just because doesn't support UFS and ZFS filesystems. But in reality every usb and external HDD we always format it on NTFS just because the files we want to take with us to our friends home must be in NTFS. Our friends, don't run FreeBSD. Not even Linux. So the HDD must be in a compatible FS. That's only one FS. NTFS! And there is only one easy and powerful tool for that. Is gparted!
> PS: ntfs-3g working here perfect


If the portable data is important to you I would advise against using FUSE based file systems on FreeBSD, specifically sysutils/fusefs-ntfs. I've already lost data a few times on flash media due to this port. FAT32, to my knowledge, is generally the only reliable and non-network based file system to use for portability between FreeBSD and Windows at this time. Having said that, I do sometimes use sysutils/fusefs-exfat anyway from time to time for unimportant things.


----------



## sk8harddiefast (Jul 6, 2015)

FAT32 has a very big disadvantage. Cannot write files bigger than 2 GB. So if you want to copy a 4gb movie, you can't


----------



## protocelt (Jul 6, 2015)

sk8harddiefast said:


> FAT32 has a very big disadvantage. Cannot write files bigger than 2 GB. So if you want to copy a 4gb movie, you can't


True, which is why I do use sysutils/fusefs-exfat from time to time. However, when I do, I always copy the data twice; once on machine elsewhere on the disk first just in case , and then to the flash/external drive. I _never_ just move the files to the flash/external drive. So far I haven't had problems with EXFAT, but I still don't trust it. Having a separate small file server using samba makes life little bit easier when using multiple operating systems in the same house


----------



## sk8harddiefast (Jul 6, 2015)

On the same house I don't have problem. I don't have Windows machine and my data is on my NAS... FreeNAS  using NFS or FTP protocol or SSH sometimes


----------

