挂载 Docker 逻辑卷

4

我正在尝试访问一个逻辑卷,之前它被Docker使用过。以下是各种命令的结果:

lsblk

NAME                          MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme0n1                       259:2    0  80G  0 disk
├─nvme0n1p1                   259:3    0  80G  0 part /
└─nvme0n1p128                 259:4    0   1M  0 part
nvme1n1                       259:0    0  80G  0 disk
└─nvme1n1p1                   259:1    0  80G  0 part
  ├─docker-docker--pool_tdata 253:1    0  79G  0 lvm
  │ └─docker-docker--pool     253:2    0  79G  0 lvm
  └─docker-docker--pool_tmeta 253:0    0  84M  0 lvm
    └─docker-docker--pool     253:2    0  79G  0 lvm

fdisk

Disk /dev/nvme1n1: 85.9 GB, 85899345920 bytes, 167772160 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00029c01

        Device Boot      Start         End      Blocks   Id  System
/dev/nvme1n1p1            2048   167772159    83885056   8e  Linux LVM
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/nvme0n1: 85.9 GB, 85899345920 bytes, 167772160 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
Disk identifier: 358A5F86-3BCA-4FB2-8C00-722B915A71AB


#         Start          End    Size  Type            Name
 1         4096    167772126     80G  Linux filesyste Linux
128         2048         4095      1M  BIOS boot       BIOS Boot Partition

lvdisplay

  --- Logical volume ---
  LV Name                docker-pool
  VG Name                docker
  LV UUID                piD2Wx-aDjf-CkpN-b4s4-YXWE-6ERm-GWTcOz
  LV Write Access        read/write
  LV Creation host, time ip-172-31-39-159, 2020-02-16 09:18:57 +0000
  LV Pool metadata       docker-pool_tmeta
  LV Pool data           docker-pool_tdata
  LV Status              available
  # open                 0
  LV Size                79.03 GiB
  Allocated pool data    80.07%
  Allocated metadata     31.58%
  Current LE             20232
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

但是当我尝试挂载卷docker-docker--pool_tdata时,我会得到以下错误:

mount  /dev/mapper/docker-docker--pool_tdata /mnt/test
mount: /dev/mapper/docker-docker--pool_tdata is already mounted or /mnt/test busy

我还尝试了重新启动机器,卸载Docker并查看是否有使用lsof打开该卷的文件。

你知道如何挂载该卷吗?谢谢。


那看起来像是旧版本的Docker中的LVM devicemapper树。即使您可以挂载卷,镜像和容器内容也不会以易于提取的方式存储。 - David Maze
这只是为了尝试理解为什么“docker info”和“docker system df”显示不同的空间使用情况。已经提出了几个问题,但目前没有答案。https://forums.docker.com/t/docker-system-df-doesnt-add-up-to-docker-info-data-space/60238 https://forums.docker.com/t/questions-about-the-docker-storage-usage/60269 - mirobertod
你尝试将它挂载到另一个目录了吗?输出表明/mnt/test可能正在被占用。 - SebDieBln
1个回答

1
卸载docker并不真正有用,因为purgeautoremove只会删除安装的软件包而不是镜像、容器、卷和配置文件。
要删除这些内容,您需要删除etcvar/libbinvar/run中包含的一堆目录。
1. 清理环境
尝试运行docker system prune -a以删除未使用的容器、镜像等。 使用docker volume rm {volumeID}删除卷 再次创建卷docker volume create docker-docker--pool_tdata 2. 关闭进程
运行lsof +D /mnt/testcat ../docker/../tasks 这应该显示活动任务的PID。 使用kill -9 {PID}杀死任务。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接