Tiny Core Linux

General TC => General TC Talk => Topic started by: vinnie on November 02, 2009, 01:45:55 AM

Title: Why "umount -L label" don't work?
Post by: vinnie 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?
Title: Re: Why "umount -L label" don't work?
Post by: roberts on November 02, 2009, 06:26:55 AM
Not supported as shown by:
umount --help
Title: Re: Why "umount -L label" don't work?
Post by: vinnie on November 03, 2009, 10:42:46 PM
ok, you know a command that uses the label to unmount a drive?  ;D
Title: Re: Why "umount -L label" don't work?
Post by: bmarkus 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.
Title: Re: Why "umount -L label" don't work?
Post by: vinnie 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?
Title: Re: Why "umount -L label" don't work?
Post by: curaga 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.
Title: Re: Why "umount -L label" don't work?
Post by: vinnie on December 06, 2011, 11:20:40 PM
Ok, thanks curaga, it work but, to substitutde /dev/... with /mnt/ for ordinary operation on disk?
Title: Re: Why "umount -L label" don't work?
Post by: vinnie 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 :)