- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- How to shrink a root filesystem?
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
08-08-2006 03:23 AM
08-08-2006 03:23 AM
Shouldn't be that hard - create the new directories, copy the files over, and mount them. But the lvol that / is mounted on takes up the whole volgroup right now. I'd like to shrink the filesystem, then shrink the lvol, so that I'll have room to create new directories. Is this possible? I can't seem to find anything about shrinking an ext3 filesystem while it's mounted.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2006 03:35 AM
08-08-2006 03:35 AM
Re: How to shrink a root filesystem?
You are best advised to reinstall the operating system. reducing root at this point will take multiple steps as you reduce, create a new filesystem and attempt to move stuff.
Soft links will get broken and you really will have a lot of trouble with this.
It is possible, but I think you will need to dismount it.
My suggestion would be to boot off a knoppix or Centos Live CD and use parted to change partition sizes.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2006 03:43 AM
08-08-2006 03:43 AM
Re: How to shrink a root filesystem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2006 04:32 AM
08-08-2006 04:32 AM
Re: How to shrink a root filesystem?
so to reduce, the file system must be unmounted.
Regards,
Ziad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2006 08:41 AM
08-08-2006 08:41 AM
Re: How to shrink a root filesystem?
Reload the OS if you really need to reclaim some space.
If you can live with - good. I never have a problem with a root filesystem that is too big. (within reason, of course)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2006 10:57 AM
08-08-2006 10:57 AM
SolutionMy suggestion : boot on a live CD or a SuSE install CD in rescue mode, then :
0. light a candle and pray :-)
1. fsck the filesystem offline
2. shrink the filesystem offline, using ex2resize for example
3. shrink the lvol size accordingly
4. fsck the filesystem again to make sure
5. light another candle and pray again
6. reboot
Good lcuk.
Kodjo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2006 08:28 PM
08-08-2006 08:28 PM
Re: How to shrink a root filesystem?
In addition to everyone's comments on shrinkage, etc., I thought I would add a few words about LVM (well, more accurately, splitting up a *nix directory structure into individual partitions/logical volumes)...
You commented that you'd like to rearrange the disk layout to use separate logical volumes for /var, /tmp, /usr, and so on, a la HP-UX:
I thought of doing this a while ago - my first *serious* play with Unix was HP-UX, so it followed that when plying with Linux, I'd like to have a similar disk structure.
Having gone through a lot of pain, I recommend you think long and hard about why you want to use LVM to split the directory structure. It adds an extra layer of complexity to your installation, and can give you lots of headaches if you later decide to change your layout. It is a lot harder to remove LVs and increase sizes, etc. than it is to have one big / partition.
Of course, this depends on what use your Linux system is for (server, workstation, home PC), how many disks you have, etc..
One big *disadvantage* of breaking out the different disk areas into separate LVs (or partitions for that matter) is that if you get your sizing wrong, you're left with an inflexible directory structure. For example, you underestimate how much space you need in /usr and it fills up. If it is a separate LV then you have to resize. If it is simply a part of / then you're happy until / fills up!
Partitions I try to stick to these days are a:
/
/home
This way, user files are safely away from the OS (easier to update/reinstall/change the OS), while the OS itself uses as much space as it needs across the directory structure.
Best regards,
Andy Bruce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2006 08:30 PM
08-08-2006 08:30 PM
Re: How to shrink a root filesystem?
Don't forget to hand out points - it's our reason to be here!
A.
ps No points for this particular post though! ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2006 04:41 AM
08-09-2006 04:41 AM
Re: How to shrink a root filesystem?
Kodjo had pretty much the answer I expected - boot some other bootable media, then adjust the filesystem while it's unmounted. I just haven't yet found bootable media for ia64 which will give me a shell with all the tools. There seem to be a lot of rescue CDs and Live CDs out there, but none that I've found that work on ia64.
Andrew had some excellent insight into the "whys" of the problem, and I think that's the final answer to the question. I come from the HP-UX world, and on HP-UX it's trivial to resize filesystems and logical volumes. This is precisely the argument in favor of splitting up the filesystems - you don't have to worry about someone filling /tmp and bringing the system down, and if you get corruption in /var you can umount it and fsck it easily. And if you later find out that /home is too big or /opt is too small you just resize them. It sounds like Linux doesn't yet have the ability to dynamically resize filesystems and logical volumes, so it looks like I'm better off keeping it the way it is.
Thanks to everyone for the help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2006 05:08 AM
08-09-2006 05:08 AM
Re: How to shrink a root filesystem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2006 05:22 AM
08-09-2006 05:22 AM
Re: How to shrink a root filesystem?
A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2006 05:24 AM
08-09-2006 05:24 AM