如何增加在虚拟盒子上安装Fedora的`/`?

我用virtualbox4来创build一个盒子(8G磁盘),并安装了Fedora 16.不久,我发现空间不够,我不能下载任何东西~/download

我使用VBoxManage将磁盘大小增加到20G,但我仍然无法下载任何内容。

经过一些研究(我是新手到Linux),我意识到增加的磁盘尚未使用。 我试图使用它,但失败了。 因为一些命令的结果与我的linux书不一样。

DF

 cd / df -h 

打印:

 [freewind@localhost /]$ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_fedora16-lv_root 3.6G 3.5G 7.7M 100% / tmpfs 565M 272K 565M 1% /dev/shm /dev/sda1 485M 55M 405M 12% /boot /dev/sr0 49M 49M 0 100% /media/VBOXADDITIONS_4.1.12_77245 

FDISK

 fdisk -l 

打印(感谢迈克):

 [root@localhost ~]# fdisk -l Disk /dev/sda: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0007bb7a Device Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 64 1045 7875584 8e Linux LVM Disk /dev/mapper/vg_fedora16-lv_root: 3833 MB, 3833593856 bytes 255 heads, 63 sectors/track, 466 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/mapper/vg_fedora16-lv_root doesn't contain a valid partition table Disk /dev/mapper/vg_fedora16-lv_swap: 4227 MB, 4227858432 bytes 255 heads, 63 sectors/track, 514 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/mapper/vg_fedora16-lv_swap doesn't contain a valid partition table [root@localhost ~]# 

我不知道现在可以做什么。 如何让/使用额外的12G空间? 如果很难,我怎么能创build一个额外的分区,并挂载一个新的dir /mydev

首先,你必须以超级用户身份运行fdisk -l,而不是普通用户。

这是一个lvm ..所以你想创build一个新的驱动器,并在操作系统上增长lvm ..所以这将工作,如果你创build另一个驱动器和Linux看到它的/ dev / sdb

 pvcreate /dev/sdb vgextend /dev/mapper/vg_fedora16 /dev/sdb lvextend -l +100%FREE /dev/vg_fedora16/lv_root resize2fs /dev/vg_fedora16/lv_root 

那是我对你的LVM设置一无所知,并猜测..但这是你如何成长一个LVM

另外,确保在添加磁盘后重启虚拟机,或者尝试重新扫描

 echo "- - -" > /sys/class/scsi_host/host1/scan echo "- - -" > /sys/class/scsi_host/host2/scan