Increase the filesystem size

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Increase the filesystem size
# 1  
Old 11-28-2013
Increase the filesystem size

Hi
I am using oracle linux 6.4. My hard drive capacity is 500 GB. my filesystem size onbly 50GB. I would like to extend my filesystem size to around 100GB. I tried many codes but still I am not able.
this is the output of df -h :
Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                       50G  3.6G   44G   8% /
tmpfs                 1.9G  260K  1.9G   1% /dev/shm
/dev/sda2             485M   55M  405M  12% /boot
/dev/sda1             200M  260K  200M   1% /boot/efi
/dev/sdb1              16G  9.5G  5.7G  63% /media/BE3E-B000

and df -k :
Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
                      51606140   3744716  45239984   8% /
tmpfs                  1968532       260   1968272   1% /dev/shm
/dev/sda2               495844     55756    414488  12% /boot
/dev/sda1               204580       260    204320   1% /boot/efi
/dev/sdb1             15858688   9941184   5917504  63% /media/BE3E-B000


Last edited by Scott; 11-28-2013 at 02:42 AM.. Reason: Please use code tags for code and data
# 2  
Old 11-28-2013
Check the output of pvs, just to make sure there is room to extend the LV. If there's enough space:

Code:
# lvextend -L+50G /dev/mapper/VolGroup-lv_root
# resize2fs /dev/mapper/VolGroup-lv_root

Otherwise the free space may be unpartitioned and we need to take different steps.

Last edited by Scott; 11-28-2013 at 03:08 AM.. Reason: Added otherwise
This User Gave Thanks to Scott For This Post:
# 3  
Old 11-28-2013
Quote:
Originally Posted by Scott
Check the output of pvs, just to make sure there is room to extend the LV. If there's enough space:

Code:
# lvextend -L+50G /dev/mapper/VolGroup-lv_root
# resize2fs /dev/mapper/VolGroup-lv_root

Otherwise the free space may be unpartitioned and we need to take different steps.
Hi
Thanks for your reply. this is the output of the pvs. I don't have free spaces. I have tried your code before, but because of the freespace I won't be able to extend the filesystem size.
I appreciate if you help me.
Output of pvs :

Code:
 
Code:
[root@localhost ~]# pvs
  PV         VG       Fmt  Attr PSize   PFree
  /dev/sda3  VolGroup lvm2 a--  465.07g    0


Last edited by farshad; 11-28-2013 at 04:36 AM..
# 4  
Old 11-28-2013
Hi.

Is Linux running in a virtual machine, or on the physical hardware?

Assuming the latter, it's likely that the remaining ~450 GB is unpartitioned, depending on what options you selected during the installation.

You can check in fdisk, or the graphical palimpsest partitioning tool, if you prefer. You can create a new partition of the required size.

For example, here's an example where I've created a new partition of 5GB from unpartitioned space on /dev/sda, using fdisk:
Code:
[root@admin ~]# fdisk -uc /dev/sda

Command (m for help): p

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003bc8c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    13314047     6144000   8e  Linux LVM

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First sector (13314048-41943039, default 13314048): (pressed Enter to accept default)
Using default value 13314048
Last sector, +sectors or +size{K,M,G} (13314048-41943039, default 41943039): +5G

Command (m for help): p

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003bc8c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    13314047     6144000   8e  Linux LVM
/dev/sda3        13314048    23799807     5242880   83  Linux

Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 8e
Changed system type of partition 3 to 8e (Linux LVM)

Command (m for help): p

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003bc8c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    13314047     6144000   8e  Linux LVM
/dev/sda3        13314048    23799807     5242880   8e  Linux LVM

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

Everything I typed is in red. You'll need to reboot to update the partition table.

Now run these commands, substituting volume, volume group, logical volume names and sizes for your own:
Code:
[root@admin ~]# pvcreate /dev/sda3 # <-- for me this is what is new, in blue, above
  Physical volume "/dev/sda3" successfully created
[root@admin ~]# vgextend rootvg /dev/sda3
  Volume group "rootvg" successfully extended
[root@admin ~]# pvs
  PV         VG       Fmt  Attr PSize  PFree  
  /dev/sda2  rootvg   lvm2 a--   5.84g 320.00m
  /dev/sda3  rootvg   lvm2 a--   4.97g   4.97g
  /dev/sdb   dist01vg lvm2 a--  20.00g      0 
[root@admin ~]# vgdisplay -s
  "dist01vg" 20.00 GiB [20.00 GiB used / 0    free]
  "rootvg" 10.81 GiB [5.53 GiB  used / 5.28 GiB free]
[root@admin ~]# 
[root@admin ~]# lvextend -L+5G /dev/mapper/rootvg-rootlv # <-- You can substitute -l+100%FREE for -L+5G if there isn't quite 5GB of free space
  Extending logical volume rootlv to 9.03 GiB
  Logical volume rootlv successfully resized
[root@admin ~]# resize2fs /dev/mapper/rootvg-rootlv 
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/rootvg-rootlv is mounted on /; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/mapper/rootvg-rootlv to 2367488 (4k) blocks.
The filesystem on /dev/mapper/rootvg-rootlv is now 2367488 blocks long.

If Linux is running in a virtual machine, you should add a new hard disk, then run the same commands for (probably) /dev/sdb.
# 5  
Old 11-28-2013
Dear Scott
Thanks alot for your reply. I have followed your code for creating a new partition and I assigned +100G to this. everything was successfull and as you were requested to do a reboot to update the partition, I made a reboot. But I am not able to to access to my GUI. and I'm having an error that is :
Code:
****An error ocurred during the file system check.
**** Dropping you to a shell; the system will reboot
****when you leave the shell.
****Warning -- SELinux is active
****Disabling security enforment for system recovery.
**** Run 'setenforce 1' to reenable.

, I run the fsck but it is just hanging, showing pages like matrix and just passing numbers fast. I don't whats happened to my OS.
anyway, maybe I format my pc. But as you mention is it possible to just partition the freespace during OS installation. I want to install Oracle Linux 6.4
I haven't seen any pages during installation regarding to the partitions .

I really appreciate your help and support

Last edited by Scott; 11-28-2013 at 07:15 AM.. Reason: Code tags
# 6  
Old 11-28-2013
Can you show the output of:
Code:
# fdisk -ucl /dev/sda

(assuming you created the new partition on /dev/sda)

Assuming you have made no other changes, you can delete the partition you just created, being careful not to delete the wrong one, then reboot again.
# 7  
Old 11-28-2013
hi.
this is the out put of Fdisk -ucl /dev/sda
Code:
WARNING : GPT(GUID partition table) detected on '/dev/sda'!the util doesn't support GPT, Use GNU Parted.

Disk /dev/sda : 500.1 GB. 500107862016 bytes
255 heads, 63 sectors,/track , 60801 cylinders, total 976773168 sectors
units = sectors of 1*512 = 512 bytes
sector size ( logical/phisycal): 512 bytes / 512 bytes
I/O size (minimum/optimal:512 bytes/512 bytes
Disk identifier 0*000000000

Device Boot       Start           End            Blocks              ID              SYSTEM
/dev/sda1          1                976773167  488386583+       ee          GPT

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Increase filesystem size AIX 5.3

I an trying to increase the file size on an AIX 5.3 box. I think i am missing the correct syntax for the command. Here is was i am trying on a test box # lsvg rootvg VOLUME GROUP: rootvg VG IDENTIFIER: 0000bd8b00004c00000 0010d8ed7a76e VG STATE: active ... (3 Replies)
Discussion started by: fierfek
3 Replies

2. AIX

Increase filesystem and or logical volume

Hi all, Do i need to increase the logical volume each time i increase the filesystem? or is enough to increase the filesystem and the logical volume get increase automatically? extendlv hd4 1 chfs -a size=2G /tmp or just chfs -a size=2G /tmp Code tags! (4 Replies)
Discussion started by: prpkrk
4 Replies

3. UNIX for Advanced & Expert Users

Physical disk IO size smaller than fragment block filesystem size ?

Hello, in one default UFS filesystem we have 8K block size (bsize) and 1K fragmentsize (fsize). At this scenary I thought all "FileSytem IO" will be 8K (or greater) but never smaller than the fragment size (1K). If a UFS fragment/blocksize is allwasy several ADJACENTS sectors on disk (in a ... (4 Replies)
Discussion started by: rarino2
4 Replies

4. Solaris

Increase root filesystem on solaris zone using zpool

I have a solaris zone of 12 GB and i have to increase the / filesystem to 31GB as requested. Earlier I had expanded filesystems other than / by setting quota to new value like "zfs set quota=new value mountpoint" but I am not sure whether its a good practice in zfs because by default in my... (5 Replies)
Discussion started by: vikkash
5 Replies

5. AIX

How to increase the filesystem size in HACMP

How to increase the filesystem size in HACMP. what is the difference between normal chfs command and increase the filesystem size in HACMP. (4 Replies)
Discussion started by: AIXlearner
4 Replies

6. UNIX for Dummies Questions & Answers

How to increase the filesystem size?

Hi.. I want to increase the file system size of any filesystem online, without using the Volume manager like LVMs, is it possible? & if yes then how? (3 Replies)
Discussion started by: Amol21
3 Replies

7. Solaris

increase/decrease filesystem

Hi All, I need to increase the filesystem of / and /var (two different slices)? Space will be coming from /home slice so I need to decrease it. Is that possible without reinstallation or in a single-user-mode? Any idea or link please. Thanks in advance. (5 Replies)
Discussion started by: itik
5 Replies

8. Solaris

how to increase the filesystem size under veritas control

Hi all, aloe:root-> df �k Filesystem 1024-blocks Used Available Capacity Mounted on /dev/vx/dsk/rootvol 8254263 2064133 6107588 26% / /proc 0 0 0 0% /proc mnttab ... (2 Replies)
Discussion started by: krishna176
2 Replies

9. Solaris

What is the command to increase filesystem on solaris

I wanted to know what is the process or command to increase a filesystem on solaris. For example the /tmp directory. (3 Replies)
Discussion started by: strikelit
3 Replies

10. UNIX for Advanced & Expert Users

Reason for continuously increase filesystem size?

Hi my file system size /hd4 is keep on increasing continuously , i tried all the performance related command to identify which process is currently running........ for every minute my FS(/hd4) size is increasing ?what could be the problem? how to diagnose it ? is there any specific command... (3 Replies)
Discussion started by: aixteam
3 Replies
Login or Register to Ask a Question