Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

mount: unknown filesystem type 'LVM2_member' ...

216 views
Skip to first unread message

Albretch Mueller

unread,
Jul 9, 2020, 7:00:05 AM7/9/20
to
I (wrongly) think I have done everything right but I can't mount the
encrypted drive

// __ partition with the encrypted external drive

_PART="sdb"

###
date; lsblk | grep "${_PART}"

date; blkid | grep crypto_LUKS | grep "${_PART}"

// __ device

_DEV=$(blkid | grep crypto_LUKS | grep "${_PART}" | awk -F: '{print $1}')
echo "// __ \$_DEV: |${_DEV}|"

_CR_CRYPTO=$(basename "${_DEV}")"_cr-crypto"
echo "// __ \$_CR_CRYPTO: |${_CR_CRYPTO}|"

date; time cryptsetup --verbose luksOpen "${_DEV}" "${_CR_CRYPTO}"

date; lsblk | grep "${_PART}"

date; time cryptsetup status "${_CR_CRYPTO}"

// __ getting logical volume group (listing all to see which one is
the logical volume associated with the external drive ... )

vgs

_X_LVG="lbrtchx-vg"

###

date; time pvscan --verbose --uuid | grep "${_X_LVG}"

date; time vgchange --activate y | grep "${_X_LVG}"

date; time lvdisplay --verbose "${_X_LVG}" | grep "LV Path"

~
I get from the last three commands:


# date; time pvscan --verbose --uuid | grep "${_X_LVG}"
Thu Jul 9 11:41:48 WEST 2020
Wiping internal VG cache
Wiping cache of LVM-capable devices
PV /dev/mapper/sdb3_cr-crypto with UUID
CQqpCe-qlsx-NQi8-q2qj-gBAM-26Na-xJwRLG VG lbrtchx-vg lvm2
[297.35 GiB / 0 free]

real 0m0.435s
user 0m0.024s
sys 0m0.024s
#

# date; time vgchange --activate y | grep "${_X_LVG}"
Thu Jul 9 11:41:49 WEST 2020
5 logical volume(s) in volume group "lbrtchx-vg" now active

real 0m0.036s
user 0m0.020s
sys 0m0.012s
#

# date; time lvdisplay --verbose "${_X_LVG}" | grep "LV Path"
Thu Jul 9 11:41:49 WEST 2020
LV Path /dev/lbrtchx-vg/root
LV Path /dev/lbrtchx-vg/var
LV Path /dev/lbrtchx-vg/swap_1
LV Path /dev/lbrtchx-vg/tmp
LV Path /dev/lbrtchx-vg/home

real 0m0.040s
user 0m0.020s
sys 0m0.012s
#


but when I try to mount the device:

_DEV_CR_CRYPTO=$(cryptsetup status "${_CR_CRYPTO}" | head -n 1 | awk
'{print $1}')
echo "// __ \$_DEV_CR_CRYPTO: |${_DEV_CR_CRYPTO}|"

_MED_MNT="/media/"$(basename "${_DEV_CR_CRYPTO}")"/$(date +%Y%m%d%H%M%S)"
echo "// __ \$_MED_MNT: |${_MED_MNT}|"

mkdir --verbose --parents "${_MED_MNT}"

if [ -s "${_MED_MNT}" ]; then
echo "// __ \$_MED_MNT: |${_MED_MNT}| exists!"
echo "mount --verbose \""${_DEV_CR_CRYPTO}"\" \""${_MED_MNT}\"" -r"

date; time mount --verbose "${_DEV_CR_CRYPTO}" "${_MED_MNT}" -r
fi

I am getting:

mount: unknown filesystem type 'LVM2_member'

what is it exactly I am not getting right?

lbrtchx

Reco

unread,
Jul 9, 2020, 8:00:04 AM7/9/20
to
Hi.

On Thu, Jul 09, 2020 at 06:54:05AM -0400, Albretch Mueller wrote:
> but when I try to mount the device:
>
> _DEV_CR_CRYPTO=$(cryptsetup status "${_CR_CRYPTO}" | head -n 1 | awk
> '{print $1}')
...
> date; time mount --verbose "${_DEV_CR_CRYPTO}" "${_MED_MNT}" -r
> fi
>
> I am getting:
>
> mount: unknown filesystem type 'LVM2_member'
>
> what is it exactly I am not getting right?

You're trying to mount lvm2 physical volume which is never going to
work - it's not a filesystem.
What you should mount is a logical volume, i.e. that devices that
lvdisplay shows you.

Reco

Albretch Mueller

unread,
Jul 9, 2020, 8:30:05 AM7/9/20
to
so, I should go?:

mkdir -p "/media/abc123"

mount "/dev/lbrtchx-vg/home" "/media/abc123"

Reco

unread,
Jul 9, 2020, 8:50:04 AM7/9/20
to
More or less. The correct sequence is:
1) cryptsetup luksOpen
2) pvscan && vgchange -ay
3) mount "/dev/lbrtchx-vg/home" "/media/abc123"

And the unmounting should go in reverse:
1) umount /media/...
2) vghcange -an ...
3) cryptsetup luksClose

Reco

Albretch Mueller

unread,
Jul 14, 2020, 8:10:06 AM7/14/20
to
On 7/9/20, Reco <recov...@enotuniq.net> wrote:
> More or less. The correct sequence is:
> 1) cryptsetup luksOpen
> 2) pvscan && vgchange -ay
> 3) mount "/dev/lbrtchx-vg/home" "/media/abc123"
>
> And the unmounting should go in reverse:
> 1) umount /media/...
> 2) vghcange -an ...
> 3) cryptsetup luksClose

thank you, but for some reason I can't quite understand, I haven't
found a thorough, self-describing step-by-step guideline about such
matters and I don't have the time right now, Internet access to make
another mistake.

# _DEV_MPPR="/dev/mapper/${_CR_CRYPTO}"
# echo "// __ \$_DEV_MPPR: |${_DEV_MPPR}|"
// __ $_DEV_MPPR: |/dev/mapper/sdc3_xcrypto|

# time mkfs --type ext4 "${_DEV_MPPR}"
mke2fs 1.43.4 (31-Jan-2017)
/dev/mapper/sdc3_xcrypto contains a LVM2_member file system
Proceed anyway? (y,N) N


real 0m13.893s
user 0m0.012s
sys 0m0.004s
#
lbrtchx

Reco

unread,
Jul 14, 2020, 10:00:04 AM7/14/20
to
That does seem wrong. Is /dev/mapper/sdc3_xcrypto shown by
lvdisplay/lvs? Because it is not, you probably should not try to mount
it.

Reco
0 new messages