Linux下用fdisk命令和partprobe命令不重启系统新建分区并格式化(1)
由于工作的需要,最近一段时间一直在学习Linux。学习一门新的知识,我是喜欢根据谋一本书或者某一个学习视频系统的学习,这样可以对学习的新知识有一个系统全面的认识和了解。所以学习之前,买了一本鸟哥的私房菜做为参考书,开始系统的学习Linux。
根据鸟哥的建议,安装虚拟机时,预留了一块空的容量用来练习分区使用。所以在虚拟机上安装Linux系统分区时,只划分了一块4G的容量挂载到根目录“/”下,还有就是只划分了一个2G的swap分区。还有14G的容量没有分配。
在学习磁盘管理时,使用fdisk将剩余的容量继续分区。却发现新建完分区后,无法通过partprobe重载分区。
具体操作如下所示:
1、使用fdisk新建分区
。。。。)分区操作记录没有保存下来,执行w后,出现下列信息
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units=cylindersof 16065 *512=8225280bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b604c Device Boot Start End Blocks Id System
/dev/sda1 * 1 523 4194304 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 523 784 2097152 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3 784 2610 14672345 5 Extended
/dev/sda5 784 1421 5121671 83 LinuxCommand (m for help): w
The partition table has been altered!Calling ioctl() to re-read partition table.WARNING: Re-reading the partition table failed with error 16: 设备或资源忙.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
保存新建分区,提示“设备或资源忙”,当时就在/dev/sda硬盘上做的操作,以为该提示为正常现象,所以忽略了,继续下一步操作。
2、通过partprobe重载分区表,避免重启系统
[root@stduy /]# partprobe
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (设备或资源忙). As a result, it may not reflect all of your changes until after reboot.
Warning: 无法以读写方式打开 /dev/sr0 (只读文件系统)。/dev/sr0 已按照只读方式打开。
Warning: 无法以读写方式打开 /dev/sr0 (只读文件系统)。/dev/sr0 已按照只读方式打开。
Error: 无效的分区表 - /dev/sr0 出现递归分区。
重载分区出现的上述信息中,当时对于警告提示“设备或资源忙,需要重启系统才能使更改生效”直接忽略,以为是正常现象。但是对于错误信息“Error: 无效的分区表 - /dev/sr0 出现递归分区。”就有点茫然了,不过,既然提示“无效的分区表”,那我查下分区信息。
http://www.dengb.com/Linuxjc/870497.htmlwww.dengb.comtruehttp://www.dengb.com/Linuxjc/870497.htmlTechArticleLinux下用fdisk命令和partprobe命令不重启系统新建分区并格式化(1) 由于工作的需要,最近一段时间一直在学习Linux。学习一门新的知识,我是喜...