LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 04-30-2007, 06:00 PM   #1
Tina07
LQ Newbie
 
Registered: Apr 2007
Posts: 4

Rep: Reputation: 0
Partitioning disk for Red Hat Linux Enterprise 4.0


I am installing the Red Hat Linux Enterprise 4.0 OS on servers with 2x71GB hard disks. I think it is bettet to manually partition the hard disk. I have no much experience in Linux. Can someboday please help me out how to partition the two disks?
Also, is it easy to repartition if I do the auto-partition? Thanks in advance.
 
Old 05-01-2007, 02:08 AM   #2
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
My personal preference would be to combine both drives in to either a single RAID volume, or use LVM to make it one volume, then divide that 142gb like this:

/ 30gb
<swap> 2gb
/boot 256mb (more if you plan on having more than a few kernels)
/var 4gb
/tmp 4gb
/home <remainder>

Some people will suggest you reduce the / partition and create a separate /usr partition if you intend to install a lot of your own programs... I find that 30gb all in / works pretty well
 
Old 05-02-2007, 11:23 PM   #3
Tina07
LQ Newbie
 
Registered: Apr 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Thank you very much. I will use this server to install the Oracle 10. I think I should create a seperate mount point and assign disk to it, is it correct?

If i want to assign disk to /usr, how big it should be?
Also, I don't have big group here about 20 people. Any suggestion?
 
Old 05-03-2007, 01:26 AM   #4
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
Not sure about how big to make /usr

Having a look at one of my servers (configured as my previous post), I have a 20gb partition for / including /usr

The whole / partition is using 3.7g and of that 2.8g is in /usr

Looking at that ratio, maybe 2/3 to /usr and 1/3 to /

ie:
10gb - /
20gb - /usr
 
Old 05-03-2007, 03:02 AM   #5
rcase5
Member
 
Registered: Apr 2004
Distribution: Fedora & Debian
Posts: 38

Rep: Reputation: 15
A slightly different take (and repartitioning)

Ask a group of geeks the same question and they'll all give you a different answer.

I mostly agree with fukawi2's configuration. I used to have a separate /usr partition standard on all my systems, but I found it to be unnecessary, and letting it go into / is fine. The main reason I no longer use a /usr partition is that it could potentially handcuff me if I install a lot of applications that use /usr. Same goes if I install other applications if it puts itself under /. If I run out of space on one partition or the other, it could turn out to be a real headache. And while it is possible to repartition your system after you initially partition (to quickly answer one of your other questions, and I'll expand later in case you're interested), you have to be really careful when you do that, or you could shoot yourself in the proverbial foot.

The only change I would make to fukawi2's configuration is to leave the two drive separate, and put /, /boot, /var, /tmp, and <swap> on the first drive, and then make the second drive /home. I do this on all of my systems and I can't tell you how many times it has saved my neck, and how much time it saves me. If something gets screwed up on the first drive, all you have to do is reinstall, and chances are you (or your other users) will not notice anything different afterwards, since all user specific data is on /home, and /home will be unaffected. You don't even have to backup if you don't want to (or can't if your system is in a really bad way), but it is always a good idea to do so when you can. Just make sure you leave that second drive alone when you reinstall.

As for repartitioning after initial install, the secret is to put all of your system stuff onto another drive (another point for keeping the two drives separate). I've done this many times, and while it's a little like doing major construction on your house while you're still living in it, it is possible. You don't even have to reboot. The only partition you cannot touch is /boot, but I believe automatic partitioning allocates 100MB of space for /boot. You don't really need much more than that, and out of 71GB, 100MB is not that much.

The thing to remember is that, while you're reorganizing your partitions, the second drive will be /, so you must first prepare the second drive for that role. While you're going all this, you'll have to be "root" of course. Here are the steps I follow (this is all assuming your second drive is mounted as /home):
1. Create a directory under /home called "home".
2. Copy the contents of /home to /home/home. It should skip /home/home itself, and it will probably warn you about that, but that's okay.
3. After you verify all of your home directories were successfully copied, copy everything from / to /home except /dev, /sys, /proc, /boot, /lost+found and /home (of course).
4. Go to /home/bin. Type "./umount /". If it refuses to unmount "/", you probably have a service or a user accessing "/". Kill any processes that might be using "/" and make sure any users are not in "/". Since you might have logged in as yourself and then used "su -" or "sudo su -" to become root, you might want to drop back to your user account and make sure your cwd is your home directory (cd ~).
5. After you have successfully unmounted "/", then type "./mount /dev/hdb1 /". Substitute "/dev/hdb1" with whatever your /home partition is. This will mount your /home partition as /.
6. If you start out with automatic partitioning, you can skip this step, because automatic partitioning only creates /, /boot, and a swap space. Otherwise, unmount all other partitions on your system except /boot and /. (You can leave /home alone as well).
7. If you plan on changing your swap space, type "swapoff".
8. You can now repartition your first drive. There are several tools available, and you should find the one you are most comfortable with. Common tools are "parted", "fdisk" and "sfdisk".
9. After repartitioning, format the new partitions. The command to do this is called "mkfs".
10. Now you have to copy your / back to the partition that will be your new /. But you have to temporarily mount it somewhere else to do this. Create a new directory somewhere and call it "tempmount". Mount your new / partition to "tempmount".
11. Mount the remainder of your new partitions to their appropriate mount points.
12. Copy all of your current / stuff to "tempmount". This would be everything except the stuff you created new partitions for, plus everything else you didn't copy before (/dev, /sys, etc.).
13. Change your cwd to /home/bin.
14. Type "./umount /".
15. Type "./mount /dev/hda6 /". Substitute /dev/hda6 to the actual partition specification for your new / partition.
16. Change directory to "/" (cd /), and make sure it looks like all of your / stuff is there.
17. Unmount "tempmount".
18. Copy all of the other stuff to the other partitions from /home. (So copy /home/var to /var, /home/tmp to /tmp, etc.).
19. Clean up all of the directories in /home.

It has been a while since I've done this, so I may have left some things out. I would try some of the mount/unmount commands first before you make any actual changes to your partitions. But the above looks about right.

Robert...
 
Old 05-03-2007, 03:08 AM   #6
rcase5
Member
 
Registered: Apr 2004
Distribution: Fedora & Debian
Posts: 38

Rep: Reputation: 15
Oh, one more thing...

The spirit of the partition scheme I use is that all perishable data is on the second drive, and all of the system stuff is on the first drive.

If I were you, I would make Oracle use the second drive as it's database store. I've never actually installed Oracle before, but I imagine you can specify the place where Oracle puts the database tables. I would put it under /home/oracle, or something like that. The software portion of Oracle can go on /. Again, if things go south on the first drive, all of your data will still be intact on the second drive.

Hope this helps,

Robert...
 
Old 05-07-2007, 09:34 PM   #7
Tina07
LQ Newbie
 
Registered: Apr 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Thank you very much for all your information and advice.

I have more questions when I am partitioning the hard disk.

1)The document says: In Linux, you can have a maximum of four primary partitions. If you need more than four partitions, give away on primary parition to create an extended partition.

I don't know how to create an extended partition on a primary partition. For example, i want to create several partitions for mount point like: /root, /tmp, /opt/, /usr, /home, etc. Acoording to this documation, I only can create 4 partition for four of them, then extend one of them, correct? how do I do that? Thanks.


2) In order for me to create a VG I have to create PVs first. In my case, if i want to combine the two disks, how many VG I need to create, only one or two? If it is only one, the size will be 143GB? Then I need to create all PVs o make up this VG? Any advice? Tnanks for your help again!
 
Old 05-07-2007, 09:51 PM   #8
Tina07
LQ Newbie
 
Registered: Apr 2007
Posts: 4

Original Poster
Rep: Reputation: 0
One more question: When I partition the disk, do I have to use LVM or just simply add disk to a mount point. Thanks.
 
Old 05-08-2007, 12:45 AM   #9
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
I'm not fully across LVM so I may get this wrong:
- Physical Volumes are effectively your 2 drives (so you will need 2 of them, 1 on each drive)
- Logical Groups are the combination of multiple PV's (so you will have 1, containing your 2 PV's)

Partitions are then created in the VG, and the LVM handles how to spread them across the drives and PV's

If you want more than 4 partitions on a drive, you need to create THREE primary partitions, then an extended partition (the size of the remaining space), then you create logical partitions inside the extended partition.

Example (I hope this makes sense)...
Code:
------------------------------------------
|
| Partition 1 (Primary)
|
------------------------------------------
|
| Partition 2 (Primary)
|
------------------------------------------
|
| Partition 3 (Primary)
|
------------------------------------------
|                         |
|                         | Partition 5 (Logical)
|                         |
| Partition 4 (Extended)  -
|                         |
|                         | Partition 6 (Logical)
|                         |
------------------------------------------

Last edited by fukawi2; 05-08-2007 at 12:46 AM.
 
  


Reply

Tags
disk, hard, install, partition



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
LXer: Red Hat to launch Red Hat Enterprise Linux 5 before March LXer Syndicated Linux News 0 12-30-2006 08:03 AM
Project made in Red Hat Enterprise 4 need to be able to run on Red Hat Enterprise 3 Elin Linux - Software 1 07-13-2006 12:22 PM
Red Hat Enterprise Linux WS 3 Installation from hard disk maya2k2pk Linux - Distributions 0 09-17-2005 05:45 PM
Red Hat Enterprise vs. Red Hat Linux Project RedHatMN Linux - Distributions 2 07-29-2003 04:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:47 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