Skip to Content.
Sympa Menu

baslinux - Re: [BL] USB devices

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: sindi keesan <keesan AT sdf.lonestar.org>
  • To: Christof Lange <cce.zizkov AT volny.cz>, baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] USB devices
  • Date: Wed, 3 Jan 2007 00:27:00 +0000 (UTC)

On Tue, 2 Jan 2007, Christof Lange wrote:

Hi list,

I have been trying to make the mounting of USB storage devices
more user-friendly and seem to need some help with scripting.

When I want to mount a floppy the device name is always
the same, i.e. /dev/fd0 . So it is easy to write a script
or an alias in order to mount and unmount the device. e.g.

alias a:='mkdir /A ; mount /dev/fd0 /A'
alias :a='umount /A ; rmdir /A'

You don't need to make and remove the /A directory every time.
We have it set up to type A, C, etc. to mount to /A and AU etc. to umount.
I don't think aliases work in an xterm but scripts do.

With USB storages devices it is a bit more complicated. When I
exchange them they show up at different addresses. When I tested
Sindi's and David's 2.4.31 kernels I realized that the first
deviced plugged in turns up at /dev/sda1 , the second one at
/dev/sdb1 , the third one at /dev/sdc1 and the fourth at /dev/sdd1 .
After that the next device can be mounted from /dev/sda1 again.

I would like to write a script that uses one or more mount points,
but will be able to mount a new device with only one command, eg.
u: (and :u for unmounting). The script, however, must be able to
check where a device is. When I open the 'file' /dev/sda1 in
Midnight commander I get an error message if the device does not
exist and some contents if it exists. How can I check the contents
of these device files automatically? I tried:

When you boot with the USB-storage kernel or insert the module, it will tell you (probably on the last line) which /dev/ it found. Can you use grep to search dmesg? Or just watch while booting?

cat /dev/sda1 |head -n1|cut -b10 >/dev/null && echo sda1 exists

but this produced a lot of unwanted screen output (error messages
obviously do not come from 'cat') and did not produce the
wanted errorlevel for && in the script.

Which Linux command could I use instead of cat?

Christof




is there

________________________________________________________________

Ceskobratrska cirkev evangelicka - Betlemska kaple na Zizkove
Prokopova 4/216, 130 00 Praha 3, Czech Republic
Tel. (+420) 222 78 06 73 / 222 78 20 02 / 603 18 87 53
http://www.volny.cz/cce.zizkov


-----------------------
BasicLinux mailing list
-----------------------
http://www.basiclinux.com.ru
http://www.ibiblio.org/pub/linux/distributions/baslinux/
------------------------------------
To exit, send subject=unsubscribe to
baslinux-request AT lists.ibiblio.org


keesan AT sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org




Archive powered by MHonArc 2.6.24.

Top of Page