Here is a bash script and additional commands to allow one to install a Zip (Plus) drive. Be sure to be 'root' for this activity.
The script zip.sh resides in /mnt. Be sure to have a directory /mnt/zip (Or whatever you choose your mountpoint to be.
# mkdir /mnt/zip
Here is the script zip.sh
#!/bin/bash /sbin/modprobe imm mount /dev/sda4 /mnt/zip
Be sure to have previously created the directory /zip in /mnt.
If modprobe immfails, replace “imm” with “ppa”
Back at the command line, for the first time after writing the script, issue the following:
# chmod 774 zip.sh
To mount the Zip-disk, simply call the script
# /mnt/zip.sh
Remember to unmount the Zip drive before taking out the disk.
# umount /mnt/zip
Also, do an “exit” (at the bash prompt) to do your work out of being root. Also, don't confuse the use of # within the script as a comment and otherwise as root's prompt.
With the steps above, only root could mount and unmount zip-disks. With the following steps, you can allow users to these tasks, too.
/dev/sda4 /mnt/zip auto noauto,user,noexec 0 0
/dev/sda. So now I mount the zip right at boot and prevent that problem. I am running a daily backup on the zip which umounts at the end; so that leaves the drive unmounted after that morning cron job runs. Here is what I have in /etc/fstab for both drives:/dev/sda4 /zip vfat users,exec,suid,dev,rw,auto 0 0 /dev/sdb1 /jump vfat users,exec,suid,dev,rw,noauto 0 0/sbin/modprobe ppa
If the line is in /etc/fstab and you have the module loading in rc.local or whatever file your system uses at boot time to load special modules not included in the normal init scripts, then you can mount the drive with 'mount /mnt/zip' or in my case 'mount /zip'.
If I were going to make a script like this for my user, I would put it in /home/username/bin. If it is to be used by all to include root, then I'd put it in /usr/local/bin. I would change the mount to include 'users' but it is really cleaner to put this in /etc/fstab.
I would say that the methodology that has been created here is probably very similar to what people originally had to do. As time has gone by, files have been set up to take on this job so that you don't have to make your own scripts and remember all their names. Very good detective work and creativity here. In fact, I had a similar script years ago which I called 'zip' and which ran 'insmod' for each module needed rather than the much easier 'modprobe' - why - well, I didn't know about modprobe at the time.
Anita
Comment: Mounting Zip Drives at Bootup Posted by hrosen 2004-08-27
Finally I got around to making the changes Anita suggested. Running Red Hat Linux version 7.1. I added a line at the very end of the file /etc/rc.d/rc.local as such: modprobe imm and modified fstab as suggested. During boot the fstab failed, but then I only had to click on the Zip drive icon to mount it, as a regular user. I was easily able to read the zip drive contents. Very nice.
$ umount /mnt/zip
then ejected the disk, replaced with another disk
$ mount /mnt/zip $ ls /mnt/zip
read the contents of the replacement zip. That was truly great and I am appreciative.
Howard
Created by Howard Rosen, Stefan Waidele