tencentyun / tencentcloud-cbs-tools

4 stars 2 forks source link

check_mbr导致分区挂载 #1

Open zhouii opened 4 years ago

zhouii commented 4 years ago

每次执行前明明umount了分区却还是说我分区没有umount。分析后发现在check_mbr函数425行parted命令执行后会挂载分区,导致后续操作无法执行(以下为连续执行的3条命令及输出,说明parted命令会挂载分区)

[root@VM_4_6_centos tmp]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        50G   14G   33G  30% /
devtmpfs        909M     0  909M   0% /dev
tmpfs           920M   24K  920M   1% /dev/shm
tmpfs           920M  4.5M  915M   1% /run
tmpfs           920M     0  920M   0% /sys/fs/cgroup
tmpfs           184M     0  184M   0% /run/user/0
[root@VM_4_6_centos tmp]# parted /dev/vdb print
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 32.2GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  21.5GB  21.5GB  primary  ext4

[root@VM_4_6_centos tmp]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        50G   14G   33G  30% /
devtmpfs        909M     0  909M   0% /dev
tmpfs           920M   24K  920M   1% /dev/shm
tmpfs           920M  4.5M  915M   1% /run
tmpfs           920M     0  920M   0% /sys/fs/cgroup
tmpfs           184M     0  184M   0% /run/user/0
/dev/vdb1        20G   11G  7.7G  59% /disk
bulletRush commented 4 years ago

收到,我们分析下这个问题;预计下周一之前给出答复

bulletRush commented 4 years ago

没有复现。 @zhouii 能否提供下系统版本、systemd版本和parted版本?

cat /etc/centos-release
systemctl --version
parted --version
zhouii commented 4 years ago

@bulletRush

[root@VM_4_6_centos ~]# cat /etc/centos-release CentOS Linux release 7.2.1511 (Core) [root@VM_4_6_centos ~]# systemctl --version systemd 219 +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN [root@VM_4_6_centos ~]# parted --version parted (GNU parted) 3.1 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Written by http://git.debian.org/?p=parted/parted.git;a=blob_plain;f=AUTHORS.