Closed probonopd closed 2 years ago
This is the test that writes not a block device in the log file:
# FUNCTION: check if device is a block device
__check_block_device() { # 1=DEV
# first check if its block device
if ! fstyp ${1} 1> /dev/null 2>&1
then
__log "${DEV}: not a block device"
exit 0
fi
}
Can you give me output of these below?
fstyp /dev/da1
echo ${?}
fstyp /dev/da1s1
echo ${?}
Thanks.
fstyp: /dev/da1: filesystem not recognized
1
fstyp: /dev/da1s1: filesystem not recognized
1
truss
output makes me wonder whether fstyp
doesn't like the MSWIN4.1
or otherwise cannot read something:
...
lseek(4,0x8000,SEEK_SET) = 32768 (0x8000)
read(4,"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,4096) = 4096 (0x1000)
lseek(4,0x0,SEEK_SET) = 0 (0x0)
read(4,"\M-k<\M^PMSWIN4.1\0\^B\b\^A\0\^B"...,4096) = 4096 (0x1000)
lseek(4,0x400,SEEK_SET) = 1024 (0x400)
read(4,"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,4096) = 4096 (0x1000)
lseek(4,0x400,SEEK_SET) = 1024 (0x400)
read(4,"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,4096) = 4096 (0x1000)
lseek(4,0x0,SEEK_SET) = 0 (0x0)
read(4,"\M-k<\M^PMSWIN4.1\0\^B\b\^A\0\^B"...,4096) = 4096 (0x1000)
lseek(4,0x0,SEEK_SET) = 0 (0x0)
read(4,"\M-k<\M^PMSWIN4.1\0\^B\b\^A\0\^B"...,4096) = 4096 (0x1000)
pread(4,"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,8192,0x10000) = 8192 (0x2000)
pread(4,"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,8192,0x2000) = 8192 (0x2000)
pread(4,"\M-k<\M^PMSWIN4.1\0\^B\b\^A\0\^B"...,8192,0x0) = 8192 (0x2000)
pread(4,"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,8192,0x40000) = 8192 (0x2000)
fstyp: write(2,"fstyp: ",7) = 7 (0x7)
/dev/da0s1: filesystem not recognizedwrite(2,"/dev/da1s1: filesystem not recog"...,37) = 37 (0x25)
write(2,"\n",1) = 1 (0x1)
getpid() = 5023 (0x139f)
exit(0x1)
process exit, rval = 1
fstyp: /dev/da1: filesystem not recognized 1 fstyp: /dev/da1s1: filesystem not recognized 1
So with this in mind you should submit a bug on FreeBSD to make sure fstyp(8) works and detects filesystem on that platform/architecture you use.
In the past I tried to detect it myself with file(1) and dd(8) and strings(1) commands ... but moved to fstyp(1) as it was more reliable. Seems its not true for all architectures ...
Be fast ... maybe the needed fix will make its way to upcoming 13.1-RELEASE version :)
Regards.
FreeBSD% dd if=/dev/da1s1 of=/tmp/partition1.dd
1737+0 records in
1737+0 records out
889344 bytes transferred in 10.468566 secs (84954 bytes/sec)
FreeBSD% dd if=/dev/da0s1 of=/tmp/partition1.dd bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes transferred in 0.992788 secs (1056193 bytes/sec)
FreeBSD% file /tmp/partition1.dd
/tmp/partition1.dd: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "MSWIN4.1", sectors/cluster 8, root entries 512, Media descriptor 0xf8, sectors/FAT 129, sectors/track 1, heads 1, hidden sectors 1, sectors 262143 (volumes > 32 MB), serial number ..., label: "RPI-RP2 ", FAT (16 bit)
FreeBSD% fstyp /tmp/partition1.dd
fstyp: /tmp/partition1.dd: filesystem not recognized
Attached is the dd dump.
Reported upstream: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262896
Thank you.
Thanks for your help in finding the root cause.
When attaching a Raspberry Pi Pico with the BOOTSEL button held down, there should be a USB storage device mounted so that the user can copy the firmware there.
But no drive is mounted by
automount
.dmesg
says:geom list disk
says:cat /var/log/automount.log
says:Mounting like this manually works:
Not sure what is going on. Maybe the device is not fast enough and something needs more time?
How to debug this best?