Adding Disk Space to a Full Root Filesystem
This document (7009620) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 10
SUSE Linux Enterprise Server 11
SUSE Linux Enterprise Desktop 10
SUSE Linux Enterprise Desktop 11
Situation
Resolution
The easiest way to free up space on the filesystem do the following:
1. Remove any unnecessary files. /tmp and /var are good places to start.
2. Add another disk to the server, and mount it in place of a directory that is heavily used on the full filesystem. This is a post-installation repartitioning method.
Scenario:
/dev/sda1 swap
/dev/sda2 / (root) - This is the filesystem that is full.
In this case the /var directory is taking up too much space. We want to move /var to a new disk and free up the space on root so the system will function properly.
# cat /etc/fstab
/dev/sda1 swap swap defaults 0 0
/dev/sda2 / ext3 acl,user_xattr 1 1
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 19G 19G 0 100% /
Post-Installation Repartitioning Procedure
1. Add a disk to the server
2. Boot into rescue mode.
3. Partition the new disk and format a filesystem on the partition. For example, mke2fs -j /dev/sdb1
3. mount /dev/sda1 /mnt (The location of the existing /var)
4. mount /dev/sdb1 /media (The location of the new /var)
5. cp -a /mnt/var/* /media/ (Copies all files from the old /var to the new /var on /dev/sdb1)
6. rm -rf /mnt/var/* (Frees up the space on root, converting /var to an empty mount point)
7. You now need to edit the /mnt/etc/fstab file and add an entry for /dev/sdb1 /var so it gets mounted on boot.
# cat /mnt/etc/fstab
/dev/sda1 swap swap defaults 0 0
/dev/sda2 / ext3 acl,user_xattr 1 1
/dev/sdb1 /var ext3 acl,user_xattr 1 2
8. Reboot normally.
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 19G 3.3G 15G 19% /
/dev/sdb1 20G 16G 3.2G 84% /var
Additional Information
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:7009620
- Creation Date: 24-Oct-2011
- Modified Date:03-Mar-2020
-
- SUSE Linux Enterprise Desktop
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback@suse.com