# USB Hard Drive Cause FreeBSD restart unexpectedly



## aceman (Nov 5, 2012)

Hi All,

I am having problem of the Freebsd restarting unexpectedly.

1. I Plugged the USB Drive
_log:_

```
<datetime><hostname> kernel: da1: <WD My Book 1140 1012> Fixed Direct Access SCSI-6 device 
<datetime><hostname> kernel: da1: 40.000MB/s transfers
<datetime><hostname> kernel: da1: 1907697MB (3906963456 512 byte sectors: 255H 63S/T 243197C)
<datetime><hostname> kernel: ses0 at umass-sim0 bus 0 target 0 lun 1
<datetime><hostname> kernel: ses0: <WD SES Device 1012> Fixed Enclosure Services SCSI-6 device 
<datetime><hostname> kernel: ses0: 40.000MB/s transfers
<datetime><hostname> kernel: ses0: SCSI-3 SES Device
<datetime><hostname> kernel: GEOM_LABEL: Label for provider da1s1 is ntfs/My Book.
<datetime><hostname> kernel: GEOM_LABEL: Label ntfs/My Book removed.
```


2. Mounted the external drive, using

```
mount -t ntfs -o force /dev/da1s1 /mnt/WD
```
_log:_

```
<datetime><hostname> ntfs-3g[11289]: Version 1.2531 external FUSE 27
<datetime><hostname> ntfs-3g[11289]: Mounted /dev/da1s1 (Read-Write, label "My Book", NTFS 3.1)
<datetime><hostname> ntfs-3g[11289]: Cmdline options: force
<datetime><hostname> ntfs-3g[11289]: Mount options: silent,allow_other,nonempty,relatime,fsname=/dev/da1s1
```

3. copy around 800GB of data, using

```
cp -Rfvvv /home/user /mnt/WD/files
```

log

```
<datetime><hostname> kernel: fsync: giving up on dirty
<datetime><hostname> kernel: 0xc926a114: tag fuse, type VREG
<datetime><hostname> kernel: usecount 0, writecount 0, refcount 3 mountedhere 0
<datetime><hostname> kernel: flags (VI_DOOMED)
<datetime><hostname> kernel: v_object 0xc9881d14 ref 0 pages 16
<datetime><hostname> kernel: lock type fuse: EXCL (count 1) by thread 0xc6b8f690 (pid 54)
<datetime><hostname> kernel: nodeid: 278516, parent_nid: 276217, fh_counter: 0, nlookup: 1, flags: 0
<datetime><hostname> kernel: fsync: giving up on dirty
<datetime><hostname> kernel: 0xcaea0ac8: tag fuse, type VREG
<datetime><hostname> kernel: usecount 0, writecount 0, refcount 3 mountedhere 0
<datetime><hostname> kernel: flags (VI_DOOMED)
<datetime><hostname> kernel: v_object 0xc7787ba0 ref 0 pages 16
<datetime><hostname> kernel: lock type fuse: EXCL (count 1) by thread 0xc6b8f690 (pid 54)
<datetime><hostname> kernel: nodeid: 281223, parent_nid: 278523, fh_counter: 0, nlookup: 1, flags: 0
```


all the copying process seems fine at the beginning, but then the log show up and a couple hours later it restarts.

Any Advise?


----------



## SirDice (Nov 5, 2012)

I'm surprised it let you write at all.

From mount_ntfs(8):

```
WRITING
     There is limited writing ability.  Limitations: file must be nonresident
     and must not contain any sparces (uninitialized areas); compressed files
     are also not supported.  The file name must not contain multibyte charac-
     ters.
```
And

```
CAVEATS
     This utility is primarily used for read access to an NTFS volume.  See
     the WRITING section for details about writing to an NTFS volume.

     For a full read-write NTFS support consider sysutils/fusefs-ntfs
     port/package.
```


----------



## T-Daemon (Nov 5, 2012)

SirDice said:
			
		

> ```
> [/quote]
> 
> Off-Topic
> ...


----------



## SirDice (Nov 5, 2012)

Yeah, I know. But we've used [code][/code] for man pages everywhere else and I like to be consistent


----------



## jb_fvwm2 (Nov 5, 2012)

I'd suggest using rsync ... bwlimit  (search the forums for the long CLI...) it can do a slow-speed copy that may (might not, but...) go slow enough for the driver. (It would take longer to complete, but that is a LOT of data to copy...)


----------



## aceman (Nov 7, 2012)

SirDice said:
			
		

> I'm surprised it let you write at all.



It is working on small files.

so, I should rsyncand use bwlimit option.


May I know what is the reason this happen?


----------



## usdmatt (Nov 7, 2012)

As SirDice pointed to, the ntfs driver in FreeBSD doesn't have great write support and is mainly used just good enough to get access to data on an ntfs file system. It's not great when writing (especially if you're using that force option because you have problems mounting it otherwise...)

I would try sysutils/fusefs-ntfs if you really need to use ntfs (As also suggested in the quoted man page), it's has much more developed/tested write support. That or just use UFS if you don't need Windows access.

Also may be worth doing a chkdsk on a Windows machine to make sure there's no file system errors.


----------



## wblock@ (Nov 7, 2012)

Does the external drive have its own power supply?  If not, a heavy load on it may need more power than the USB port can supply.


----------



## aceman (Nov 10, 2012)

yes, the external drive has it's own power supply -  I will try to install the sysutils/fusefs
will check if there is any problem


----------



## fmw (Nov 15, 2012)

Erm, huh...



			
				aceman said:
			
		

> Hi
> 
> _log:_
> 
> ...



So it would appear to be using the fusefs driver already:q

What is the force option good for? Does it fail to mount without it?


----------



## Flogo (Nov 16, 2012)

Hi,

I'm not sure it will help but I had the same problem with a windows partition and fusefs.
It seems that if you use root to write it works but as soon as you use an user it will reboot FreeBSD unexpectedly.

Flogo


----------



## Mage (Feb 20, 2013)

Flogo said:
			
		

> Hi,
> 
> I'm not sure it will help but I had the same problem with a windows partition and fusefs.
> It seems that if you use root to write it works but as soon as you use an user it will reboot FreeBSD unexpectedly.
> ...



I have this problem for a long time. Every fuse-fs reboots my FreeBSD. No matter which one I try to use: sshfs, ntfs, exfat, the result is a big fat reboot on write or umount.

The issue persists for at least a year. I contacted the sshfs maintainer, however, I realized that it is a general fuse-fs problem.

The kernel is generic amd64 on zfs root and the computer is stable, it is my desktop. I rebuild the world every two weeks.

There are no useful logs to attach. It just reboots with fuse all the time.


----------

