Sponsored Content
Full Discussion: Increase the filesystem size
Operating Systems Linux Red Hat Increase the filesystem size Post 302877086 by Scott on Thursday 28th of November 2013 04:27:09 AM
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.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
All times are GMT -4. The time now is 12:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy