码迷,mamicode.com
首页 > 数据库 > 详细

partx -d -nr /dev/sdb

时间:2020-03-10 13:50:46      阅读:71      评论:0      收藏:0      [点我收藏+]

标签:tmp   分区   mode   lsb   分区表   信息   roo   record   poi   

[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

标签:tmp   分区   mode   lsb   分区表   信息   roo   record   poi   

原文地址:https://blog.51cto.com/12246080/2476906

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!