WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Why "umount -L label" don't work?  (Read 7494 times)

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Why "umount -L label" don't work?
« on: November 02, 2009, 04:45:55 AM »
The command
Code: [Select]
mount -L label work correctly but the counterpart don't.
I am wrong and the command is another?

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Why "umount -L label" don't work?
« Reply #1 on: November 02, 2009, 09:26:55 AM »
Not supported as shown by:
umount --help
10+ Years Contributing to Linux Open Source Projects.

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: Why "umount -L label" don't work?
« Reply #2 on: November 04, 2009, 01:42:46 AM »
ok, you know a command that uses the label to unmount a drive?  ;D

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Why "umount -L label" don't work?
« Reply #3 on: November 04, 2009, 01:55:41 AM »
ok, you know a command that uses the label to unmount a drive?  ;D

You can script it easily. 'blkid' command returns both labels and the device in /dev/... format.
« Last Edit: November 04, 2009, 01:58:41 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: Why "umount -L label" don't work?
« Reply #4 on: December 06, 2011, 09:59:01 AM »
Years later I'm trying again because I reneed this in a script.

Blkid -L label show me /dev/partition, in the script so that I can use this data to mount and umount and to indicate the path of a directory

es.
blkid -L label
/dev/sdb1
script:
mount "result of blkid)
cp /result of blkid/subtdirectory /other/directory
umont "result of blkid)

how can I do?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11048
Re: Why "umount -L label" don't work?
« Reply #5 on: December 06, 2011, 11:23:23 AM »
partition=`blkid -L label`

mount $partition


Standard shell scripting. You get the output of a command via backticks, a subshell $(), or many other means.
The only barriers that can stop you are the ones you create yourself.

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: Why "umount -L label" don't work?
« Reply #6 on: December 07, 2011, 02:20:40 AM »
Ok, thanks curaga, it work but, to substitutde /dev/... with /mnt/ for ordinary operation on disk?

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: Why "umount -L label" don't work?
« Reply #7 on: December 07, 2011, 08:13:57 AM »
Ok, a friend of mine gave me a hand:
mountdir=`blkid -L magipen|sed -e 's,dev,mnt,g'`

thanks to all :)