Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My root partition became full. I had to login to command line and move some directories from my home directory to a different partition. Once the move was complete I was able to login and start up the GUI.
This is the second time this has happened to me. The first time this happened I copied a very large file into the root partition. Now that it has happened a second time I would like to take some measures to prevent it from happening again. So, I have a couple questions about the root partition and the /home directory location.
When I first installed Ubuntu 10.04, I set the root partition size to 20GB. I figured that should be plenty of room for the OS only. But the /home directory seems to cause a bit a a problem. Is my assumption correct that the /home directory is part of the root partition? My user directory is always changing sizes (usually growing). Is there a way to move the /home/user directory outside the root partition while still allowing applications to access their needed information?
When I first installed Ubuntu 10.04, I set the root partition size to 20GB.
in my Ubuntu and Mint installations, I typically made the root partition 16GB. But I always have another partition where I'm working on, and use the /home directory only for configuration data that is stored there without asking me.
Quote:
Originally Posted by kern68
Is my assumption correct that the /home directory is part of the root partition?
If you didn't put it on another partition explicitly, yes.
Quote:
Originally Posted by kern68
Is there a way to move the /home/user directory outside the root partition while still allowing applications to access their needed information?
Yes, that's no problem. You can either relocate one user's home directory - this is done in user and group management. Make sure you copy your entire home directory to the new location, including all hidden files. Only then go into user management and assign yourself the new home directory.
Alternatively, you can relocate the entire /home directory. That way, you don't have to change the user configuration, because all paths remain the same. But you have to reserve an entire partition for /home, and assign that in /etc/fstab.
Someone told me you could also create a symlink called /home in the root directory that points to wherever you want the home directories. But I've never tried that method, so don't take that as a recommendation.
I guess you're better off with the first method, because it's more flexible - you can put the new home directory anywhere you like.
It is not at all difficult to dedicate an entire partition for /home after installing Linux. This involves these steps:
a) decide the size of the new /home partition
b) create and format the partition. gparted can be very handy in this case.
c) mount the new partition on /mnt
d) copy all the files in /home to the new partition
Code:
# cp -a /home/* /mnt
e) edit /etc/fstab to reflect the change. The following settings can be used:
Code:
# /home was on /dev/sda6 during installation
UUID=the_new_partition_uuid /home ext4 defaults,noatime 0 2
f) leave /home in the root partition.
In my case, I used ext4, your's may be different. You can get the uuid for the partition by using gparted's properties context menu.
You can remove all files if you wish but you can keep the hidden files as a backup. These will be hidden from the system when Linux boots with the new configuration and the new partition will be used.
P.S.
You can still gain more space in your root partition by deleting .deb archives which are found under:
Code:
/var/cache/apt/archives
Code:
# rm /var/cache/apt/archives/*.deb
Last edited by edbarx; 02-27-2012 at 02:57 AM.
Reason: To add more details
It is not at all difficult to dedicate an entire partition for /home after installing Linux.
whether it's difficult, depends on your level of experience. ;-)
Anyway, this way you can't blend the /home directory into an existing hierarchy. It will be a partition of its own with nothing else but /home on it. You can see that as an advantage (clear structures, separation of user data), but it also reduces your flexibility of choice of where to put the /home directory.
Quote:
Originally Posted by edbarx
This involves these steps:
a) decide the size of the new /home partition
b) create and format the partition. gparted can be very handy in this case.
c) mount the new partition on /mnt
d) copy all the files in /home to the new partition
Code:
# cp -a /home/* /mnt
e) edit /etc/fstab to reflect the change.
Needless to say that you have to do these steps while being root.
Quote:
Originally Posted by edbarx
You can get the uuid for the partition by using gparted's properties context menu.
You can also use the "traditional" device names, like /dev/sda5. I'm more comfortable with them than with GUIDs, because you can clearly amd easily deduct them from the partitioning scheme - and vice versa, you can tell immediately where a partition resides if you use traditional identifiers.
There is no problem in doing the move as 'edbaedx' presented. In fact it is best to let the system know the partition ID via 'uuid'. You can use tools to discern/locate the 'dev' if you require explicit human identification or just include a comment within '/etc/fstab' to note things.
Most system professionals will use the 'UUID' since future changes are likely to occur and that the possibilities of sharing across systems;
DESCRIPTION
The UUID library is used to generate unique identifiers for objects that may be accessible beyond the local sys-
tem. This library generates UUIDs compatible with those created by the Open Software Foundation (OSF) Distributed
Computing Environment (DCE) utility uuidgen.
The UUIDs generated by this library can be reasonably expected to be unique within a system, and unique across all
systems. They could be used, for instance, to generate unique HTTP cookies across multiple web servers without
communication between the servers, and without fear of a name clash.
SOHO users may not see/need the advantages or that the unique identifier is a better way of doing things.
Last edited by onebuck; 02-27-2012 at 08:33 PM.
Reason: typo my big mitts
I copied my home directory to a different partition. This partition was already listed in /etc/fstab, so no changes needed there. I did modify /etc/passwd to reflect the new location.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.