On 1/2/2019 4:21 PM, myml...@gmx.com wrote:

On 1/1/19 10:02 PM, Philip Guenther wrote:
On Tue, Jan 1, 2019 at 6:27 PM myml...@gmx.com <mailto:myml...@gmx.com> <myml...@gmx.com <mailto:myml...@gmx.com>> wrote:

    I just did a new install of current AMD64 from the 12/31/2018
    snapshot
    and having some permission issues mounting a usb drive, as root.
    I have
    been able to mount other usb drives just fine. (Also tried with the
    12/29 snapshots as well, same issue)

    #disklabel sd4

...

    #                size           offset  fstype [fsize bsize   cpg]
       a:        249682144               64  4.2BSD   2048 16384 12958
       c:        249692160                0  unused

    curry:/root:#mount -v /dev/sd4a /mnt/usb0
    mount_ffs: /dev/sd4a on /mnt/usb0: Permission denied

    I don't see any kind of messages in the logs related to the error.


 What's the output of "fsck /dev/rsd4a" ?

Philip Guenther

I had to reboot the machine related to this and the drive attached as a different device but here's the output.

20190102-1407:root@curry:/root:#disklabel sd2
# /dev/rsd2c:
type: SCSI
disk: SCSI disk
label: Survivor 3.0
duid: 70568afde7f5a241
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 15542
total sectors: 249692160
boundstart: 64
boundend: 249682230
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize   cpg]
   a:        249682144               64  4.2BSD   2048 16384 12958
   c:        249692160                0  unused

Fsck shows clean, I noticed however the (NO WRITE) bit at the end.

20190102-1408:root@curry:/root:#fsck /dev/sd2a
** /dev/rsd2a (NO WRITE)
** File system is clean; not checking

I was able to get the drive mounted in read only mode after mounting one of the directories, of course the most important one, gives a bad file descriptor and doesn't recognize it as a directory.

20190102-1410:root@curry:/root:#mount -o ro /dev/sd2a /mnt/usb0
20190102-1410:root@curry:/root:#ls /mnt/usb0
root   sata0  tbisch usb0   usb1

20190102-1410:root@curry:/root:#ls -l /mnt/usb0
ls: tbisch: Bad file descriptor
total 16
drwx------  8 root  wheel   512 Dec 28 06:33 root
drwxr-xr-x  2 root  wheel   512 Dec 30 21:01 sata0
drwxr-xr-x  9 root  wheel  1024 Dec 31  1979 usb0
drwxr-xr-x  2 root  wheel   512 Dec 30 21:01 usb1

20190102-1410:root@curry:/root:#ls /mnt/usb0/tbisch/
ls: /mnt/usb0/tbisch/: Not a directory

I tried unmounting and doing a fsck -f -y /dev/sd4a and it shows lots of errors, but doesn't give y for the answer as I thought the -y flag was supposed to do:

20190102-1413:root@curry:/root:#fsck -f -y /dev/sd2a
** /dev/rsd2a (NO WRITE)
** File system is already clean
** Last Mounted on /mnt/usb2
** Phase 1 - Check Blocks and Sizes
PARTIALLY ALLOCATED INODE I=25984
CLEAR? no

UNKNOWN FILE TYPE I=25985
CLEAR? no

UNKNOWN FILE TYPE I=25986
CLEAR? no

UNKNOWN FILE TYPE I=25987
CLEAR? no

UNKNOWN FILE TYPE I=25988
CLEAR? no

UNKNOWN FILE TYPE I=25989
CLEAR? no

UNKNOWN FILE TYPE I=25990
CLEAR? no

UNKNOWN FILE TYPE I=25991
CLEAR? no

UNKNOWN FILE TYPE I=25992
CLEAR? no

UNKNOWN FILE TYPE I=25993
CLEAR? no

UNKNOWN FILE TYPE I=25994
CLEAR? no

UNKNOWN FILE TYPE I=25995
CLEAR? no

UNKNOWN FILE TYPE I=25996
CLEAR? no

UNKNOWN FILE TYPE I=25997
CLEAR? no

PARTIALLY ALLOCATED INODE I=25998
CLEAR? no

UNKNOWN FILE TYPE I=25999
CLEAR? no

PARTIALLY ALLOCATED INODE I=26000
CLEAR? no

UNKNOWN FILE TYPE I=26001
CLEAR? no

UNKNOWN FILE TYPE I=26002
CLEAR? no

UNKNOWN FILE TYPE I=26003
CLEAR? no

UNKNOWN FILE TYPE I=26004
CLEAR? no

UNKNOWN FILE TYPE I=26005
CLEAR? no

UNKNOWN FILE TYPE I=26006
CLEAR? no

UNKNOWN FILE TYPE I=26007
CLEAR? no

UNKNOWN FILE TYPE I=26008
CLEAR? no
............  and it keeps going.


I unmounted the drive and tried to create an image of the drive, but it fails

20190102-1435:root@curry:/root:#time dd if=/dev/rsd2c of=/root/corsair.iso bs=1k
dd: /dev/rsd2c: Input/output error
15958016+0 records in
15958016+0 records out
16341008384 bytes transferred in 7313.789 secs (2234274 bytes/sec)
   122m03.94s real     0m16.54s user     6m36.66s system

After this doing a disklabel fails:

#disklabel sd2
disklabel: ioctl DIOCGDINFO: Input/output error

Additionally I see the following in the /var/log/messages.

Jan  2 13:52:52 curry /bsd: usb_insert_transfer: xfer=0xffffff025c1a35a0 not free




Does it work when you revert back to the last version of OpenBSD it mounted properly? There is a slight possibility that a code change has made OpenBSD unable to communicate properly with the controller (like the controller is expecting the OS to do the wear-leveling remapping or something), but its far more likely that the device is broken especially since OpenBSD seems to be able to read the partition table, but only parts of the file table and only a portion of your sectors.

The most likely scenario here is that your USB drive is broken and useless.

Reply via email to