Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 31 Jul 2014, 08:00
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Auto-Drive ... Mounts ALL removable media.
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 12 [167 Posts]   Goto page: 1, 2, 3, ..., 10, 11, 12 Next
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5010
Location: Arizona, U.S.A.

PostPosted: Sat 22 Aug 2009, 21:17    Post subject:  Auto-Drive ... Mounts ALL removable media.  

I wrote the original utility about 4 years ago, it doesn`t work now.
The new Auto-Drive auto. mounts and unmounts all removable devices.
All devices and media that are detected in the file: /proc/partitions
It averages about a 7 second delay from plug in until ROX pops up.

The tar gzip file is NOT an install file !!!
Start rxvt in the dir. where the auto-drive file is and type this:
Code:
tar -xzf auto-drive_b(version).tar.gz -C /usr/sbin

To start it, in rxvt type the command line: auto-drive
To start it at boot, add the line "auto-drive" to the file: /etc/rc.d/rc.local

### Beta 1
1 Popup message box if mount or unmount fails.
2) Adds the drive to ROX and GTK menus.
3) Start, mount, and unmount events set Firefox`s Download path.
4) Command line argument: -rox = Start ROX Filer with drive`s path.
5) All removable devices are mounted and unmounted now!!!
..... Should work with: SD cards, USB, Firewire, SATA & SCSI hot swaps!

### Beta 2 ... Bug fixes and a few improvements.

### Beta 3 ... More bug fixes. Final soon...

NOTES: I have no SATA, SCSI, or FireWire drives to test it with.
To refresh external media card readers, unplug and replug them.

Comments and bug reports are welcome... Thanks!
auto-drive_b3.tar.gz
Description  To install open a rxvt in the dir that auto-drive_b(version).tar.gz is in,
and type into rxvt: tar -xzf auto-drive_b(version).tar.gz -C /usr/sbin
gz

 Download 
Filename  auto-drive_b3.tar.gz 
Filesize  2.24 KB 
Downloaded  585 Time(s) 

Last edited by sunburnt on Tue 13 Oct 2009, 22:57; edited 27 times in total
Back to top
View user's profile Send private message 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: Sun 23 Aug 2009, 07:19    Post subject:  

ahhh...."Just works", the most often requested feature of a computer Very Happy

I havnt had tested yet, beforehand I was wondering if it were possible to add a feature to the script whereby it adds bookmarks to rox and gtk for the newly mounted storage devices, and removes them when they are detached again?

The bookmarks are stored in text files here

/root/.config/rox.sourceforge.net/ROX-Filer/Bookmarks.xml
/root/.gtkbookmarks.xml

This would add a lot of usability to puppy, as ive noticed new users find it very hard to find their files if they are not used to the /mnt/location setup of the linux filesystem.

_________________
Puppy Linux's Mission

Sorry, my server is down atm!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
sunburnt


Joined: 08 Jun 2005
Posts: 5010
Location: Arizona, U.S.A.

PostPosted: Sun 23 Aug 2009, 17:36    Post subject:  

### New Beta 2 version.

The old one did not do several USBs at the same time, Fixed I think...

I noticed it has trouble unmounting the USB if Rox is left in the USB dir.
You must change Rox`s path out of the USB drive`s path or close Rox.
Rox use to close when it`s path was no longer valid, WHAT HAPPENED?

### Development help requested...

I don`t have any USB drives with more than 1 partition on it.
If someone has one, could they test usb-auto to see if it mounts all the partitions
I looked at the old code and the new code may have errors in it for this.
.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8041

PostPosted: Sun 23 Aug 2009, 20:01    Post subject:  

Should there be more than one file...seems to be looking for usb-auto_mount and umount. How does one unmount? Only detected one partition.

The good news is.......

mike
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5010
Location: Arizona, U.S.A.

PostPosted: Mon 24 Aug 2009, 00:27    Post subject:  

Hi mikeb; Could you do this for me?

1) First plug in your multi. partition USB.
2) Then open a Rox file window, go to: /sys/block
___ There should be a dir. for your USB, like: /sys/block/sda
3) Go into that dir. and see if there`s dirs. for the partitions, like;
___ /sys/block/sda/sda1
___ /sys/block/sda/sda3

I don`t know what numbers will be used, but HDs use 1,3,4,5...
I already know that there is a dir.: /sys/block/sda/sda1
If the other dirs. exist, and they should, I`ll use them for usb-auto.

Note: The errors for the missing file are tests for ecomoneys wish list.
Thanks for your help... Terry
Back to top
View user's profile Send private message 
rhadon


Joined: 27 Mar 2008
Posts: 1291
Location: Germany

PostPosted: Mon 24 Aug 2009, 04:43    Post subject:  

Hi sunburnt,

I don't need auto-mount but I'm curious, so I've tested it (with uPup and Puppy 4.3beta).

Configuration:
EeePc 900
sda1-3 and sdb1 build-in memory chips
sdc1-3 internal card reader with 16GB-card
sdd1-5 USB-stick 16GB

auto-mount finds only each first partition. Exception: booting from sdc3, sdc1 will not be mounbted.

In /sys/block/(e.g.)sdd/ there are the folders sdd1-5.
The same with sda, sdb and so on.

I think, auto-mount_b2 must be renamed to usb-auto_mount or symlinked.

If I pull out the stick (sdd) I get the same problem as mikeb:
Quote:
UnMount sdd1
ls: cannot access /usr/sbin/usb-auto_umount: No such file or directory

If I push the stick in again, first partition will be mounted again.

OK, I just read that this is for testing purposes. Embarassed

Hope, this helps

Rolf

_________________
Ich verwende "frugal", und das ist gut so. Wink
Raspberry Pi without Puppy? No, thanks.
Back to top
View user's profile Send private message 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: Mon 24 Aug 2009, 05:55    Post subject:  

Cheers for all the help with this, I left my pendrive at work Embarassed so I cant help test until I go in again tommorow.
_________________
Puppy Linux's Mission

Sorry, my server is down atm!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
mikeb


Joined: 23 Nov 2006
Posts: 8041

PostPosted: Mon 24 Aug 2009, 09:40    Post subject:  

when plugged in...
Code:
/sys/block/sda/sda1
/sys/block/sda/sda2


I did notice generally sometimes a drive was mounted as sdax and sometimes sdbx.

probepart and mut probepart both give the correct result.

mike
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5010
Location: Arizona, U.S.A.

PostPosted: Mon 24 Aug 2009, 11:51    Post subject:  

Thanks mikeb, that`s just what I suspected...
I`d use probepart, but I want usb-auto to be portable to other Linuxes.

Thanks rhadon; It`s good to see media card readers work.
The problem I had with them last time is that it`s the reader that`s recognized.
So swapping cards while the reader`s plugged in does nothing.
The reader has to be unplugged and plugged in again to work ( sad ).
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5010
Location: Arizona, U.S.A.

PostPosted: Mon 24 Aug 2009, 19:04    Post subject:  

### Completely reworked new version... Beta 3

I changed the entire app. setup, unfortunately it`s still slow, about 7 seconds to mount a USB.
At least the report errors in the console are gone.
Works good for first partition of several USBs.

### Need someone to test it on a USB with several partitions on it.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8041

PostPosted: Mon 24 Aug 2009, 19:18    Post subject:  

Code:

###################  Starting: USB-Auto
Mount sda1
Mount sda2
mount: Mounting /dev/sda2 on /mnt/sda2 failed: Invalid argument

partition 2 is ext2

mike
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5010
Location: Arizona, U.S.A.

PostPosted: Mon 24 Aug 2009, 23:50    Post subject:  

Het mikeb; The drive being ext2 or ext3 doesn`t matter, I have both vfat and ext2 drives.

Your report is most worry some, the code does what it`s supposed to.
For some unknown reason the mount command failed, very bad.
The mount command works for the first partition, why not the second?
You can see I used the "sync option" so the writes to the usb are instant.
Here is the command line:
Code:
mount -o sync /dev/$PART /mnt/$PART

mikeb... Can you try mounting partition #2 with this command:
Code:
mount -o sync /dev/sda2 /mnt/sda2

### NOTE: I made a "probepart" version using Barry`s utility.
I hoped it might speed usb-auto up a bit, but sadly it ran even slower.
Back to top
View user's profile Send private message 
rhadon


Joined: 27 Mar 2008
Posts: 1291
Location: Germany

PostPosted: Tue 25 Aug 2009, 04:28    Post subject:  

Hi,
I also tried auto-mount_b3, same config like before plus 1 USB-HD (sde1-8 )
There seems to be no try to mount more than the first partition:
Quote:
# usb-auto_mount
################### Starting: USB-Auto
Mount sda1
################### Starting: USB-Auto
Mount sdb1
################### Starting: USB-Auto
Mount sdd1
################### Starting: USB-Auto
Mount sde1
################### Starting: USB-Auto
Puling out USB-stick and put it in again:
Quote:
UnMount sdd1
Mount sdd1
################### Starting: USB-Auto
Pulling out USB-HD and put it in again:
Quote:
Mount sdf1
################### Starting: USB-Auto
It seems to be not unmounted and got a new name.

Trying to mount some partitions with the command e.g. sda3:
Quote:
mount -o sync /dev/sda3 /mnt/sda3
I get the message
Quote:
# mount -o sync /dev/sda3 /mnt/sda3
mount: mount point /mnt/sda3 does not exist
only swap-partitions are recognised correct (of course coldn't be mounted):
Quote:
# mount -o sync /dev/sdd2 /mnt/sdd2
/dev/sdd2 looks like swapspace - not mounted
mount: you must specify the filesystem type
#

With auto-mount_b2 I could stop the process with ctrl+c. This doesn't work anymore.

I just run Pprocess 1.0 Process manager and find the processes attached below.
Isn't it too much?
I'm not familiar with this stuff, so sorry if I'm wrong.

I hope, this is a little bit helpful

Rolf
process-auto-mount01.jpg
 Description   
 Filesize   45.88 KB
 Viewed   2458 Time(s)

process-auto-mount01.jpg


_________________
Ich verwende "frugal", und das ist gut so. Wink
Raspberry Pi without Puppy? No, thanks.

Last edited by rhadon on Tue 25 Aug 2009, 06:51; edited 3 times in total
Back to top
View user's profile Send private message 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: Tue 25 Aug 2009, 06:28    Post subject:  

Just a note, Ive yet to see a pendrive formatted with multiple partitions. Does this code work reliably with a single partition?
_________________
Puppy Linux's Mission

Sorry, my server is down atm!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
mikeb


Joined: 23 Nov 2006
Posts: 8041

PostPosted: Tue 25 Aug 2009, 07:32    Post subject:  

Quote:
### NOTE: I made a "probepart" version using Barry`s utility.
I hoped it might speed usb-auto up a bit, but sadly it ran even slower.

nope probepart in 4 (a script) is much slower than in puppy 2( a binary). mut probepart on the other hand is very efficient..i used that for my autorefreshing pmount for low cpu and fast refresh.

Quote:
Just a note, I've yet to see a pendrive formatted with multiple partitions. Does this code work reliably with a single partition?

perhaps I'm the only one..booting windows on the first and puppy on the second...I probably have the last lead solder in the world. Thing is, would use of this include usb hard drives which are quite often partitioned.

mike

edit...large drive split up to keep use of fat16 perhaps
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 12 [167 Posts]   Goto page: 1, 2, 3, ..., 10, 11, 12 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0982s ][ Queries: 12 (0.0137s) ][ GZIP on ]