Writing a script to mount and umount a drive in Linux


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Writing a script to mount and umount a drive in Linux
Prev   Next
# 1  
Old 05-10-2001
Question

I have a 1 GB jazz drive. The jazz disk is used daily, both at home and at work on my Win 98 Server. So, I have to keep it in vfat format, which is fine because Linux rocks and will read it no problem. :-) However, I can't just stick the disk in the drive and open up the jazz folder in my mnt directory. I have to "mount" the drive using this command, mount -t vfat /dev/sda4 /mnt/jazz No big deal, and I even wrote a small script file to run that command. Only one problem, you have to login in as root on the command line for Linux to "mount" or "umount" a drive. I am lazy and want to click the icon and have it login in as the root for me. Now, some might say that is a security risk since my password will be stored in the file, but I don't care because this computer is at home and I just don't care. I don't have any friends that run Linux so they are not going to have a clue anyway. :-)

Then, I would want to "umount" the drive with another icon. :-) Make sense?

So, how do you write a login script?


Thanks
Eric
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Test cases for file system mount/umount performance in HP

Hi Folks, Could anyone please assist me with the what could be the scenarios to test the file system mount/umount performance check in HPUX. Thanks in advance, Vaishey (5 Replies)
Discussion started by: Vaishey
5 Replies

2. Fedora

What is the right way to mount and umount a usb driver?

I have some questions: 1, I successfully mounted my usb drive with "sudo mount /dev/sdb1 /mnt", but I can't wirte, It says "read-only file system". But I can write it in windows. 2, After I umounted the usb drive the led of it still on, but not blinking. Is it safe to unplug it? How to let it's... (17 Replies)
Discussion started by: vistastar
17 Replies

3. UNIX for Dummies Questions & Answers

Simple way to umount NFS mount in linux

Hello... I've mounted a share using standard nomenclature for the NFS mount command with the following command line: mount -t nfs -o rw {IP address1}:/ /mnt_for_70 / {IP address2}(rw) mnt_for_70 is a mount point I created on {IP address2} I'm confuse and want to be sure I use the... (1 Reply)
Discussion started by: blaine.miller
1 Replies

4. Cybersecurity

Remove need for sudo for mount/umount

Hello, I'm trying to remove the need to use sudo to mount (in particular, binding). Modifying /etc/sudoers using visudo, I have tried: %admin ALL=NOPASSWD: /usr/bin/mount %admin ALL=NOPASSWD: /usr/bin/umountand %admin ALL=(ALL) NOPASSWD: /usr/bin/mount %admin ALL=(ALL) NOPASSWD:... (5 Replies)
Discussion started by: Narnie
5 Replies

5. Solaris

mount & umount in sigle-user mode

In Solaris 8, when I boot to single user mode, mount a device and then reboot or init 0, the system unmount it automatically. However, in Solaris 10 it does not seem to do the same. Here is what I did: {0} ok boot -s # format Searching for disks...done AVAILABLE DISK SELECTIONS: 0.... (11 Replies)
Discussion started by: StarSol
11 Replies

6. Shell Programming and Scripting

Linux: Writing a tricky script to check connectivity

So, first and foremost, I'm having issues with my internet connection. Periodically, the connection drops across the network. The fix is simple enough: restart the modem. However, this gets old when the connection dies out every hour. I can hit my surfboard on 192.168.100.1, and navigate to a... (5 Replies)
Discussion started by: kungfujoe
5 Replies

7. Linux

How to mount/umount disk from a non-root account

Is it possible to mount a disk from a non-root account? I'm developing a Java application which executes commands in the shell using the java.lang.Runtime.exec api, which runs fine for commands ls, df, etc., but for commands mount and umount, i have problems as I need to be root to eecute these.... (8 Replies)
Discussion started by: brendan76
8 Replies

8. Filesystems, Disks and Memory

writing to a cdr drive.

ive looked around for software to do this in linux, but am still not sure how to. i want to be able to mount a cdr and write to it and be able to take the disk out and finish writing whatever i want to it at a later time. can we do this in linux? (4 Replies)
Discussion started by: norsk hedensk
4 Replies

9. UNIX for Dummies Questions & Answers

solaris 8 admin I text ambiguities on mount and umount

i'm prepping for my midterm, which i will bomb. i am scurrying to finish reading the final chapter before i get down into the review. however, i came across something in chapter 8 - "mounting file systems" that has me really confused. the text says the following: then it goes on to... (2 Replies)
Discussion started by: xyyz
2 Replies

10. UNIX for Dummies Questions & Answers

how to mount a hotswap scsi drive on a solaris 2.6 netra box using the mount command?

Hi... question is this: How do I mount an LVD hotswap scsi drive in bay #2 on a netra using the mount command? volmgt doesn't seem to mount it and/or I don't know how to view the drives data if it's formatted which it may not be. This drive is not new out of the box so I'm not sure. ... (4 Replies)
Discussion started by: soulshaker
4 Replies
Login or Register to Ask a Question
JAZIP(1)						      General Commands Manual							  JAZIP(1)

NAME
jazip - X tool to easily mount and unmount Iomega Zip and/or Jaz drives. SYNOPSIS
jazip [SCSI device] [-display host:dpy] [-visual visual] [-depth depth] [-private] DESCRIPTION
jazip is a program for maintaing your Iomega Zip and/or Jaz drive(s) and disks under Linux. This program combines Grant Guenther's original command line utility, ziptool, with Jaz drive support, a nice X interface and additional utilities to allow users to easily mount and unmount disks. The interface is based on version 0.88 of the XForms library. OPTIONS
The optional SCSI device command line parameter specifies the raw scsi device name of one of the drives with an entry in /etc/jazip.conf. If no SCSI device is specified on the command line, jazip will use the first entry of /etc/jazip.conf by default. This allows you to add a different line in the configuration file for each drive you own, and then invoke jazip with the name of the device for the drive you want jazip to use. Note that the SCSI device argument does not contain a partition number. jazip auto-detects partitions and mounts the first one it encoun- ters. jazip is built with the XForms Graphical User Interface Toolkit for X, and hence supports a number of flags which are interpreted by XForms: -display host:dpy defines the X display. -visual class TrueColor, PseudoColor etc... -depth d visual depth in bits -private forces a private colormap. -shared forces a shared colormap. -stdcmap forces a standard colormap. FEATURES
Mounting/Unmounting of Disks: The program allows non-root users to securely mount/unmount disks. Disks are mounted with the nosuid flag to increase security. The type of disk should be detected automagically by reading its partition table. Only the first disk partition encountered will be mounted by jaZip. Write Protection/De-Write Protection: The program allows non-root users to control the disk's software write protection feature. Password protection is not currently supported. Ejection of Media: Any questions? Disk Information: Keeps you informed about the current disk's protection and mount status. Other information: Once the program is running, see the online help (under the help menu) for further information and instructions. USER ACCESS TO JAZIP
On Debian systems, jazip is installed suid to root, and sgid to floppy. Access to jazip is limited to users in the floppy group. To add user joe to group floppy , run the following command as root # adduser joe floppy What about non-Debian systems? You may change permission and group ownership of the jazip executable like so: # chown root:floppy /usr/bin/jazip # chmod 4754 /usr/bin/jazip to yield # ls -l /usr/bin/jazip -rwsr-xr-- 1 root jazip 147340 May 18 15:04 /usr/bin/jazip OWNERSHIP AND PERMISSIONS OF MOUNT POINTS
This is what is suggested # chmod 1771 /zip to yield drwxrwx--t 3 root floppy 1024 May 21 10:58 /zip Only members of the floppy group can read it, all floppy group members can write to it at any time, but can't overwrite other user's files. This only matters for ext2 formatted disks because jazip's mount changes ownwership of the mount for vfat formatted disks: whoever uses jazip to mount the disk owns the files. No other user can write to the disk. KNOWN LIMITATIONS
Starting the program: There needs to be a disk in the drive in order to start the program. If you start jazip from a window manager menu without a disk in the drive, it will fail silently because you will never see the text error message. Partitioning your disks: Since Zip and Jaz are removable media technologies, it is assumed that each disk will contain just one partition. This is less likely to be desireable if you are a Jaz user with 1G or 2G disks. In order to easily support autodetection of disk types, I don't see a way around this restriction. Unmounting disks to access some features: Currently, to use the lock and unlock features, the disk must be unmounted. CONFIGURATION FILE
jazip uses the file /etc/jazip.conf to map the raw SCSI device name of the drive you wish to use onto its mount point. If you have more than one drive on your system, you can create a separate entry in the configuration file for each one, and then specify the raw device name of the drive you want to use on the command line when you invoke jazip. If no device name is given on the command line, jazip will use the settings in the first entry of /etc/jazip.conf by default. The format of the jazip.conf file should be mostly self-explanatory. The first entry of the configuration file is the raw SCSI device name of your drive (e.g. /dev/sda). The second entry is the mount point you wish to use (e.g. /zip). The additional entries are required, but are not user-changeable. See the jazipconfig(8) man page for specifics. See the jazipconfig command to create the /etc/jazip.conf config- uration file. SEE ALSO
jazip.conf(5), jazipconfig(8) AUTHOR
jazip Copyright (c) 1996 Jarrod A. Smith This manual page by Peter S Galbraith <psg@debian.org> for the Debian GNU/Linux system (but may be used by others). JAZIP(1)