[ceph-users] findmnt (was Re: Migration from filestore to blustore)
mv3 at sanger.ac.uk
Mon Nov 20 07:19:45 PST 2017
On 20/11/17 15:00, Gerhard W. Recher wrote:
Just interjecting here because I keep seeing things like this, and
they're often buggy, and there's an easy answer:
> DEVICE=`mount | grep /var/lib/ceph/osd/ceph-$ID| cut -f1 -d"p"`
findmnt(8) is your friend, any time you want to find out about mounted
filesystems, and much more reliable than grepping the output of mount or
/proc/mtab/ or whatever (consider if ID is 1 and you have ceph-1 and
ceph-10 mounted on the host, for example).
findmnt -T "/var/lib/ceph/osd/ceph-$id" -n -o SOURCE
is probably what you wanted here. Findmnt is in util-linux, and should
be in all non-ancient distributions.
Here ends the message from the findmnt(8) appreciation society :)
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.
More information about the ceph-users