LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 07-30-2007, 02:01 AM   #1
prixone
Member
 
Registered: Jul 2007
Posts: 35

Rep: Reputation: 15
Question Increase a new HD to the 1st HD Partition /home ?


hi,

i am planning to make a mailserver and was wondering what is the best option to add space to the main HD without losing data.

this is how the HD is today:
/boot - cant recall but not much 100mb something like that
/ - all the space left 740 GB
/swap - 2gb
if you have a better option to partition it let me know. There is nothing on the machine yet, i am just playing around with some options for now...

All the domains sit in /home. By default each domain can have up to 20 mailbox each one with 3GB of space so considering this i might run out of space pretty fast as we do have a lot of clients.

So i would like to know what would be the best option to increase my /home partition or the / with new HD's what steps should i know, how should i procced with this kinda of idea ...

i am using centOS 4.4 algo got 5.x.

Thanks in advance...
 
Old 07-30-2007, 08:25 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
First, don't use up the entire disk space unless you are really sure what the configuration is going to be. It is much easier to add partitions than to re-size them.

If nothing is on the machine, then just delete the existing partitions and setup the way you want. I recommend getting a bootable CD partition tool such as GParted. This also will re-size existing partitions.

Be sure to back up any important data before re-sizing a partition.
 
Old 07-30-2007, 11:47 AM   #3
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
Look at LVM. It will make your life much easier for tasks like this in the future. Right now, you'll need to add the hard drive, format it (possibly setup for LVM), copy the exisiting /home, and then mount as /home.
 
Old 07-30-2007, 03:13 PM   #4
prixone
Member
 
Registered: Jul 2007
Posts: 35

Original Poster
Rep: Reputation: 15
So in a short term i cannot just add a new HD to an already existent partition without having to backup and format it, then copy it back ?

i think i will have to change the way i will handle accounts then... like home, home2, home3, and so on...

thanks, i was also reading about LVM... but i was in doubt about this kinda of feature i wanted to acomplish...
 
Old 07-30-2007, 03:53 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by prixone
So in a short term i cannot just add a new HD to an already existent partition without having to backup and format it, then copy it back ?
A partition is a subset of a disk--you could think of it as a "zone". You can't add disks or partitions to each other. You can control how they work together using RAID or LVM.

You CAN add partitions (including ones on new drives) to the existing directory tree.
 
Old 07-30-2007, 04:47 PM   #6
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
LVM allows you to assign several partitions (physical volumes in LVM speak) into a single VolumeGroup. At any time, you can create logical volumes out of the space of this volume group and even extend logical volumes. Combined with a resizing-capable filesystem (I like jfs because it can resize while running, but ext3 works too) you can then add space as needed.

LVM was designed to allow you to add space when needed.
 
Old 07-30-2007, 05:38 PM   #7
prixone
Member
 
Registered: Jul 2007
Posts: 35

Original Poster
Rep: Reputation: 15
Thank you for the reply could you recommend me or give me some examples on how should i partition my HD in order to give the /home a way to grow with new HD's.

i was searching for LVM but i found many how-tos there were very advanced to what i was looking for.

i am running centos 4.x but can move to 5.x

Thank you in advance.
 
Old 07-30-2007, 06:07 PM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Only one partition can be meaningfully mounted to a directory (mount point). (Each mount hides the previous one).

You can't use multiple partitions/disks to expand the size of a single directory without using something like LVM.

You COULD make several sub-directories in /home and mount each one to a different partition. Kludgy, but completely feasible.
 
Old 07-30-2007, 11:24 PM   #9
prixone
Member
 
Registered: Jul 2007
Posts: 35

Original Poster
Rep: Reputation: 15
actually this is the last thing i am planning to go trhu:
/home, /home2, /home3 and so on.

This is setted as a last option right now because i already know i can acomplish it.

Matir thank for your explanation and to everyone that helped me out i found some good material regarding LVM on rhel web-site and from non-pratical i have came with those commands to acomplish my needs:
Quote:
[root@mw1 /]# pvcreate /dev/sda3
[root@mw1 /]# vgcreate mail_accounts /dev/sda3
[root@mw1 /]# vgchange -a y mail_accounts
# When i want to add a new HD perform
[root@mw1 /]# vgextend mail_accounts /dev/sdb
# Find out the full size
[root@mw1 /]# vgdisplay mail_accounts | grep "Total PE"
# xxx grep value
[root@mw1 /]# lvcreate -l xxx -naccounts mail_accounts /home
# So if i want more HD's to it:
[root@mw1 /]# vgextend mail_accounts /dev/sdb
# if i want to enable more space to it: (xx space value)
[root@mw1 /]# lvextend -LxxG /home
i did not tested it yet but would like to know if i am on the right path ?

i would like to be able to make / the grow partition adminitrated by the LVM because i am planning on having 2 things that will grow to such i do not know where it will stop. MySQL and the mailserver itself.

today i have my system installed like this:
Quote:
[root@mw1 /]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 239098048 1962608 224989900 1% /
/dev/sda1 101086 20159 75708 22% /boot
none 2074412 0 2074412 0% /dev/shm
[root@mw1 /]# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/1 / ext3 defaults 1 1
LABEL=/boot1 /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=SWAP-sda2 swap swap pri=0,defaults 0 0
/dev/hdb /media/cdrom auto pamconsole,exec,noauto,managed 0 0
it would be better for to re-install using LVM or it is fine to do it after it is already installed ?

should i change any of the partition table i am current using ?

thanks everyone.

Last edited by prixone; 07-30-2007 at 11:25 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Put a 2nd kanotix at hdb 3/,-4/home. 1st is at hdb8/,-9/home.#2 is using 1st's /home sleekmason Linux - General 3 12-09-2006 10:21 AM
increase space on /home partition v1nc3nt Linux - Newbie 1 10-11-2006 04:56 AM
Increase Partition Size shane200_ Linux - Hardware 1 08-24-2006 01:06 PM
how to increase the size of home partition srnerkar1 Linux - Software 1 12-05-2005 06:28 AM
I want to increase my Linux partition.Should I take space from a Windows partition? PrinceBalak Linux - General 1 06-25-2004 06:44 PM


All times are GMT -5. The time now is 02:23 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration