partition problems!

Hey,

haha i'm back! Just when i thought everythign was working fine and dandy i found out that i screwed up my partitions way back when i set teh computer up like 5 months ago...lol. SO! I have decided to format....jus tcause this is my learning computer and install RH9 or whatever the latest version of it is. This brings me to my first problem! haha how do i format 2 linux drives! hda1 and hdb1? After i do that would i jsut download linux 9x and burn it to a cd to install it? haha thanks and happy easter!

It's probably easiest to do it during the install. Burn the isos to CD, start the install, and either select auto partition, disk druid (my preference), or fdisk. If you currently have linux working on the system, 'dmesg | grep hd' will list the ide drives, 'dmesg |grep ida' will show the drives if you have a proliant box, and 'dmesg |grep sd' will show the SCSI drives. You can then use fdisk to partition them and mkfs or mke2fs to format them. However, during the install you will have to redo much of this anyway because the installer will not know which partition is for which mount point. Bottom line, just do it during the install.

Normal! You can use PQMagic to Creat a New Partion. With RH9, Wizard will help you creat partion for Linux (Ext2, Ext3, Swap....). To run RH9, you need have 4 GB HD for 2 partion of Linux:

  • Ext2 or Ext3 (Partion Data of Linux)
  • Swap (Partion Virtual Memory of Linux).

It's very simple.

Or you can do this work by command:

To creat ext2 partion:

mke2fs -c <partion> <size>

To creat swap partion:

mkswap -c <partion> <size>

Good Luck

oh ok haha great thanks, just one more question haha. What kind of partition is supposed to be small so the boot sequence or somthing can be written to it?

I think you are talking about /boot. I typically make this 512 MB which is overkill but I like to have room to play. This just stores the basic boot stuff. On some systems if /boot (or / if you didn't create a seperate /boot partition) is over 4 GB the system will not boot. It's a bios thing. With a small /boot you could create a huge / and not have to worry about boot problems. I usually use ext3 but ext2 works just fine as well.

[root@linksys /root]# fdisk /dev/hdb

The number of cylinders for this disk is set to 38792.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): 2
2: unknown command
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): p

Disk /dev/hdb: 16 heads, 63 sectors, 38792 cylinders
Units = cylinders of 1008 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 4161 2097112+ 82 Linux swap

Command (m for help):
--------------------------------------------

So haha this is the partition table for my hdb so this is saying that i've only got 4 gigs in use and the rest is going to waste, right? How could i make this so i could use the rest of this hard drive?

Your answer is in your post. Go into fdisk and type "n" to create a new parition. It will prompt you for the info. After the prompts are done, type "w" to save and exit. Now run "mke2fs /dev/hdb2" followed by "mount /dev/hdb2 /somedir".

huh? lol i did all that and when i try to mount hdb2 it says it can't find it...lol. I don't know why though. It said it was created and everything else, i don't know whats up with it. Thanks for all your help though, do you have any sudgestion? lol it's exam time and i'm so so busy with things i don't have alot of time to read manuals to figure it all out...lol sorry.

Can you post your mount command and the exact error?

omg haha i'm so so stuipd i'm sorry ...lol it was my fault, i was specifying hdb1 instead of hdb2, exams make me crazy...lol. I wondered though, I'm not the best with fdisk, how would i use the rest of my hd on a partition? i made a new one but i can't make it for the whole hard drive.

You can use fdisk to create a parition the size of you entire disk if that is what you want to do. Infact, it is the default if you create a new parition. If you just hit enter the new partition will be from the end of the previous one until the end of the disk. If you don't have a previous one, it is the entire disk.

If you have 4 paritions, you will have to create an extended partition. This can't directly be used. You have to create a logical parition on top of it. Kind of hard to explain without drawing pictures, but I am sure you can find plenty of explanations on the web and it will eventually make sense.

believe it or not i get what you mean .... lol haha great thanks, i've got only one more question for this topic! lol can you believe it! If i have two partitions and i delete partition one can i edit the second one to take up the space of the first one? or would it just be all lost? I really appreacate all the help, i've never been a wiz with partitions...lol i always messed them up somehow.

You can only do that 2 ways:

  1. Use LVM. In this case you still have to partitions but you can add them to one volume group and create 1 logical volume from it.

  2. Backup everything on partition 2. Blow away partition 1 and 2. Create a new partition using all the space. Restore the data from partition 2.

If you go into fdisk you will see there is no way to expand partition 2. You can create a new partition with the space from partition 1.

Just for added info. Lets say you have partition 1-3 and have extra space at the end of the disk. If you delete partition 1 you cannot create a larger partition using the space from partition 1 and the space at the end of the disk. The space must be sequential to create a partition in fdisk.

shit haha thats what i though! boo oh well haha i'll ahve to wait cuas ei've got nothing to back it all up on but thanks! lol i'll do that when i get my new computer! Thanks for the extra info to man kida straightens things out for me haha.

To know information about HD, you can use flag "-l", as:

root@linksys /root]# fdisk -l /dev/hdb

You will have information about HD: hdb1, hdb2...etc

Good Luck

greta thanks! lol that saves me alot of time, i was always going into fdisk to see that information.