LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Mount USB on a hardware device - BusyBox 1.0 (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/mount-usb-on-a-hardware-device-busybox-1-0-a-4175424598/)

scrabble 08-29-2012 09:42 AM

Mount USB on a hardware device - BusyBox 1.0
 
hey there everybody,

I m having lots of trouble with a TS-7260 Single Board computer that is somehow equipped with a small UNIX version for hardwre devices called BusyBox v1.0.

This device is hooked up with an old accelerometer and a GPS Engine in order to log seismic events.
Since I got this acquisition system as a present, I have wether README files nor manuals on this and I may not change any settings or pre-installed operational systems. the thing is, that a usb flash drive is hooked up to the ts-7260 board but I donīt know what is on there since canīt mount it or read it with any other OS.
If I am logged in via ssh and try to mount it with

$ mount -t vfat /dev/scsi/host0/bus0/target0/lun0/part1 /mnt/cf/

as suggested in a really old manual I get an error like this:

mount: Mounting /dev/scsi/host0/bus0/target0/lun0/part1 on /mnt/cf failed: Device or resource busy


All commands that are available on BusyBox v1.0 are listed bellow:



Built-in commands:
-------------------
. : alias bg break cd chdir continue eval exec exit export false
fg hash help jobs kill let local pwd read readonly return set
shift times trap true type ulimit umask unalias unset wait [
addgroup adduser adjtimex ar ash awk basename bunzip2 busybox
bzcat cat chgrp chmod chown chroot chvt clear cmp cp crond cut
date dc dd deallocvt delgroup deluser devfsd df dirname dmesg
dpkg dpkg-deb du dumpleases echo egrep env expr false fbset fdisk
fgrep find free ftpget ftpput getty grep gunzip gzip halt hdparm
head hostid hostname hwclock id ifconfig ifdown ifup inetd insmod
install kill killall klogd ln logger login logread ls lsmod makedevs
md5sum mkdir mknod mkswap mktemp modprobe more mount mv openvt
passwd pidof ping pivot_root poweroff ps pwd reboot reset rm
rmdir rmmod route sed sh sleep sort start-stop-daemon strings
su sulogin swapoff swapon sync syslogd tail tar tee telnet telnetd
test tftp time touch tr traceroute true tty udhcpc udhcpd umount
uname uncompress uniq unzip uptime usleep vi wc wget which whoami
xargs yes zcat





Is it possible to add new commands to the system and see what is on the USB drive?

Thanks a lot folks and greetings from Chile

suicidaleggroll 08-29-2012 09:48 AM

What is the output of "fdisk -l"?

scrabble 08-29-2012 10:00 AM

$ fdisk -l

Disk /dev/scsi/host0/bus0/target0/lun0/disc: 8004 MB, 8004304896 bytes
35 heads, 21 sectors/track, 21269 cylinders
Units = cylinders of 735 * 512 = 376320 bytes

Device Boot Start End Blocks Id System
/dev/scsi/host0/bus0/target0/lun0/part1 1 21270 7816688 b Win95 FAT32

michaelk 08-29-2012 10:10 AM

The TS7200 should be similar to the 7260 and by default the USB modules are not loaded. Try running loadUSBModules.sh. Once the script completes the device ID for the USB drive should be created and you can then mount it.

Also make sure your not actually in the /mnt/cf directory when trying to mount the drive.

scrabble 08-29-2012 10:19 AM

Thanks alot for your advice. But this is what I get:

$ pwd
/root
$ /usr/bin/loadUSBModules.sh
Using /lib/modules/2.4.26-ts11/kernel/drivers/usb/usbcore.o
insmod: A module named usbcore already exists
Using /lib/modules/2.4.26-ts11/kernel/arch/arm/common/pcipool.o
insmod: A module named pcipool already exists
Using /lib/modules/2.4.26-ts11/kernel/drivers/usb/host/usb-ohci.o
insmod: A module named usb-ohci already exists
Using /lib/modules/2.4.26-ts11/kernel/drivers/usb/host/usb-ohci-ep93xx.o
insmod: A module named usb-ohci-ep93xx already exists
Using /lib/modules/2.4.26-ts11/kernel/drivers/scsi/scsi_mod.o
insmod: A module named scsi_mod already exists
Using /lib/modules/2.4.26-ts11/kernel/drivers/scsi/sd_mod.o
insmod: A module named sd_mod already exists
Using /lib/modules/2.4.26-ts11/kernel/drivers/usb/storage/usb-storage.o
insmod: A module named usb-storage already exists
$ pwd
/root
$ fdisk -l

Disk /dev/scsi/host0/bus0/target0/lun0/disc: 8004 MB, 8004304896 bytes
35 heads, 21 sectors/track, 21269 cylinders
Units = cylinders of 735 * 512 = 376320 bytes

Device Boot Start End Blocks Id System
/dev/scsi/host0/bus0/target0/lun0/part1 1 21270 7816688 b Win95 FAT32
$ mount -t vfat /dev/scsi/host0/bus0/target0/lun0/part1 /mnt/cf
mount: Mounting /dev/scsi/host0/bus0/target0/lun0/part1 on /mnt/cf failed: Device or resource busy

Wim Sturkenboom 08-29-2012 10:28 AM

Not familiar with SB, but was is the output of the mount command (without arguments)?

scrabble 08-29-2012 10:32 AM

$ mount
/dev/root on / type yaffs (rw)
none on /dev type devfs (rw)
proc on /proc type proc (rw)
/dev/scsi/host0/bus0/target0/lun0/part1 on /mnt/cf type ext2 (rw)

michaelk 08-29-2012 10:32 AM

Also look at the output of the dmesg command to see if there are any other error messages.

P.S. Good call Wim Sturkenboom it or some other device is already mounted.

scrabble 08-29-2012 10:41 AM

Hey Michael,
sorry for just posting my stdout but I've completly no idea what I've to do here since I'm new to UNIX.


$ dmesg
Linux version 2.4.26-ts11 (root@construct) (gcc version 3.3.4) #22 Tue Jun 6 12:23:09 MST 2006
CPU: Arm920Tid(wb) revision 0
Machine: ep9301
On node 0 totalpages: 2048
zone(0): 2048 pages.
zone(1): 0 pages.
zone(2): 0 pages.
On node 1 totalpages: 2048
zone(0): 2048 pages.
zone(1): 0 pages.
zone(2): 0 pages.
On node 4 totalpages: 2048
zone(0): 2048 pages.
zone(1): 0 pages.
zone(2): 0 pages.
On node 5 totalpages: 2048
zone(0): 2048 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: console=ttyAM0,115200 root=/dev/mtdblock1
Relocating machine vectors to 0xffff0000
Console: colour dummy device 80x30
Calibrating delay loop... 99.94 BogoMIPS
Memory: 8MB 8MB 8MB 8MB = 32MB total
Memory: 28624KB available (1208K code, 336K data, 72K init)
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
CPU: Testing write buffer: pass
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
ttyAM0 at MMIO 0x808c0000 (irq = 52) is a AMBA
ttyAM1 at MMIO 0x808d0000 (irq = 54) is a AMBA
ttyAM2 at MMIO 0x808e0000 (irq = 55) is a AMBA
pty: 1024 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ enabled
rtc: no TS-5620 RTC detected.
ep93xx_eth() version: ep93xx_eth.c: V1.0 09/04/2003 Cirrus Logic
RAMDISK driver initialized: 16 RAM disks of 12288K size 1024 blocksize
Searching for NAND flash...
NAND device: Manufacturer ID: 0xec, Chip ID: 0x75 (Samsung NAND 32MiB 3,3V 8-bit)
Scanning device for bad blocks
Using static partition definition
Creating 3 MTD partitions on "NAND 32MiB 3,3V 8-bit":
0x00000000-0x00004000 : "TS-BOOTROM"
0x00004000-0x01d04000 : "Linux"
0x01d04000-0x02000000 : "RedBoot"
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 4096)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NetWinder Floating Point Emulator V0.97 (double precision)
VFS: Mounted root (yaffs filesystem).
Mounted devfs on /dev
Freeing init memory: 72K
sdcard0: Technologic Systems SD card controller, address 0x13000000
sdcard0: no card found
TS-UART/7260 detected a TS-7260 board
ttyTS0 at MMIO 0x12400000 (irq = 32) is a TSUART
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb-ohci.c: USB OHCI at membase 0xe0020000, IRQ 56
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 3 ports detected
SCSI subsystem driver Revision: 1.00
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
hub.c: new USB device not_pci-3, assigned address 2
scsi0 : SCSI emulation for USB Mass Storage devices
Vendor: SanDisk Model: Cruzer Blade Rev: 1.03
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 15633408 512-byte hdwr sectors (8004 MB)
sda: Write Protect is off
Partition check:
/dev/scsi/host0/bus0/target0/lun0: p1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
FAT: bogus logical sector size 0
VFS: Can't find a valid FAT filesystem on dev 08:00.

michaelk 08-29-2012 10:50 AM

No problem. So have you looked at the /mnt/cf directory to see what is there? If it came with the board I suspect it is the development system which should be debian. It is a complete OS but does contain the headers etc so you can compile programs for the SBC.

All of the documentation is on line at http://www.embeddedarm.com/products/...oduct=TS-7260#

colucix 08-29-2012 10:53 AM

Moved: This thread is more suitable in Linux - Embedded and has been moved accordingly to help your thread/question get the exposure it deserves.

scrabble 08-29-2012 11:10 AM

The /mnt/cf/ only contains one folder, where the ring buffers and current acquired data of the accelerometer are stored.
I can also look them up even though the USB hard drive is not mounted (or hooked up). I ve no clue what this drive is good for since everything seems to work without it as well.

michaelk 08-29-2012 12:12 PM

Ok, that clarifies things a bit.

Is the data acquisition software configured to write to /mnt/cf/folder? It appeases that even if the drive was not mounted the software will still write to the same destination directory and the only difference is it will be written to the on board flash memory instead of the USB drive. The flash memory isn't very big which is why you would want the USB drive. Since the flash memory is formatted as ext2 windows cat not read it without additional software.

http://www.howtoforge.com/access-lin...s-from-windows

Just out curiosity do you have any information on the accelerometer like make or model number?

scrabble 08-29-2012 01:06 PM

thanks a lot! I could figure out from the directory structure that the acquisition software is calles SEISLOG but I can't start it because the commands are not supported by the OS. Nevertheless I think it writes data automatically in the /mnt/cf/ folder and triggers itself. the thing I don t understand is, why there is a USB hooked up to the system. the folders on cf are not really big so it s possible, that theyre stored on the TS-7260:


$ du -h
7.0k ./cf/SLG/RNG/PU_SE/2012/08
7.5k ./cf/SLG/RNG/PU_SE/2012
2.5k ./cf/SLG/RNG/PU_SE/1998/01
3.0k ./cf/SLG/RNG/PU_SE/1998
11.0k ./cf/SLG/RNG/PU_SE
7.0k ./cf/SLG/RNG/PU_SN/2012/08
7.5k ./cf/SLG/RNG/PU_SN/2012
2.5k ./cf/SLG/RNG/PU_SN/1998/01
3.0k ./cf/SLG/RNG/PU_SN/1998
11.0k ./cf/SLG/RNG/PU_SN
7.0k ./cf/SLG/RNG/PU_SZ/2012/08
7.5k ./cf/SLG/RNG/PU_SZ/2012
2.5k ./cf/SLG/RNG/PU_SZ/1998/01
3.0k ./cf/SLG/RNG/PU_SZ/1998
11.0k ./cf/SLG/RNG/PU_SZ
2.3M ./cf/SLG/RNG/PUC1_SHE
2.2M ./cf/SLG/RNG/PUC1_SHN
2.3M ./cf/SLG/RNG/PUC1_SHZ
6.8M ./cf/SLG/RNG
1.0k ./cf/SLG/EVT/1998/01
1.5k ./cf/SLG/EVT/1998
10.0k ./cf/SLG/EVT/2012/08
10.5k ./cf/SLG/EVT/2012
941.5k ./cf/SLG/EVT
7.7M ./cf/SLG
7.7M ./cf
7.7M .


the data is acquired by a modified SSA-2 by Kinematrics accelerometer.

btw, I use a mac to connect to the ts-7260. how do you know, that the flash drive as ext2 windows?
for me it is really important to make a copy of the usb stick and know what is on there.


btw: the system is triggered by an external gps antenna. nevertheless ewhen I type date: it says

$ date
Thu Jan 1 02:27:49 UTC 1970


nevertheless, the data has the correct date as a name but the wrong time stamping so I guess the CPU clock is not connected with the GPS. do you know how I can syncronise them as well?

michaelk 08-29-2012 01:42 PM

From the output of the mount command.
Quote:

/dev/scsi/host0/bus0/target0/lun0/part1 on /mnt/cf type ext2 (rw)
The SBC does not have a real time clock so the system clock is set at boot up to the default time of 00:00 1 Jan 1970 (unix epoch time). You would need to write some software to read time from the GPS receiver to set the clock.

The on board flash memory is only 32MB so the OS and the data acquisition software would reside there but the logs could fill it up which would not be good which is why you want the USB drive.


All times are GMT -5. The time now is 09:13 AM.