WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1104
  • HandMace informatic works
Why "umount -L label" don't work?
« on: November 02, 2009, 01: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

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

Offline vinnie

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

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7017
    • My Community Forum
Re: Why "umount -L label" don't work?
« Reply #3 on: November 03, 2009, 10:55:41 PM »
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 03, 2009, 10:58:41 PM by bmarkus »
Béla
Ham Radio callsign: HA5DI

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

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1104
  • HandMace informatic works
Re: Why "umount -L label" don't work?
« Reply #4 on: December 06, 2011, 06: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: 10051
Re: Why "umount -L label" don't work?
« Reply #5 on: December 06, 2011, 08: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: 1104
  • HandMace informatic works
Re: Why "umount -L label" don't work?
« Reply #6 on: December 06, 2011, 11:20:40 PM »
Ok, thanks curaga, it work but, to substitutde /dev/... with /mnt/ for ordinary operation on disk?

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1104
  • HandMace informatic works
Re: Why "umount -L label" don't work?
« Reply #7 on: December 07, 2011, 05: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 :)