Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #208100 > unrolled thread

pmount could perhaps be of greater utility?

Started byErik Christiansen <dvalin@internode.on.net>
First post2019-05-04 08:50 +0200
Last post2019-05-13 15:10 +0200
Articles 5 on this page of 25 — 9 participants

Back to article view | Back to linux.debian.user


Contents

  pmount could perhaps be of greater utility? Erik Christiansen <dvalin@internode.on.net> - 2019-05-04 08:50 +0200
    Re: pmount could perhaps be of greater utility? Jonas Smedegaard <jonas@jones.dk> - 2019-05-04 13:50 +0200
      Re: pmount could perhaps be of greater utility? Greg Wooledge <wooledg@eeg.ccf.org> - 2019-05-06 15:10 +0200
        Re: pmount could perhaps be of greater utility? Erik Christiansen <dvalin@internode.on.net> - 2019-05-06 16:00 +0200
          Re: pmount could perhaps be of greater utility? David <bouncingcats@gmail.com> - 2019-05-07 02:20 +0200
            Re: pmount could perhaps be of greater utility? Erik Christiansen <dvalin@internode.on.net> - 2019-05-07 06:10 +0200
              Netiquette [Was: Re: pmount could perhaps be of greater utility? Erik Christiansen <dvalin@internode.on.net> - 2019-05-07 14:50 +0200
                Re: Netiquette [Was: Re: pmount could perhaps be of greater utility? rhkramer@gmail.com - 2019-05-07 15:10 +0200
                  Re: Netiquette [Was: Re: pmount could perhaps be of greater utility? Erik Christiansen <dvalin@internode.on.net> - 2019-05-08 05:30 +0200
            Re: pmount could perhaps be of greater utility? Greg Wooledge <wooledg@eeg.ccf.org> - 2019-05-07 14:20 +0200
              Re: pmount could perhaps be of greater utility? David <bouncingcats@gmail.com> - 2019-05-19 07:10 +0200
            Shell game? was Re: pmount could perhaps be of greater utility? David Wright <deblis@lionunicorn.co.uk> - 2019-05-07 21:00 +0200
              Re: Shell game? was Re: pmount could perhaps be of greater utility? KHMan <keinhong@gmail.com> - 2019-05-08 08:10 +0200
                Re: Shell game? was Re: pmount could perhaps be of greater utility? David Wright <deblis@lionunicorn.co.uk> - 2019-05-08 18:40 +0200
                  Re: Shell game? was Re: pmount could perhaps be of greater utility? KHMan <keinhong@gmail.com> - 2019-05-08 20:10 +0200
      Remove nautilus to stop automounts? [Was: Re: pmount could perhaps  be of greater utility? Erik Christiansen <dvalin@internode.on.net> - 2019-05-07 13:40 +0200
        Re: Remove nautilus to stop automounts? [Was: Re: pmount could  perhaps be of greater utility? Brian <ad44@cityscape.co.uk> - 2019-05-07 14:00 +0200
    Re: pmount could perhaps be of greater utility? Eric S Fraga <e.fraga@ucl.ac.uk> - 2019-05-11 15:40 +0200
      Re: pmount could perhaps be of greater utility? Erik Christiansen <dvalin@internode.on.net> - 2019-05-12 10:00 +0200
        Re: pmount could perhaps be of greater utility? Eric S Fraga <e.fraga@ucl.ac.uk> - 2019-05-12 14:50 +0200
          Re: pmount could perhaps be of greater utility? Erik Christiansen <dvalin@internode.on.net> - 2019-05-12 15:40 +0200
            Re: pmount could perhaps be of greater utility? Eric S Fraga <e.fraga@ucl.ac.uk> - 2019-05-12 21:30 +0200
            Re: pmount could perhaps be of greater utility? David Wright <deblis@lionunicorn.co.uk> - 2019-05-15 06:40 +0200
        Re: pmount could perhaps be of greater utility? Eric S Fraga <e.fraga@ucl.ac.uk> - 2019-05-12 15:00 +0200
        Re: pmount could perhaps be of greater utility? Greg Wooledge <wooledg@eeg.ccf.org> - 2019-05-13 15:10 +0200

Page 2 of 2 — ← Prev page 1 [2]


#208598

FromErik Christiansen <dvalin@internode.on.net>
Date2019-05-12 15:40 +0200
Message-ID<xWWRP-6o5-1@gated-at.bofh.it>
In reply to#208596
On 12.05.19 13:45, Eric S Fraga wrote:
> On Sunday, 12 May 2019 at 17:52, Erik Christiansen wrote:
> > On 11.05.19 14:38, Eric S Fraga wrote:
> >> This is nice; is there an equivalent for FAT file systems?  Most of the
> >> devices I mount using pmount are sd cards (cameras etc.).
> >
> > Pmount is just a wrapper around the standard mount program, and that
> > will try to guess the fs type if not specified in the invocation - as
> > above. That manages ext2 and ext3 without assistance, but ... Ah, yes,
> > with a vfat stick it gives:
> 
> Sorry, I should have been more explicit.  I use pmount all the
> time.  Works fine.  What I was looking for was an equivalent of e2label
> for vfat, if that even makes any sense.

Dunno how much sense can be found here, as dosfslabel doesn't do it, but
this gives the appearance of doing it for me:

$ blkid | awk --field-separator '"' '/sdb1/ { print $2 }'
4DAB-09E3

from blkid's line:

/dev/sdb1: UUID="4DAB-09E3" TYPE="vfat"

As it replicates the automounter's behaviour, and that uses the label
for ext[23] sticks, I'm happy to take that UUID as the label, since I
have nothing else to go on. (Never had a winderz box in 30 years in IT,
or the 11 years since.)

Erik

[toc] | [prev] | [next] | [standalone]


#208604

FromEric S Fraga <e.fraga@ucl.ac.uk>
Date2019-05-12 21:30 +0200
Message-ID<xX2kx-1ln-9@gated-at.bofh.it>
In reply to#208598
On Sunday, 12 May 2019 at 23:35, Erik Christiansen wrote:
> Dunno how much sense can be found here, as dosfslabel doesn't do it, but
> this gives the appearance of doing it for me:

Thanks.

> (Never had a winderz box in 30 years in IT, or the 11 years since.)

Me either but I have cameras etc. that insist on vfat...

-- 
Eric S Fraga via Emacs 27.0.50 & org 9.2.3 on Debian buster/sid

[toc] | [prev] | [next] | [standalone]


#208657

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2019-05-15 06:40 +0200
Message-ID<xXTRT-Tk-5@gated-at.bofh.it>
In reply to#208598
On Sun 12 May 2019 at 23:35:11 (+1000), Erik Christiansen wrote:
> On 12.05.19 13:45, Eric S Fraga wrote:
> > On Sunday, 12 May 2019 at 17:52, Erik Christiansen wrote:
> > > On 11.05.19 14:38, Eric S Fraga wrote:
> > >> This is nice; is there an equivalent for FAT file systems?  Most of the
> > >> devices I mount using pmount are sd cards (cameras etc.).
> > >
> > > Pmount is just a wrapper around the standard mount program, and that
> > > will try to guess the fs type if not specified in the invocation - as
> > > above. That manages ext2 and ext3 without assistance, but ... Ah, yes,
> > > with a vfat stick it gives:
> > 
> > Sorry, I should have been more explicit.  I use pmount all the
> > time.  Works fine.  What I was looking for was an equivalent of e2label
> > for vfat, if that even makes any sense.
> 
> Dunno how much sense can be found here, as dosfslabel doesn't do it,

Perhaps you're looking at, or for, the wrong item. dosfslabel
(aka fatlabel) should do exactly what e2label does:

# fatlabel /dev/sdb1
China 1
# dosfslabel /dev/sdb1
China 1
# findfs LABEL='CHINA 1'
/dev/sdb1
# findfs UUID=F8FA-4A08
/dev/sdb1
# 

so it looks as though you were confusing the UUID with the LABEL.

However, on my system e2label and dosfslabel are not user commands,
and also are fs-specific, so I have functions defined for what I make
use of, like:

$ type fslabel
fslabel is a function
fslabel ()
{
    lsblk -o NAME,LABEL -l | sed -e "/^$1 /!d;s/^[^ ]\+[ ]\+//;"
}
$ 

(and ditto for UUID and FSTYPE).

I don't use pmount myself, but I installed it just to try it out.

$ ls -ld /media/C*
ls: cannot access '/media/C*': No such file or directory
$ pmount /dev/sdb1 "$(fslabel $(basename /dev/sdb1))"
$ ls -ld /media/C*
drwx------ 11 foo foo 16384 Dec 31  1969 /media/China 1
$ 

That seemed to work fine and could be wrapped in your lmount function.

> but
> this gives the appearance of doing it for me:
> 
> $ blkid | awk --field-separator '"' '/sdb1/ { print $2 }'
> 4DAB-09E3

/dev/sdb10 would match too, wouldn't it? (My bash function above
has a space after the $1.)

> from blkid's line:
> 
> /dev/sdb1: UUID="4DAB-09E3" TYPE="vfat"

For me, blkid is not a user command either, hence my using lsblk.

$ /sbin/blkid
$ 

> As it replicates the automounter's behaviour, and that uses the label
> for ext[23] sticks, I'm happy to take that UUID as the label, since I
> have nothing else to go on. (Never had a winderz box in 30 years in IT,
> or the 11 years since.)

LABELs give you IIRC 11 characters rather than the eight hex digits
of the UUID. Of course, if you're using LABELs to name mount points,
it pays to be a bit more circumspect than I was above. I added the
space etc here just for the proof of concept; they're normally a-z0-9
only.

Cheers,
David.

[toc] | [prev] | [next] | [standalone]


#208597

FromEric S Fraga <e.fraga@ucl.ac.uk>
Date2019-05-12 15:00 +0200
Message-ID<xWWf7-5VA-5@gated-at.bofh.it>
In reply to#208592
On Sunday, 12 May 2019 at 17:52, Erik Christiansen wrote:

[...]

> mounts vfat OK, but the "label" argument, now third, is ignored despite
> being compliant with the manpage. So it falls back to mounting on
> /media/sdb1 in a most wilful manner:

And I probably should have read your post more carefully before
replying.  Even if there is an equivalent to e2label for vfat, it
wouldn't be of much use from what you say here.

No worries!

-- 
Eric S Fraga via Emacs 27.0.50 & org 9.2.3 on Debian buster/sid

[toc] | [prev] | [next] | [standalone]


#208621

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2019-05-13 15:10 +0200
Message-ID<xXiSl-3he-1@gated-at.bofh.it>
In reply to#208592
On Sun, May 12, 2019 at 05:52:48PM +1000, Erik Christiansen wrote:
> lmount () {                         # Mount a USB stick at /media/read_stick_label
>    if [ mp=`e2label $1` ] ; then    # if e2label can grok the label.
>       pmount $1 $mp
>    else                             # When that fails, TRY TO
>       pmount -t vfat $1 vfat        # use fs type as mountpoint, for now.
>    fi
> }

A few errors here.

lmount() {
    local mp				# omit this if writing for POSIX sh
    if mp=$(e2label "$1"); then
	pmount "$1" "$mp"
    else
	pmount -t vfat "$1" vfat
    fi
}

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.debian.user


csiph-web