unmounting /media/usbdisk from the command line?

2006-10-26 Thread Stefan Monnier

When a USB disk is mounted by gnome-volume-manager, I can unmount it using
nautilus (via right clicking on the disk's icon), but I haven't figured how
to do it from the command line.  Any hint?


Stefan


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: unmounting /media/usbdisk from the command line?

2006-10-26 Thread Sven Arvidsson
On Thu, 2006-10-26 at 12:04 -0400, Stefan Monnier wrote:
 When a USB disk is mounted by gnome-volume-manager, I can unmount it using
 nautilus (via right clicking on the disk's icon), but I haven't figured how
 to do it from the command line.  Any hint?

I think you have to use pumount.

-- 
Cheers,
Sven Arvidsson
http://www.whiz.se
PGP Key ID 760BDD22



signature.asc
Description: This is a digitally signed message part


Re: unmounting /media/usbdisk from the command line?

2006-10-26 Thread Wayne Topa
Stefan Monnier([EMAIL PROTECTED]) is reported to have said:
 
 When a USB disk is mounted by gnome-volume-manager, I can unmount it using
 nautilus (via right clicking on the disk's icon), but I haven't figured how
 to do it from the command line.  Any hint?

run df to find where it's mounted.

then umount (wherever it's mounted.).

WT
-- 
Programmers don't die, they just GOSUB without RETURN.
___


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: unmounting /media/usbdisk from the command line?

2006-10-26 Thread Brad Sawatzky
On Thu, 26 Oct 2006, Stefan Monnier wrote:

 When a USB disk is mounted by gnome-volume-manager, I can unmount it using
 nautilus (via right clicking on the disk's icon), but I haven't figured how
 to do it from the command line.  Any hint?

Here's a perl script I use.  Save it somewhere in your PATH (I call it
$HOME/bin/pum), and make it executable (chmod a+x $HOME/bin/pum).
When invoked it generates a list of mounted file-systems in /media/,
asks what to pumount.  It will fallback to a lazy umount if necessary.

Term::ReadKey is used to avoid hitting return after your selection
(doubling your productivity!).
  apt-get install libterm-readkey-perl

-- Brad

--- START: bin/pum 

#! /usr/bin/perl -w

# This is licensed under the Gnu Public License (GPL).
# On Debian systems the text of the license can be found at
#   /usr/share/common-licenses/GPL
#
# Initial Author:  Brad Sawatzky [EMAIL PROTECTED] (July 2006)

# This relies on Term::ReadKey in the 'libterm-readkey-perl' package.

##
## List auto-mounted filesystems and prompt for pumount ##
##
use strict;
use Term::ReadKey;
use Term::ANSIColor qw(:constants);

$ENV{PATH}=/bin:/usr/bin;

my $DIR=/media;
my @mounts;
my $i=0;

if ($#mounts == -1) {
 ## FIXME Should probably sanity check results and/or use a perl module here
  for (`/bin/ls $DIR`) {
chomp;
my $name = $_;
push @mounts, $DIR/$name;

print RED, [$i]:, RESET,  $_\n;
$i++;
  }
}

if ($#mounts  -1) {
  my $choice;

  ReadMode('cbreak');
  print Unmount: ;
  $choice = ReadKey(0);
  print $choice\n;
  ReadMode('normal');

  exit 0 if ($choice !~ /\d/);
  if ($choice  $#mounts) {
print RED,Invalid selection (,RESET,$choice,RED,)\n,RESET;
exit 1;
  }

  if (system (/usr/bin/pumount,$mounts[$choice]) != 0) {
print RED, \tpumount failed, attempting lazy punmount\n,RESET;
if (system (/usr/bin/pumount,-l,$mounts[$choice]) != 0) {
  print RED,\tlazy punmount failed\n,RESET;
  exit 1;
}
  }
  print BLUE,FS successfully unmounted:  ,RESET,$mounts[$choice]\n;
  exit 0;
}

print RED,No mounted filesystems found in ,RESET,$DIR\n;
exit 0;

--- END: bin/pum 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: unmounting /media/usbdisk from the command line?

2006-10-26 Thread H.S.

Stefan Monnier wrote:

When a USB disk is mounted by gnome-volume-manager, I can unmount it using
nautilus (via right clicking on the disk's icon), but I haven't figured how
to do it from the command line.  Any hint?


Stefan




If it is mounted on /media/usbstick (use df to see the location), I use:
$ pumount /media/usbstick

-HS



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]