HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- increase and decrease file system sizes on red hat...
Operating System - Linux
1830177
Members
2304
Online
109999
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2009 12:33 PM
03-20-2009 12:33 PM
I am an hpux administrator and we have the first linux server in our environment. I have a question, how to increase or decrease the file system size on linux provided that we are using lvm and ext3 file system.
Solved! Go to Solution.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2009 01:35 PM
03-20-2009 01:35 PM
Solution
The first step (lvextend) should be very familiar from the HP-UX side. However, Linux offers a few convenient shortcuts:
- you can use letters k, M, G, T to identify the desired size. For example, to extend a LV to 100 gigabytes:
lvextend -L 100G /dev/vgSomething/lvolX
- or you can specify the amount to increase with a + sign. For example, to add 10 gigabytes:
lvextend -L +10G /dev/vgOther/lvolY
After the lvextend step is complete, the next step depends on your Linux distribution and version. For RedHat Enterprise Linux 4, the command is "ext2online /mountpoint".
(Don't worry about the "ext2": because ext3 = ext2 + journaling, the same filesystem tools apply for both ext2 and ext3.)
If the filesystem is created using an older version of Linux, it might not support online extension. In this case, unmount it and use "resize2fs /dev/vgSomething/lvolX".
To add the possibility for online extension, you can use "ext2prepare /dev/vgSomething/lvolX". This re-arranges the disk data so that the metadata areas can grow if necessary: the modern mke2fs command does this automatically when a filesystem is created, but the older versions did not.
For RedHat Enterprise Linux 5 (and probably other current Linux distributions), the functionality of ext2online is added to resize2fs. This one command can do both online & offline resizing as necessary.
To shrink a filesystem, the filesystem must be unmounted. First run resize2fs with a size argument (see "man resize2fs"). Then lvreduce the LV to match the new size. Beware: if you reduce the LV more than you reduced the filesystem, you will damage your data.
MK
- you can use letters k, M, G, T to identify the desired size. For example, to extend a LV to 100 gigabytes:
lvextend -L 100G /dev/vgSomething/lvolX
- or you can specify the amount to increase with a + sign. For example, to add 10 gigabytes:
lvextend -L +10G /dev/vgOther/lvolY
After the lvextend step is complete, the next step depends on your Linux distribution and version. For RedHat Enterprise Linux 4, the command is "ext2online /mountpoint".
(Don't worry about the "ext2": because ext3 = ext2 + journaling, the same filesystem tools apply for both ext2 and ext3.)
If the filesystem is created using an older version of Linux, it might not support online extension. In this case, unmount it and use "resize2fs /dev/vgSomething/lvolX".
To add the possibility for online extension, you can use "ext2prepare /dev/vgSomething/lvolX". This re-arranges the disk data so that the metadata areas can grow if necessary: the modern mke2fs command does this automatically when a filesystem is created, but the older versions did not.
For RedHat Enterprise Linux 5 (and probably other current Linux distributions), the functionality of ext2online is added to resize2fs. This one command can do both online & offline resizing as necessary.
To shrink a filesystem, the filesystem must be unmounted. First run resize2fs with a size argument (see "man resize2fs"). Then lvreduce the LV to match the new size. Beware: if you reduce the LV more than you reduced the filesystem, you will damage your data.
MK
MK
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP