Tiny Core Linux
General TC => General TC Talk => Topic started by: vinnie on November 02, 2009, 01:45:55 AM
-
The command
mount -L label
work correctly but the counterpart don't.
I am wrong and the command is another?
-
Not supported as shown by:
umount --help
-
ok, you know a command that uses the label to unmount a drive? ;D
-
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.
-
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?
-
partition=`blkid -L label`
mount $partition
Standard shell scripting. You get the output of a command via backticks, a subshell $(), or many other means.
-
Ok, thanks curaga, it work but, to substitutde /dev/... with /mnt/ for ordinary operation on disk?
-
Ok, a friend of mine gave me a hand:
mountdir=`blkid -L magipen|sed -e 's,dev,mnt,g'`
thanks to all :)