LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Increase a new HD to the 1st HD Partition /home ? (https://www.linuxquestions.org/questions/linux-server-73/increase-a-new-hd-to-the-1st-hd-partition-home-573286/)

prixone 07-30-2007 01:01 AM

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...

pixellany 07-30-2007 07:25 AM

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.

Matir 07-30-2007 10:47 AM

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.

prixone 07-30-2007 02:13 PM

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...

pixellany 07-30-2007 02:53 PM

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.

Matir 07-30-2007 03:47 PM

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.

prixone 07-30-2007 04:38 PM

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.

pixellany 07-30-2007 05:07 PM

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.

prixone 07-30-2007 10:24 PM

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.


All times are GMT -5. The time now is 08:12 AM.