[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

volname command



So I was just making an image of a DVD for (apparently) the first time
in a *long* time.  I have a script for this that I wrote ages ago (last
modified in 2011):

    #!/bin/sh
    
    set -e
    
    device=${DEV:-/dev/sr0}
    iso="$( volname "$device" | sed 's/[[:space:]]*$//;s/[[:space:]]/_/g' )"
    
    if [ "$#" -gt 0 ]; then
        iso="${iso}_($( echo "$@" | sed 's/[[:space:]]*$//;s/[[:space:]]/_/g' ))"
    fi
    
    iso="$iso".iso
    
    echo "Writing an image of $device to $iso..." >&2
    
    dd_rescue \
        "$device" \
        "$iso"
    
    chmod -v 644 "$iso"
    
    eject "$device"

(Not my best work.  Please don't judge.  :-)

So trying to use that today, I find that I no longer have a "volname"
command.  After doing a bit of digging, I found out that volname was
part of the eject package, and eject was pulled into util-linux a number
of years ago, but since volname duplicated existing functionality, it
was not.

    https://lists.fedoraproject.org/pipermail/devel/2012-August/170867.html

In the unlikely event that any of you used volname and miss it, you can
create yourself a script to emulate its behavior:

    #!/bin/bash
    
    /sbin/blkid -s LABEL -o value "$@"

blkid is part of util-linux, so while it isn't as simple to use as
volname, it definitely makes volname unnecessary.

-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.