Sponsored Content
Operating Systems Linux How to mount/umount disk from a non-root account Post 302173313 by sysgate on Thursday 6th of March 2008 09:17:53 AM
Old 03-06-2008
No way to workaround that - such commands are explicitely obligation of root account with a reason. You can use "sudo" for example to call :

Code:
import java.io.*;

public class RunCommand {

    public static void main(String args[]) {

        String s = null;

        try {
            
	    // run the Unix "ps -ef" command
            
            Process p = Runtime.getRuntime().exec("ps -ef");
            
            BufferedReader stdInput = new BufferedReader(new 
                 InputStreamReader(p.getInputStream()));

            BufferedReader stdError = new BufferedReader(new 
                 InputStreamReader(p.getErrorStream()));

            // read the output from the command
            
            System.out.println("Here is the standard output of the command:\n");
            while ((s = stdInput.readLine()) != null) {
                System.out.println(s);

replace "ps -ef" with "sudo mount $parameters"
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Writing a script to mount and umount a drive in Linux

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... (2 Replies)
Discussion started by: wizkid
2 Replies

2. 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

3. UNIX for Dummies Questions & Answers

How do i access (mount, read & write) a floppy disk from the console, not being root?

welll, the title quite explains what i want to do thanks for your time! (4 Replies)
Discussion started by: kfaday
4 Replies

4. UNIX for Dummies Questions & Answers

How to mount disk for non-root accounts?

Presently I have mounted a disk as su. I believe only root can mount disks -- is this correct? I had to run mozilla in the root account so I can download the new SuSE distribution to the new disk. How can I mount the disk so non-root accounts can access the disk? Thanks, Siegfried (4 Replies)
Discussion started by: siegfried
4 Replies

5. UNIX for Dummies Questions & Answers

How to mount disk for non-root accounts?

I have a USB disk on a little NAS controller (NSLU2 running unslung 6.8) that I can access nicely with root with mount -t cifs \\\\10.134.23.23\\DISK\ 2 /mnt/LKGD7F73A However, when I run emacs from an user mode xterm prompt, emacs cannot read and write the files on /mnt/LKGD7F73A. Emacs can... (11 Replies)
Discussion started by: siegfried
11 Replies

6. 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

7. 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

8. 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

9. 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

10. 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
EVENTHTTPREQUEST(3)							 1						       EVENTHTTPREQUEST(3)

The EventHttpRequest class

INTRODUCTION
Represents an HTTP request. CLASS SYNOPSIS
EventHttpRequest EventHttpRequest Constants o const integer$EventHttpRequest::CMD_GET1 o const integer$EventHttpRequest::CMD_POST2 o const integer$EventHttpRequest::CMD_HEAD4 o const integer$EventHttpRequest::CMD_PUT8 o const integer$EventHttpRequest::CMD_DELETE16 o const integer$EventHttpRequest::CMD_OPTIONS32 o const integer$EventHttpRequest::CMD_TRACE64 o const integer$EventHttpRequest::CMD_CONNECT128 o const integer$EventHttpRequest::CMD_PATCH256 o const integer$EventHttpRequest::INPUT_HEADER1 o const integer$EventHttpRequest::OUTPUT_HEADER2 Methods o public bool EventHttpRequest::addHeader (string $key, string $value, int $type) o public void EventHttpRequest::cancel (void ) o public void EventHttpRequest::clearHeaders (void ) o public void EventHttpRequest::closeConnection (void ) o public EventHttpRequest::__construct NULL (callable $callback, [mixed $data]) o public void EventHttpRequest::findHeader (string $key, string $type) o public void EventHttpRequest::free (void ) o public EventBufferEvent EventHttpRequest::closeConnection (void ) o public void EventHttpRequest::getCommand (void ) o public EventHttpConnection EventHttpRequest::closeConnection (void ) o public string EventHttpRequest::getHost (void ) o public EventBuffer EventHttpRequest::getInputBuffer (void ) o public array EventHttpRequest::getInputHeaders (void ) o public EventBuffer EventHttpRequest::getOutputBuffer (void ) o public void EventHttpRequest::getOutputHeaders (void ) o public int EventHttpRequest::getResponseCode (void ) o public string EventHttpRequest::getUri (void ) o public void EventHttpRequest::removeHeader (string $key, string $type) o public void EventHttpRequest::sendError NULL (int $error, [string $reason]) o public void EventHttpRequest::sendReply (int $code, string $reason, [EventBuffer $buf]) o public void EventHttpRequest::sendReplyChunk (EventBuffer $buf) o public void EventHttpRequest::sendReplyEnd (void ) o public void EventHttpRequest::sendReplyStart (int $code, string $reason) PREDEFINED CONSTANTS
o EventHttpRequest::CMD_GET - GET method(command) o EventHttpRequest::CMD_POST - POST method(command) o EventHttpRequest::CMD_HEAD - HEAD method(command) o EventHttpRequest::CMD_PUT - PUT method(command) o EventHttpRequest::CMD_DELETE - DELETE command(method) o EventHttpRequest::CMD_OPTIONS - OPTIONS method(command) o EventHttpRequest::CMD_TRACE - TRACE method(command) o EventHttpRequest::CMD_CONNECT - CONNECT method(command) o EventHttpRequest::CMD_PATCH - PATCH method(command) o EventHttpRequest::INPUT_HEADER - Request input header type. o EventHttpRequest::OUTPUT_HEADER - Request output header type. PHP Documentation Group EVENTHTTPREQUEST(3)
All times are GMT -4. The time now is 09:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy