issue with usb hdd

From: Alexander Best <arundel_at_freebsd.org>
Date: Fri, 18 Nov 2011 08:02:40 +0000
hi there,

i recently bought a western digital 1 terrabyte usb2/usb3 hdd:

[83611.209514] umass0: <MSC Bulk-Only Transport> on usbus3
[83613.618514] da0 at umass-sim0 bus 0 scbus6 target 0 lun 0
[83613.618514] da0: <WD My Passport 0740 1003> Fixed Direct Access SCSI-6 device 
[83613.618514] da0: 40.000MB/s transfers
[83613.618514] da0: 953837MB (1953458176 512 byte sectors: 255H 63S/T 121597C)

i partitioned it via the gpt scheme and one big ufs2 partition with SU+J
enabled:

Geom name: da0
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 1953458142
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: da0p1
   Mediasize: 1000170551808 (931G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17408
   Mode: r0w0e0
   rawuuid: 39d3bf09-fb47-11e0-ade1-000fb58207c8
   rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 1000170551808
   offset: 17408
   type: freebsd-ufs
   index: 1
   end: 1953458142
   start: 34
Consumers:
1. Name: da0
   Mediasize: 1000170586112 (931G)
   Sectorsize: 512
   Mode: r0w0e0


=>        34  1953458109  da0  GPT  (931G)
          34  1953458109    1  freebsd-ufs  (931G)


tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 enabled
tunefs: soft update journaling: (-j)                       enabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         disabled
tunefs: maximum blocks per file in a cylinder group: (-e)  4096
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)                                 wd

mounting and everything works great. however if i don't access the monted hdd
for a couple of hours, and then do `ls /mnt/wd`, nothing is there. `mount -p`
reports that the hdd is still mounted:

/dev/ufs/rootfs		/			ufs	ro		1 1
devfs			/dev			devfs	rw		0 0
/dev/ufs/varfs		/var			ufs	rw		1 2
/dev/ufs/usrfs		/usr			ufs	rw		1 2
linprocfs		/usr/compat/linux/proc	linprocfs	rw		0 0
linsysfs		/usr/compat/linux/sys	linsysfs	rw		0 0
devfs			/usr/compat/linux/dev	devfs	rw		0 0
linprocfs		/usr/local/gentoo-stage3/proc linprocfs	rw		0 0
linsysfs		/usr/local/gentoo-stage3/sys linsysfs	rw		0 0
devfs			/usr/local/gentoo-stage3/dev devfs	rw		0 0
tmpfs			/tmp			tmpfs	rw		0 0
tmpfs			/var/tmp		tmpfs	rw		0 0
/dev/ufs/wd		/mnt/wd			ufs	rw,noexec,nosuid 	0 0

`pwd` executed will return ENXIO. i can then do `umount /mnt/wd`, but
re-mounting the hdd fails with the following dmesg warnings:

[96836.840512] (probe0:umass-sim0:0:0:1): TEST UNIT READY. CDB: 0 0 0 0 0 0 
[96836.840512] (probe0:umass-sim0:0:0:1): CAM status: SCSI Status Error
[96836.840512] (probe0:umass-sim0:0:0:1): SCSI status: Check Condition
[96836.840512] (probe0:umass-sim0:0:0:1): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command operation code)
[97109.824517] WARNING: R/W mount of /mnt/wd denied.  Filesystem is not clean - run fsck
[97109.824517] WARNING: Forced mount will invalidate journal contents
[97126.200518] WARNING: R/W mount of /mnt/wd denied.  Filesystem is not clean - run fsck
[97126.200518] WARNING: Forced mount will invalidate journal contents
[97129.283518] WARNING: R/W mount of /mnt/wd denied.  Filesystem is not clean - run fsck
[97129.283518] WARNING: Forced mount will invalidate journal contents
[97133.904518] WARNING: R/W mount of /mnt/wd denied.  Filesystem is not clean - run fsck
[97133.904518] WARNING: Forced mount will invalidate journal contents

(i believe the "probe0" stuff is from the umount)

`mount` fails with EPERM btw. what i have to do is: `fsck /dev/ufs/wd`. this
complains about the following:

** /dev/ufs/wd

USE JOURNAL? [yn] y

** SU+J Recovering /dev/ufs/wd
** Reading 33554432 byte journal from inode 4.

RECOVER? [yn] y

** Building recovery table.
** Resolving unreferenced inode list.
** Processing journal entries.

***** FILE SYSTEM MARKED CLEAN *****

...now everything is back to normal and i can mount the hdd again. any
suggestions? i'm running a very recent HEAD on amd64.

cheers.
alex
Received on Fri Nov 18 2011 - 07:02:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:20 UTC