VBox fdisk不顯示添加的硬盤解決方法
用fdisk 命令查看不到我們添加的磁盤:
[root@rac1 ~]# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280bytes
Sector size (logical/physical): 512 bytes /512 bytes
I/O size (minimum/optimal): 512 bytes / 512bytes
Disk identifier: 0x00085ca1
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinderboundary.
/dev/sda2 26 281 2048000 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3 281 3917 29203456 83 Linux
[root@rac1 ~]#
--但查看/proc/partitions,可以顯示:
[root@rac1 ~]# cat/proc/partitions
major minor #blocks name
8 0 31457280 sda
8 1 204800 sda1
8 2 2048000 sda2
8 3 29203456 sda3
8 16 8388608 sdb
8 32 8388608 sdc
8 48 8388608 sdd
8 64 8388608 sde
8 80 1048576 sdf
8 96 1048576 sdg
8 112 1048576 sdh
[root@rac1 ~]#
手工執行:start_udev 後,用fdisk命令也可以查看到磁盤。
推測udev在啟動的過程出現問題。
查看系統udev服務的狀態:
[root@rac1 ~]# service udev-post status
[root@rac1 ~]# chkconfig udev-post --list
udev-post 0:off 1:on 2:on 3:on 4:on 5:on 6:off
[root@rac1 ~]# service udev-post start
Retrigger failed udev events[ OK ]
注意:
我這是Oracle linux ,所以udev服務是:udev-post, 如果是redhat ,對應的服務是:udev
不深入研究這個問題,將start_udev添加到啟動項,保證能正常使用就可以了。
[root@rac2 ~]# vim /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* allthe other init scripts.
# You can put your own initialization stuffin here if you don't
# want to do the full Sys V style initstuff.
touch /var/lock/subsys/local
/sbin/start_udev
隨筆小記之。