You are not logged in.

#1 2006-11-15 03:28:48

spookshow
Member
From: abbotsford, bc
Registered: 2006-11-15
Posts: 95
Website

yet another usb key problem [solved]

i recently purchased 2 apacer 2GB usb flash drives so i could transfer my files between computers with ease and speed. i have the computer, using udev rules, recognizing the drives as i put them in, and automounting them to a /mnt directory.

couple questions about it though
1. the drives are read only, and cannot be changed from (using chmod or chown) root

drwxr-xr-x  4 root      root 16384 Nov 14 11:18 usb1

how can i fix this?

[root@creech ~]# ls -l /mnt
drwxr-xr-x  4 root      root 16384 Nov 14 11:18 usb1
[root@creech ~]# chown spookshow /mnt/usb1
chown: changing ownership of `/mnt/usb1': Operation not permitted
[root@creech ~]# chmod 777 /mnt/usb1
[root@creech ~]# ls -l /mnt
drwxr-xr-x  4 root      root 16384 Nov 14 11:18 usb1
[root@creech ~]# 

is this possibly because it is fat16? and if so, what format should i use to make it readable across windows and linux machines?

fdisk -l
xxxx
Disk /dev/sdi: 2063 MB, 2063597568 bytes
16 heads, 32 sectors/track, 7872 cylinders
Units = cylinders of 512 * 512 = 262144 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdi1   *           1        7872     2015216    e  W95 FAT16 (LBA)

2. i want to create links on the desktop automatically so that i could  easily access the drives when i plug them in, how can i do this?

udev rules file i created below (and by created i mean stole from the wiki)

KERNEL=="sd[h-z]", NAME="%k", SYMLINK+="usb%m", GROUP="users", OPTIONS="last_rule"
ACTION=="add", KERNEL=="sd[h-z][0-9]", SYMLINK+="usb%n", GROUP="users", NAME="%k"
ACTION=="add", KERNEL=="sd[h-z][0-9]", RUN+="/bin/mkdir -p /mnt/usb%n"
ACTION=="add", KERNEL=="sd[h-z][0-9]", PROGRAM=="/lib/udev/vol_id -t %N", RESULT=="vfat", RUN+="/bin/mount -t vfat -o
rw,noauto,sync,dirsync,noexec,nodev,noatime,dmask=000,fmask=111 /dev/%k /mnt/usb%n", OPTIONS="last_rule"
ACTION=="add", KERNEL=="sd[h-z][0-9]", RUN+="/bin/mount -t auto -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/%k /mnt/usb%n", OPTIONS="last_rule"
ACTION=="remove", KERNEL=="sd[h-z][0-9]", RUN+="/bin/umount -l /mnt/usb%n"
ACTION=="remove", KERNEL=="sd[h-z][0-9]", RUN+="/bin/rmdir /mnt/usb%n", OPTIONS="last_rule"

thanks in advance


solution = hal + dbus (actually running) + gnome-volume-manager + small script

Offline

#2 2006-11-15 07:48:14

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,911
Website

Re: yet another usb key problem [solved]

Are drives wirte locked ? some have a small switch on then to protect against overwriting

What Window Manager are you using?


Mr Green

Offline

#3 2006-11-15 09:54:11

kasa
Member
From: Italy
Registered: 2005-07-21
Posts: 48

Re: yet another usb key problem [solved]

From man mount

       uid=value and gid=value
              Set the owner and group of all files.  (Default: the  uid  and
              gid of the current process.)

try these on your mount options

as Mr Green said, what wm are you using?

Offline

#4 2006-11-15 13:07:18

spookshow
Member
From: abbotsford, bc
Registered: 2006-11-15
Posts: 95
Website

Re: yet another usb key problem [solved]

i'm using gnome, 2.16.1

they have no write protection on the drives themselves


kasa - that seemed to work to get me ownership. thanks, sometime i just overlooked a bunch of times, i had that issue with my external drive previously

now if only the links showed up on my desktop or somewhere i could quickly access them

you guys are a great help so far, thanks!

Offline

#5 2006-11-15 14:34:23

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,911
Website

Re: yet another usb key problem [solved]

Do not know much about Gnome so it could be hal dbus volume manager thing ...


Mr Green

Offline

#6 2006-11-15 17:51:44

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: yet another usb key problem [solved]

I have geil 2GB transfer rate 26MB/s
assuming that you are running KDE or Gnome there is no need to modify /mnt or create any extra folders. KDE and Gnome will handle removable devices automatically

conditions:
1) running dbus/hal
2) slight changes to /etc/fstab
usbfs                  /proc/bus/usb usbfs     noauto              0      0
proc                   /proc         proc      defaults            0      0
sysfs                  /sys          sysfs     noauto              0      0

upon inserting usb key system will  automatically mount it in
/media/sdbX
where X is connected device number (if you connect more than one at a time)

in case that you close window, go to system -> storage media -> your_usb_stick
3) user added to storage group
if you are using xfce or less then get ivman it is easy to configure and works very well.


hope this will help

Offline

#7 2006-11-16 10:08:52

kasa
Member
From: Italy
Registered: 2005-07-21
Posts: 48

Re: yet another usb key problem [solved]

If you use gnome, you should definitely try gnome-volume-manager, just be sure you have HAL and DBUS running, and gnome-volume-manager enabled in your gnome session. Also, if you want to try it, backup udev rules you created and disable them: I'm not sure, but they could conflict with HAL ones.

Hope this helps

Offline

#8 2006-11-16 13:38:35

spookshow
Member
From: abbotsford, bc
Registered: 2006-11-15
Posts: 95
Website

Re: yet another usb key problem [solved]

broch wrote:

I have geil 2GB transfer rate 26MB/s
assuming that you are running KDE or Gnome there is no need to modify /mnt or create any extra folders. KDE and Gnome will handle removable devices automatically

conditions:
1) running dbus/hal
2) slight changes to /etc/fstab
usbfs                  /proc/bus/usb usbfs     noauto              0      0
proc                   /proc         proc      defaults            0      0
sysfs                  /sys          sysfs     noauto              0      0

upon inserting usb key system will  automatically mount it in
/media/sdbX
where X is connected device number (if you connect more than one at a time)

in case that you close window, go to system -> storage media -> your_usb_stick
3) user added to storage group
if you are using xfce or less then get ivman it is easy to configure and works very well.


hope this will help


thanks, i will try it tonight, i had no power at my house last night due to a windstorm, hopefully this will work (i would ssh to my computer from here and set it up, but i guess i forgot to turn on ssh at home sad )

Offline

#9 2006-11-17 13:51:47

spookshow
Member
From: abbotsford, bc
Registered: 2006-11-15
Posts: 95
Website

Re: yet another usb key problem [solved]

just want to say thanks for the help, i thought i had hal running, but forgot to add it to my daemons list. the problem is corrected now, but something else has been borked, kindof.
it auto mounts my actual storage drives now and puts them on my desktop, where i had links set up previously.. and i have them named (see screenshot in screenshot thread)

i have used the info from http://wiki.archlinux.org/index.php/HAL and it still automounts them. any help?
i only got to play with it for a few minutes last night and i will be going back to it tonight hopefully, but for now i am just looking for a toss in the right direction, i have inventory at work this weekend, and the wii campout/launch, so i won't be around a lot for trial and error. wink


nevermind, problem solved. thanks/. the wiki on hal did the trick, just took more than a restart of hal, i needed to restart x as well

Offline

Board footer

Powered by FluxBB