Partitioning disk for Red Hat Linux Enterprise 4.0
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
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.
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
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?
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.
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.
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!
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.