# extern hdd



## xnl96 (Dec 13, 2010)

I use a FreeBSD 8.0 and I mount a extern hdd, but when I try to write to the extern hdd I get this:

```
g_vfs_done():da0s6[WRITE(offset=39710490624, length=131072)]error = 5
g_vfs_done():da0s6[WRITE(offset=39710621696, length=131072)]error = 5
g_vfs_done():da0s6[WRITE(offset=39710752768, length=114688)]error = 5
g_vfs_done():da0s6[WRITE(offset=39710867456, length=114688)]error = 5
g_vfs_done():da0s6[WRITE(offset=39711145984, length=131072)]error = 5
g_vfs_done():da0s6[WRITE(offset=39711277056, length=131072)]error = 5
g_vfs_done():da0s6[WRITE(offset=39711408128, length=131072)]error = 5
g_vfs_done():da0s6[WRITE(offset=39710343168, length=131072)]error = 5
ugen6.2: <Maxtor Corporation> at usbus6 (disconnected)
umass0: at uhub6, port 1, addr 2 (disconnected)
(da0:umass-sim0:0:0:0): AutoSense failed
g_vfs_done():da0s6[WRITE(offset=39710654464, length=131072)]error = 5
g_vfs_done():da0s6[WRITE(offset=39710785536, length=131072)]error = 5
g_vfs_done():da0s6[WRITE(offset=39710916608, length=131072)]error = 5
g_vfs_done():da0s6[WRITE(offset=39711047680, length=131072)]error = 5
g_vfs_done():da0s6[WRITE(offset=39711178752, length=98304)]error = 5
g_vfs_done():da0s6[WRITE(offset=39711277056, length=81920)]error = 5
(da0:umass-sim0:0:0:0): lost device
(da0:umass-sim0:0:0:0): Invalidating pack
g_vfs_done():da0s6[WRITE(offset=85748154368, length=16384)]error = 5
g_vfs_done():da0s6[WRITE(offset=65536, length=2048)]error = 5
g_vfs_done():da0s6[WRITE(offset=6144000, length=8192)]error = 5
g_vfs_done():da0s6[WRITE(offset=39710523392, length=131072)]error = 5
g_vfs_done():da0s6[WRITE(offset=39710687232, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39710359552, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39710818304, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39710949376, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39711080448, length=98304)]error = 6
g_vfs_done():da0s6[WRITE(offset=39711375360, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39711506432, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39711195136, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39711326208, length=49152)]error = 6
g_vfs_done():da0s6[WRITE(offset=39711637504, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39711768576, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39711899648, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39712030720, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39712161792, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39712292864, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39712423936, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39712555008, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39712686080, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39712817152, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39712948224, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39713079296, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39713210368, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39713341440, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39713472512, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39713603584, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39713734656, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39713865728, length=131072)]error = 6
g_vfs_done():da0s6[WRITE(offset=39713996800, length=131072)]error = 6
(da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0xa, scsi status == 0x0
(da0:umass-sim0:0:0:0): removing device entry
```
What is wrong?


----------



## sk8harddiefast (Dec 13, 2010)

You try to mount it on boot?


----------



## xnl96 (Dec 13, 2010)

I mount the hdd when so is started from console


----------



## sk8harddiefast (Dec 13, 2010)

That means after boot, if I understood right. What FS is the external hdd?


----------



## xnl96 (Dec 13, 2010)

What means "fs"? The hdd is a Seagate baracuda 7200 500 G


----------



## sk8harddiefast (Dec 13, 2010)

FS=File System. I mean is on NTFS, ext2/ext3/ext4, UFS?
And with what mount flag you mounted it?
I mean that if is NTFS the way to mount it, should be: mount_ntfs /dev/da0s6 /path/to/mout/it
Ex: mount_ntfs /dev/da0s1 /mnt/usb


----------



## xnl96 (Dec 13, 2010)

i use 1 partison fat32 and a ufs slice , the result are identical if i try to write to ufs or fat32


----------



## sk8harddiefast (Dec 13, 2010)

That I try to understand is if you mount right the disk. I am not an expert on FreeBSD but maybe this help you:
Mount NTFS:

```
mount_ntfs /dev/da0s1 /mnt/usb
```
da0s1=your partition
/mnt/usb= the path that will be mounted
Mount FAT32:

```
mount_msdosfs /dev/da0s1 /mnt/usb
```
Mount FAT32 large partition:

```
mount_msdosfs -o large /dev/da0s1 /mnt/usb
```
Mount UFS:

```
mount -t ufs /dev/ad12s1d /mnt/usb
```
For write access you need to set *-o rw* on mount command.
Ex: 
	
	



```
mount_msdosfs -o rw /dev/da0s1 /mnt/usb
```
If something is wrong please someone correct me!


> I use a freebsd8.0


Also upgrade to 8.1-RELEASE.

```
freebsd-update upgrade -r 8.1-RELEASE
```


----------



## xnl96 (Dec 13, 2010)

i do this only that I don't did 
	
	



```
Also upgrade to 8.1-RELEASE. 
freebsd-update upgrade -r 8.1-RELEASE
```


----------



## sk8harddiefast (Dec 13, 2010)

I am not sure but I think that FreeBSD 8 had a little issue about disks, sync etc. Is a long time ago and I don't remember good.


----------



## wblock@ (Dec 13, 2010)

xnl96 said:
			
		

> I use a freebsd8.0 and i mount a extern hdd , but when i try to write to the extern hdd i get this
> 
> 
> 
> ...



After the drive was mounted, it was turned off, or the cable disconnected, or the USB interface was unhappy enough that it disconnected.  The g_vfs errors are the filesystem complaining that it can't write to the drive.  Eventually it gives up, and those changes to the files on that drive are lost.

How to fix the problem depends on what caused it.  If it was human error, avoid that by always unmounting the external drive before disconnection.  Maybe it needs an external power supply.  Some USB drives have weirdnesses ("quirks") that have to be fixed in the FreeBSD USB system or with usbconfig(8).  It could also be a problem with the drive, either the hard drive itself, or the USB circuitry in it, or an external power supply.


----------



## fronclynne (Dec 13, 2010)

It also might be going into sleep mode and failing to wake up.  A lot of the modern stuff has insanely short sleep times.


----------



## wblock@ (Dec 13, 2010)

fronclynne said:
			
		

> It also might be going into sleep mode and failing to wake up.  A lot of the modern stuff has insanely short sleep times.



Good point.  I successfully used wdidle3 last week to disable the park/sleep time on a WD320BEVT.  It was set to 4 seconds for default.  Like a boggie, slow to anger or pretty much anything else.


----------

