Mortgage | Mortgage Insurance | Myspace Layouts | Bad Credit Loan | Rolex
adding a new linux partition [Archive] - PCMech Forums

PDA

View Full Version : adding a new linux partition


minutrice
05-29-2002, 03:40 AM
Ok I have a 10gig hd in this computer and left about 4.5 gigs of free space just incase I decided to do a dualboot with windows. Well I don't think I will do that so I want to make that 4.5 gigs more space in linux.

I went to konsole and typed fdisk /dev/hda.
Then I typed print and it showed 3 partitions
Next I n for add a new partition and when prompted I put e for extended and it asked for the partition number and I told it 4. Is this right? Should it have been a primary? Now how do I access that partition. What would it be called or how do I name it. I still don't know crap about the linux filesystem so I'm pretty lost.

Thanks,

Josh

MaXimum SMOKE
05-29-2002, 06:40 PM
Numerically, nonprimary partitions start with 5, There are 1-4 partition numbers for primary partitions. So like a typical thing might be hda1 = /boot ( a primary bootable partition) hda5 might be swap (a non primary partition type linux swap) hda6 might be / (the root file system). Note when you start creating nonprimary parts, hda5 and up, hda2 should automatically get created as an extended (shall we say 'envelope', that would encompass all of the space used by your nonprimary partitions. I try not to call nonprimary partitions (extended) an extended partition is I think, type 5, whereas a nonprimary partition typed for ext3 linux, may be type 83. I hope this clarifies, more than it confuses. The worst thing for me is keeping track of the start/stops of partitions with those cylinder numbers, Good luck

minutrice
05-30-2002, 04:56 PM
anyone else have anymore info? After creating the partition what do you have to do?

Josh

MaXimum SMOKE
05-31-2002, 10:17 PM
?(anyone else) ?!? (Josh, I'm shocked ;) )

Make sure you typed the partition correct for linux (using the t command in fdisk to a linux native partition like an EXT3 . The program will offer to show you a list of partition type numbers (probably be the l (small L) command and their types. After you exit the fdisk for linux, then you have to format the partition. In linux it is the command
mkfs think make filesystem, I'm going to make you read the procedure, so you don't accidentally format the wrong partition, ok? In a terminal type man mkfs that will give you the manual for the command mkfs. Its pretty easy, but it is every bit as dangerous as the word format on a dos/windows computer. Just about everything in a unix file system is a file, so create a directory where you want to mount this new file system call it what you want like say downloads if this was off the main root file system ( / ) you would now have /downloads (an empty directory) Now we have to mount your new physical partition to the new directory SOOOO... If your new partition was /dev/hda7 You open a terminal and type
mount /dev/hda7 /downloads OK, you are mounted. (manually we have to configure the computer to automount the partition every time you boot, or you would have to issue this command every time you boot.) I'll get to that, but are you with me so far??

minutrice
06-01-2002, 04:38 AM
ok I did all of what you said and now I have /downloads mounted, but when I tell it to make an extended partition it asks for a number 1-4. So I just did a primary partition and did 4 b/c there was not a /dev/hda4. Should I put extended partition and select 2? Then will it prompt me for a 5-? If so I'll just go back and delete the partition and start over. If everything is ok I have it mounted but I need to know how to mount it everytime the computer reboots. You've been a bunch of help.

Thanks alot,

Josh

MaXimum SMOKE
06-01-2002, 12:06 PM
Josh, if you have a linux type partition and have it mounted and can access it, You've got 90% of it. I'd go to the part about getting it to auto mount from here. This part I'll include just in case you want to know about disk structure. Most people don't even know they can have up to 4 primary partitions. Unless I'm putting 2 OSes on the very same disk, I only create 1 primary partition period. You can create a whole bunch of non primary partitions and everything will work o.k. The disk partitioning program will be more than happy to create that type 5 partition, (as long as it has a primary left to work with and let it encompass all those other partitions). The other thing is that your partition can be mounted almost anywhere in the file system as long as you create an empty directory there. (The style of Unix) Just make sure that if you want your non-root user to be able to get in and out and read and write files there, you give them permission to do so. By the way a lot of people start building those directories, inside the mnt directory, thats why you'll probably find the directory for your floppy, cdroms, and windows partitions, there depending upon what distro you have, and what tool you used to do the original install. The beauty of having a partition that isn't a key part of the operating system, is that you don't have to reformat that one, if you want to switch OSes do a clean install. (Personally I mount my windows partition move all my 'took forever to download files' there, before I do a linux os change for the same reason, then move them back ;) ) Since there are a bunch of variants of disk partitioning programs fdisk, cfdisk, diskdrake, how they ask their questions kind of varies.
O.K. what you really wanted to know. There are a lot of different administration tools to set up your mounting. I don't know which ones you have so I'll hit a few. linuxconf, was one of the best all in one tools, and in some distributions will allow you to set up mount points. In Mandrake 8.2, under kde, off the program menu it's "what to do?" ----> "Administer your system" ---> Mandrake Control Center --->Mount Points --> Hard Drives. This is graphical and quite nice! "By the way, you can instantly see all your mount points, by typing mount in a terminal." O.K. When all else fails on many distros, you go to the /etc directory and look at the fstab and mtab files. This is how common distros keep track of their mount points auto and manual. Editing is no big deal, you will see the pattern as you read through the files. BTW if you are using a distro that is redhat, or based on redhat like mandrake is.... "Learning RED HAT LINUX 2nd edition by Bill McCarty O'Reilly(R) books is excellent. Mine had a 2 disk copy of RH 7.2 in it. Hopefully this is all starting to come together at this point. Enjoy your distribution. :)

minutrice
06-01-2002, 04:32 PM
I mounted the partition to downloads and set it up as a share but I can't access it from my xp box. It tells me I don't have permission. In the shell I used the commands:

# chown jbcissel:jbcissel /downloads
# chmod 2777 /downloads

thinking that it would let me get into it but it didn't.

Also I looked through all of the graphical utilities that redhat 7.3 has but I didn't find any things that would allow me to make /dev/hda4 mount at boot. Also how do I use linuxconf and cfdisk. When I try to run either I get a command not found error.

Thanks again,

Josh

MaXimum SMOKE
06-01-2002, 07:05 PM
O.K. redhat 7.3 I don't have that on any of the boxes I've worked on. The closest I got to it was the "skipjack" beta version. Linuxconf, and cfdisk probably are not in the default install of 7.3. RH has been modifying the types of utilities they use to admin. a system. Lately most of the boxes I've done with RH I've used the graphical version of disk partitioning and have done it during the install. They call it disk druid. Your guess may be as good as mine as to what they call it as a command. Open a terminal and type in dis and hit the tab key so it rolls up all the commands that begin with 'dis' If that don't work, I'd try Dis and hit the tab key. I manually partition with it, However, I never have attempted to use it after the initial install. It's great during install... Lets you set your mount points, and everything. You create the nonprimary partition, It builds the type #5. A lot of automation here. A lot of the old utilities that some of us are used to, like netconf, linuxconf, etc. are probably still in the rpm files of one of the redhat disks, but the default install did not request them. Back to the problem at hand. I don't have RH on anything here right now, so I have the book in one hand :( It specs a "User Mount Tool", available from Main Menu --> Programs --> System ---> Disk Management. Unfortunately it does not tell me if it sets the config files to do it for each boot. Those files are /etc/fstab and /etc/mtab They can be hand edited. They are plain old text files, that the system reads in at boot, or during other mountings. You may be stuck doing this. My books recommend modifying /etc/fstab with your text editor. Talking to your XP box has to be done with SMB. Samba is the most common service. I am not the one to be talking to on samba. For me, it is a one way street. I use the service to read shares off of Win 9x kernal machines with the linux box as a client. Are we any closer to the answer? ;)

minutrice
06-02-2002, 12:14 AM
Yes sir we are..... I edited the mtab instead of the fstab file. I'll try that and see if it works. I'm not at home right now but I'll try it when I get there.

As far as accessing that partition goes, I think I'll just have to play around with it some. I do use samba and I have another folder shared that I can access so I must just be doing something wrong. Thanks for the help.

Josh