给虚拟机添加新的磁盘分区Linux认证考试
文章作者 100test 发表时间 2009:10:22 22:01:00
来源 100Test.Com百考试题网
简单记录一下给虚拟机添加新的磁盘分区的步骤。
首先关闭虚拟机,然后选择设置,添加硬盘,创建一个虚拟磁盘,选择SCSI类型,设置磁盘的容量,并指定保存的操作系统文件名称。
下面就可以启动虚拟机。
登陆到虚拟机,切换到root用户:
[root@yangtk ~]# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
3142384 2963560 16624 100% /
/dev/sda1 101086 10876 84991 12% /boot
/dev/mapper/VolGroup00-LogVol03
8919192 6665924 1792880 79% /data
tmpfs 257800 0 257800 0% /dev/shm
/dev/mapper/VolGroup00-LogVol02
1015704 34452 928824 4% /tmp
[root@yangtk disk]# cd /dev/disk/by-path
[root@yangtk by-path]# ls -l
total 0
lrwxrwxrwx 1 root root 9 Oct 21 06:00 pci-0000:00:07.1-ide-0:0 ->. ../../hdc lrwxrwxrwx 1 root root 9 Oct 21 06:00 pci-0000:00:10.0-scsi-0:0:0:0 ->. ../../sda lrwxrwxrwx 1 root root 10 Oct 21 06:00 pci-0000:00:10.0-scsi-0:0:0:0-part1 ->. ../../sda1 lrwxrwxrwx 1 root root 10 Oct 21 06:00 pci-0000:00:10.0-scsi-0:0:0:0-part2 ->. ../../sda2 lrwxrwxrwx 1 root root 9 Oct 21 06:00 pci-0000:00:10.0-scsi-0:0:1:0 ->. ../../sdb
[root@yangtk by-path]# fdisk /dev/sdb -l
Disk /dev/sdb: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn t contain a valid partition table
[root@yangtk by-path]# fdisk /dev/sdb (进行分区)