LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   howto partition in linux (https://www.linuxquestions.org/questions/linux-newbie-8/howto-partition-in-linux-298465/)

pukington 03-06-2005 05:53 PM

howto partition in linux
 
I'm afraid i am a relative newb to the nix world, although having been a unix user at uni and at home i haven't done all that other than be an end user.

My linux distrubtion, being Fedora, is installed on a second hdd, XP being on my primary, and this linux disc is at ten gigs, plus my swap space etc, but i want to partition the rest of it so i can use it, atm its just dormant. I've only ever used disk-druid on install or PM in windows, so atm i'm at a loss, as i've done some googleing and it looks as though i can't run disk druid outside of anaconda, and guessing i need to use fdisc but i'm a little scared that i'll end up destroying any of my partitons. I can't seem to find much help on the net, or that i can understand in the least, so hoping you guys could help me out a bit.

Cheers guys :)

ssimontis 03-06-2005 05:58 PM

Fdisk is pretty easy to use. And the changes don't take place until you write the table, so if you think you messed up or you want to stop, you can quit without losing everything. Also, check out cfdisk, which is a little easier to use.

narmida 03-06-2005 06:05 PM

cfdisk is not on fedora @ default

Do

fdisk -l

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 64 514048+ 83 Linux
/dev/hda2 65 9729 77634112+ fd Linux raid autodetect

Disk /dev/hdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 64 514048+ 82 Linux swap
/dev/hdb2 65 9729 77634112+ fd Linux raid autodetect

You can see partitions of my server (for the geeks yes partitions could be MUCH better but he! its a P2 my own temp fileserver at home)

Sort out wich partition it is about and use fdisk :

fdisk /dev/hda

The number of cylinders for this disk is set to 9729.
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): p

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 64 514048+ 83 Linux
/dev/hda2 65 9729 77634112+ fd Linux raid autodetect

Command (m for help): m
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):

all you need to know that there can be 4 primary partitions the fourth must be an extendend (can be primary 4 btw but that is stupid)

you make the partition and give it 83 Linux in the L list (default btw)

then write (w)

after that you can do mkfs.ext3 /dev/hda3 (for partition 3 on master ide drive on first ide interface)

now you can put him in /etc/fstab and mount the sucker
NOTE when you use label in fstab use e2label to label the disk but is basicly for higher purposes)

fdisk is simpel and great dont use easy tools learn the core with youre unix background you should know this also

use : man fdisk

hope it helps

pukington 03-06-2005 06:42 PM

dude thats stunning, thats exactly what i'm after, i'm doin a lotta learning here, forgotten how such a small thing can be such an accomplishment, heres what i got:

Command (m for help): p

Disk /dev/hdb: 80.0 GB, 80026361856 bytes
16 heads, 63 sectors/track, 155061 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 24966 12582832+ 83 Linux
/dev/hdb2 24967 27047 1048824 82 Linux swap
/dev/hdb3 27048 155061 64519056 5 Extended

Command (m for help):

but how do i tell it to be a fat partition, when i made the partition should i have typed b for W95 FAT ??

thanks again

pukington 03-06-2005 07:17 PM

okay i'm one better, but i dont get how to format it,

Command (m for help): p

Disk /dev/hdb: 80.0 GB, 80026361856 bytes
16 heads, 63 sectors/track, 155061 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 24966 12582832+ 83 Linux
/dev/hdb2 24967 27047 1048824 82 Linux swap
/dev/hdb3 27048 155061 64519056 b W95 FAT32

i take it that mkfs is make file system, i worked that out, but how do i go about it, would it be

mkfs /dev/hdb3

i dont understand the .ext3, isn't that a type of format? so would i want .fat or am i way off?

ssimontis 03-06-2005 07:34 PM

You just need to use the commands. Press m to see them all. First, delete the partition you wish to get rid of. Then, create a new partition. It will default to Linux. Then use the 'w' command to write the table and quit. To create a file system, you can use a number of tools. Use 'makefs' for ext2 and ext3 filesystems, and 'mkreiserfs' for reiserfs filesystems.

pukington 03-06-2005 08:02 PM

i got the fdisking down ok, i just can't seem to sort out how to format it to fat, i'm getting a bit tired, may leave it for the morning

ssimontis 03-06-2005 08:26 PM

What filesystem do you want to use? You might want to put a bit of research into Linux filesystems. The most common filesystem is probably ext3. I personally use reiserfs.

pukington 03-06-2005 08:35 PM

i actually want it to be Fat32, and have worked out how to do it,but i'm getting a error that i dont understand:

firstly, i've made hdb3 in fdisk to be fat according to the partition table:

Disk /dev/hdb: 80.0 GB, 80026361856 bytes
16 heads, 63 sectors/track, 155061 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 24966 12582832+ 83 Linux
/dev/hdb2 24967 27047 1048824 82 Linux swap
/dev/hdb3 27048 155061 64519056 c W95 FAT32 (LBA)


so its there, hdb3.

i'm now using mkfs.vfat or mkfs -t vfat:

root@localhost puk]# /sbin/mkfs.vfat /dev/hdb3
mkfs.vfat 2.8 (28 Feb 2001)
/dev/hdb3: No such device or address

and

[root@localhost puk]# /sbin/mkfs -t vfat /dev/hdb3
mkfs.vfat 2.8 (28 Feb 2001)
/dev/hdb3: No such device or address


it can't find the device but it is there as i proved with the above table, am i missing something here?

cheers

wpn146 03-07-2005 08:09 AM

Some versions of Linux require a reboot after creating new partitions.


All times are GMT -5. The time now is 12:20 PM.