I have CentOS installed in my VirtualBox and there was small HDD for the system itself(about 8-9GB). After some time of using this, this virtual disc got full and I couldn't install updates so I extended the HDD with VBoxManage and GParted to 25GB. But now, even if it has greater capacity, I can't install these updates because of not enought space left. Here is what fdisk -l tells meDisk /dev/sda: 26,2 GB, 26214400000 bajthlav: 255, sektor na stopu: 63, cylindr: 3187Jednotky = cylindry po16065 * 512 = 8225280 bajtechVelikost sektoru (logickho/fyzickho): 512 bajt / 512 bajtVelikost I/O (minimln/optimln): 512 bajt / 512 bajtIdentifiktor disku:0x000242e1Zazen Zavdt   Zatek       Konec    Bloky    Id  Systm/dev/sda1   *           1          64      512000   83  LinuxDiskov oddl 1 nekon na hranici cylindru./dev/sda2              64        3188    25086976   8e  Linux LVM(sorry for the language).df -hFilesystem            Size  Used Avail Use% Mounted on/dev/mapper/VolGroup-lv_root                      6,5G  6,2G     0 100% /tmpfs                 1,9G  324K  1,9G   1% /dev/shm/dev/sda1             485M  114M  346M  25% /bootI've also tried the resize2fs /dev/sda2 but it gives me an error about bad superblock. So I've tried the fsck -t ext4 /dev/sda command but no success again(first error was about that the /dev/sda is currently used and when I booted into the CentOS rescue mode, the error changed to couldn't open /etc/fstab: No such file or directory and info about that the superblock is invalid.How can I use the newly added space?
CentOS can't use new extented space on system disc
linux;partition;lvm
Notice that your slash directory /, is coming from an LV (Logical Voume) from LVM, /dev/mapper/VolGroup-lv_root. So to get the newly added space into / you need to extend it in LVM first, then extend it into the EXT4 partition.The first thing you'll notice is that the underlying physical drive that is providing the storage for LVM is /dev/sda2. NOTE: I'm assuming that's the device providing the storage a better way to determine this would be to inquire through LVM first.ExamplePhysical disks aka. PV's (Physical Volumes) assigned to a VG (Volume Group).$ sudo pvs  PV         VG               Fmt  Attr PSize   PFree  /dev/sda2  fedora_greeneggs lvm2 a--  465.27g    0 Makeup of VG's. Notice it has 1 physical volume (that's the above), and it contains 3 LV's (see below).$ sudo vgs  VG               #PV #LV #SN Attr   VSize   VFree  fedora_greeneggs   1   3   0 wz--n- 465.27g    0 The VG contains 3 LV's. You can see them below, as well as what VG they're part of.$ sudo lvs  LV   VG               Attr      LSize   Pool Origin Data%  Move Log Copy%  Convert  home fedora_greeneggs -wi-ao--- 407.63g                                             root fedora_greeneggs -wi-ao---  50.00g                                             swap fedora_greeneggs -wi-ao---   7.64g              ExtendingSo here's what you need to do:Extend the extra space from /dev/sda2 into the LVM Group$ pvresize /dev/sda2Extend the newly added free space into the Logical Volume$ lvextend -L 100% /dev/mapper/VolGroup-lv_rootExtend the newly added free space into the ext4 partition$ resize2fs /dev/VolGroup/lv_rootReferencesExtending an LVM volume: Physical volumes (partitions) -> Volume groups -> Logical volume -> Filesystem