LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 07-11-2006, 11:06 PM   #1
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Rep: Reputation: 30
repartitioning /home


i partitioned my linux installation (RHEL) to /home, /var, /tmp, /, /boot, swap

recently my /home usage is getting higher. is it possible to repartition them and move "more space" from /var to /home?

Its on the same harddisk.

Thanks!
 
Old 07-11-2006, 11:45 PM   #2
tgo
Member
 
Registered: Dec 2004
Posts: 125

Rep: Reputation: 15
I at first thought you could put the big files on another partition then symlink to it from your home dir, but my friend say the best idea would be to

usermod -d /export/home/tgo tgo

and change your home directory completely.

Either way should work.
 
Old 07-12-2006, 03:43 AM   #3
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Original Poster
Rep: Reputation: 30
hmm but i have no other harddisk space.. and i have over-partitioned / actually (22GB!)

So not possible to just move space to /home?
 
Old 07-12-2006, 04:01 AM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
What's the actual layout (df -m), how much space would you like to shift?


Cheers,
Tink
 
Old 07-12-2006, 12:26 PM   #5
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Original Poster
Rep: Reputation: 30
Filesystem Size Used Avail Use% Mounted on
/dev/sda7 22G 1.6G 19G 8% /
/dev/sda1 99M 11M 83M 12% /boot
none 506M 0 506M 0% /dev/shm
/dev/sda2 29G 27G 450M 99% /home
/dev/sda5 2.0G 105M 1.8G 6% /tmp
/dev/sda3 20G 487M 18G 3% /var



I'm looking to move 10GB from / and maybe another 5GB from /var

possible?
 
Old 07-12-2006, 01:48 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Oh boy :) ... what filesystem are you using?

With a little luck you may be able to use a live-CD with
qparted to resize them; if that doesn't work, I'd go and
use a live CD, backup the smaller partitions to one of the
bigger ones, remove & recreate that backed-up partition on
the fly, mkfs, and untar stuff back into it (always being
aware of potential changes to fstab!)


In fact, it the qparted doesn't work I'd the following.
(I hope you have some means of backup ;})
back-up /var and /tmp to /
delete /var and /tmp
delete /home
recreate /home with the same starting sector
run resize2fs (resizefs.reiserfs) & pray
check whether that all went well
remove the fstab entries for /var and /tmp
mount /home from the live cd, copy the tar-balls
for var & tmp from /; ...


You get the idea ;}



Cheers,
Tink
 
Old 07-12-2006, 01:58 PM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
This partitioning scheme is way too complicated for my tastes.

The easy way to add more space would be to install another HD and mount it at /home

The gparted live CD---for one--will resize partitions.

Backup everything before doing anything else.
 
Old 07-12-2006, 02:46 PM   #8
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda7              22G  1.6G   19G   8% /
/dev/sda1              99M   11M   83M  12% /boot
none                  506M     0  506M   0% /dev/shm
/dev/sda2              29G   27G  450M  99% /home
/dev/sda5             2.0G  105M  1.8G   6% /tmp
/dev/sda3              20G  487M   18G   3% /var
How did you come up with these initial partition sizes? I ask only because it appears you used some fairly poor estimates of filesystem sizes initially. Re-doing these partition sizes to something more in line with your actual usage patterns will not be trivial, given the fact you really need to backup things before doing any resizing.

Consider: Do you really need to partition? Or could you get by with one big / partition that holds everything? If you determine you need to partition, consider why you might have left /usr out of your partitioning scheme above. Was its omission purposeful or accidental? Given you've pulled /tmp, /var, and /boot out to seperate partitions I would have expected to see /usr on a seperate partition as well (that's fairly standard). Also /opt, but that one is of less importance on many systems. Also consider the use of LVM if you decide you need to partition, but really don't know how big each partition should be on your system. Resizing hard partitions when they contain data is just ... yeuch! You won't want to do it very often (preferrably never). The potential of screwing things up and losing data should not be taken lightly.
 
Old 07-12-2006, 11:07 PM   #9
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Original Poster
Rep: Reputation: 30
hmmm i'm really quite a noob when it comes to this.. but i am all ears to learn more new things

I have been given that recommendation for partitioning since i started working...
its mainly for web servers.

All our files are put in /home (thus the size requirement)
/var holds our logs and dB

we dont' use /usr thus not there... what is it for...?

Actually though I have been given this set of partitioning values, I have been thinking.. despite partitioning, its all in the same harddisk. Does it matter or have any benefits at all?

i actually am ready to reinstall the OS (RHEL) and re-parition.. but thought i ask you guys first

and I am using ext3
 
Old 07-13-2006, 12:49 AM   #10
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by Swakoo
... I have been thinking.. despite partitioning, its all in the same harddisk. Does it matter or have any benefits at all?
Partitioning offers many benefits. But they may not be needed for a home desktop system. For a multi-user server ... definitely.

Partitioning can add security, robustness, flexibility, and performance to name a few. But at the cost of complexity.

Example 1: You have a server with many users. A not-so-bright user writes a program that goes into an endless loop and keeps appending to a gigantic file it creates in /tmp. If everything is on one big / partition, your server will probably come crashing down when the dumb user's program consumes all available disk space. However, if /tmp was on a seperate partition it would still fill up, but ONLY /tmp, and your server would stay up and running (maybe hobbled ... but running). This improves robustness.

Example 2: /usr shouldn't change except when you install certain new programs. So put it on a seperate partition and mount it readonly during normal times. You won't accidently modify /usr, and a malicious cracker will have a harder time doing so. This improves security and robustness.

Example 3: You have lots of personal stuff under /home. You want to change distros from SuSE to Debian. If /home is a seperate partition you can easily install the new distro and then mount your old /home ... unaffected by the distro switch. This increases flexibility.

Example 4: You want to use Reiser for your OS filesystems, but XFS for your filesystem that holds huge video files (for performance reasons). You can't do this if everything is on one big / partition. This increases flexibility and performance.

There are many more examples of how partitioning helps, but you get the idea. But with the added benefits comes the added complexity of setting up and mounting different partitions. These benefits may be of minor importance on a home system, and the complexity of administration unwarranted. For a server, I can't imagine NOT partitioning, and using LVM on top of that. Even my home system is partitioned and LVM-ed out the ying-yang, but for me the maintenance does not represent added complexity. It's just second nature and I don't think twice about it.
 
Old 07-13-2006, 03:19 AM   #11
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Original Poster
Rep: Reputation: 30
wow... but what's the recommended partition then?

I'm running on hardware RAID, still a need to use LVM?
 
Old 07-13-2006, 04:32 AM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
lvm doesn't give you redundancy or performance, it gives you
just flexibility. Basically I think that it's still a good
idea to e.g. separate /home, /var and /tmp onto distinct
partitions, just because it makes it harder to harm the machine
by filling up disk as a normal user. What lvm does is it gives
you the flexibility to change "partition" sizes on the fly.


Cheers,
Tink
 
Old 07-13-2006, 04:43 PM   #13
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Tinkster
lvm doesn't give you redundancy or performance, it gives you
just flexibility. Basically I think that it's still a good
idea to e.g. separate /home, /var and /tmp onto distinct
partitions, just because it makes it harder to harm the machine
by filling up disk as a normal user. What lvm does is it gives
you the flexibility to change "partition" sizes on the fly.


Cheers,
Tink
It does? I thought LVM is just for doing 'software-raid'? so in a single harddisk environment/ harddisk-raid environment,

I can still use LVM, and it will aloow me to change partition...??
 
Old 07-13-2006, 05:18 PM   #14
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
LVM has nothing to do with RAID. LVM stands for "Logical Volume Management". Here's a symopisis of what it can do for you: http://tldp.org/HOWTO/LVM-HOWTO/benefitsoflvmsmall.html

And here's the entire "LVM HowTo" (the above link is part of this document): http://tldp.org/HOWTO/LVM-HOWTO/

[edit]
Ok, I was just rereading this thread and I just HAVE to fix my above typo. "symopisis"? What kind of word is that?! Yes, I know how to spell "synopsis". I just can't TYPE it!
[/edit]

Last edited by haertig; 07-15-2006 at 12:13 AM.
 
Old 07-14-2006, 07:06 PM   #15
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
try the gparted live cd. It let's you allowcate space from one partition to another. very much like partitionmagick for windows.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
repartitioning metalsam Linux - Software 5 07-02-2006 05:39 PM
Repartitioning King4lex Linux - Newbie 4 09-02-2004 06:15 PM
help with repartitioning JunLitsu Linux - Software 6 06-24-2003 05:10 PM
repartitioning of linux space from /home to /usr prpsarathy435 Linux - General 0 08-24-2002 10:51 PM
Repartitioning Lazlo Linux - General 3 12-11-2001 02:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration