Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I used virtualbox4 to create a box(8G disk) and installed a Fedora 16. Soon I found the space is not enough that I can't download anything in ~/download.

I use VBoxManage to increase the disk size to 20G, but I still can't download anything.

After some research(I'm newbie to linux), I realize that the increased disk has not been used. I tried to make / to use it, but failed. Because the result of some commands are not the same as my linux book.

df

cd /
df -h

prints:

[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

prints(thanks to Mike):

[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 ~]# 

I don't know what can I do now. How to let / to use extra 12G space? If it's hard, how can I create an extra partition and mount a new dir /mydev to it?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

First of all you have to run fdisk -l as root not a normal user..

That is a lvm.. so you want to create a new drive and grow the lvm i the OS.. So this will work if you create another drive and linux see's it as /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 

That is my knowing nothing about your lvm setup and taking a guess.. but that is how your grow a lvm

Also make sure you reboot the VM once you add the disk... or you can try to re-scan

echo "- - -" > /sys/class/scsi_host/host1/scan
echo "- - -" > /sys/class/scsi_host/host2/scan
share|improve this answer
    
Thanks Mike, and rerun fdisk -l as root. See my updated question. –  Freewind Apr 29 '12 at 3:59
    
Ya you're best bet is to create a new disk and do what I said.. it should appear as /dev/sdb –  Mike Apr 29 '12 at 4:00
    
[root@localhost ~]# pvcreate /dev/sdb prints Device /dev/sdb not found (or ignored by filtering). –  Freewind Apr 29 '12 at 4:02
    
yes you didn't create a new drive in virtualbox and reboot the guest yet. –  Mike Apr 29 '12 at 4:04
    
It works! Thank you so much! –  Freewind Apr 29 '12 at 4:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.