partx -d -nr /dev/sdb
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了partx -d -nr /dev/sdb相关的知识,希望对你有一定的参考价值。
[root@centos6 ~]#mount --显示挂载的文件系统/dev/sda2 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sda3 on /data type ext4 (rw)
/mnt/disk on /mnt/xdisk type ext4 (rw,loop=/dev/loop0)
/dev/sdb1 on /mnt/sdb1 type ext4 (rw) ---显示是挂载的
[root@centos6 ~]#umount /mnt/sdb1 ---取消挂载
[root@centos6 ~]#lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 100M 0 loop /mnt/xdisk
sda 8:0 0 200G 0 disk
├─sda1 8:1 0 1G 0 part /boot
├─sda2 8:2 0 97.7G 0 part /
├─sda3 8:3 0 48.8G 0 part /data
├─sda4 8:4 0 1K 0 part
└─sda5 8:5 0 2G 0 part [SWAP]
sdb 8:16 0 20G 0 disk
└─sdb1 8:17 0 1G 0 part -------------显示有分区
sr0 11:0 1 1024M 0 rom
loop100 7:100 0 100M 0 loop
[root@centos6 ~]#dd if=/dev/zero of=/dev/sdb1 bs=1 count=512---去掉分区表
512+0 records in
512+0 records out
512 bytes (512 B) copied, 0.0042738 s, 120 kB/s
[root@centos6 ~]#
[root@centos6 ~]#
[root@centos6 ~]#
[root@centos6 ~]#lsblk --------查看分区信息没同步
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 100M 0 loop /mnt/xdisk
sda 8:0 0 200G 0 disk
├─sda1 8:1 0 1G 0 part /boot
├─sda2 8:2 0 97.7G 0 part /
├─sda3 8:3 0 48.8G 0 part /data
├─sda4 8:4 0 1K 0 part
└─sda5 8:5 0 2G 0 part [SWAP]
sdb 8:16 0 20G 0 disk
└─sdb1 8:17 0 1G 0 part --------------仍然存在 这是信息没同步导致的
sr0 11:0 1 1024M 0 rom
loop100 7:100 0 100M 0 loop
[root@centos6 ~]#par
parec parecord parted partprobe partx
[root@centos6 ~]#partx -d --nr 1 /dev/sdb----------做分区信息同步
[root@centos6 ~]#lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 100M 0 loop /mnt/xdisk
sda 8:0 0 200G 0 disk
├─sda1 8:1 0 1G 0 part /boot
├─sda2 8:2 0 97.7G 0 part /
├─sda3 8:3 0 48.8G 0 part /data
├─sda4 8:4 0 1K 0 part
└─sda5 8:5 0 2G 0 part [SWAP]
sdb 8:16 0 20G 0 disk ------------这里就正常了
sr0 11:0 1 1024M 0 rom
loop100 7:100 0 100M 0 loop
以上是关于partx -d -nr /dev/sdb的主要内容,如果未能解决你的问题,请参考以下文章
fdisk时WARNING: Re-reading the partition table failed with error 16: 设备或资源忙.