1827981 Members
2473 Online
109973 Solutions
New Discussion

Re: Disk Partioning

 
Anitha_3
Frequent Advisor

Disk Partioning

hi,

i have just now added 2 146 GB hard disks to my server. let me know how do i partion these disks in linux and create mount points.

i know this in hp-unix but i dont know linux.

any help will be greatly appriciated.

thanks in advance.
goivnd.
13 REPLIES 13
Hoefnix
Honored Contributor

Re: Disk Partioning

Hi,

Allot of tools differ on Linux distro's but fdisk will work to partition the disks.

With large disks I like to use LVM.

If you run RedHat check the tool Diskdruid.
On SuSE you find an interface running Yast.
Because you used to work with HP-UX, you can create a look alike /etc/fstab
A sample of mine using LVM:
/dev/system/HOME /home reiserfs defaults 1 2
/dev/system/LOCAL /local reiserfs defaults 1 2
/dev/system/OPT /opt reiserfs defaults 1 2

If you still like the commandline:
Check man lvcreate and mkfs (or mkreiserfs ...)


HTH,
Peter
Hoefnix
Honored Contributor

Re: Disk Partioning

Some more info:
To create an LVM partition you have to use the ID 83 in fdisk:
example:
/dev/hda1 384 2343 14817600 8e Linux LVM

After this you can use vgcreate (check manpage)
All looks much the same as on HP-UX.

Good luck,

Peter
vetriselvan s
Advisor

Re: Disk Partioning

Always Use Fdisk
thats Good Utility :)
Rick Garland
Honored Contributor

Re: Disk Partioning

Use fdisk to create the partitions. Make sure you define the proper filesystem type (LVM vs ext). In my experience a reboot is suggested so the new partition is written.

After a reboot run the 'ext2fs' or 'ext2fs -j'
utility on the newly created partition. This is making the filesystem on the partition (ext2 or ext3 - use the proper mkfs command to match the filesystem type you are creating.)

Create the mount point and mount. Make the corresponding entry in the fstab as well.

Johannes Krackowizer_1
Valued Contributor

Re: Disk Partioning

you should use fdisk /dev/hd[a-z] for ide drives, or fdisk /dev/sd[a-z] for scsi drives. you can use lvm, softwareraid, or simply the partition.

the simpliest way to get the new partition running is:

- create it first with fdisk
for simple partioion you should take ID 83
(swap is ID 82, Linux LVM is ID 8E, Linux Software Raid is ID FD)
- set mount points in /etc/fstab for example:

/dev/hda3 / ext3 defaults 0 0

first field is the hardware device
second field is the mountpoint
third field is the filesystem (for security you should use ext3 or reiserfs)
fourth field are the fs-option see man mount (default should work fine)
the fifth field is used to tell the dump command if it should determine if filesystem should be dumped (0 means never dump)
the sixth field is used to tell fsck in which order it should scan the filesystems 1 means it is scand first, 2 means it is scand if all filesystems with a 1 has finished, ... 0 means never scan a filesystem

- next you have to create the fs by using mkreiserfs or the apropiate mkfs tool you prefer

for more security you can mirror the two drives with an software raid (RAID 1)
then you have to asign the partitions the ID FD in fdisk. then you have to create a raidtab file in /etc (manpage raidtab(5)) and refer the mans for mkraid, raidstop, raidstart, raidhotadd, raidhotremove
"First off, I'd suggest printing out a copy of the GNU coding standards, and NOT read it. Burn them, it's a great symbolic gesture." (Linus Torvalds)
Jean-Luc Oudart
Honored Contributor

Re: Disk Partioning

Hi,

found this site a while ago.
You may find some interesting stuff.
Enjoy !

http://jamesthornton.com/redhat/linux/6.2/Reference-Guide/ch-partitions.html

Regards,
Jean-Luc
fiat lux
Rick Garland
Honored Contributor

Re: Disk Partioning

One thing you might want to do as well.

There is the command 'fdisk -l' that will output the partitioning scheme that has been configured on the system. I always get a backup copy of this output as well. But it can provide you with info as to how the other partitions are configured, the types, etc...
Govinda
Advisor

Re: Disk Partioning

hi guys,

thanks for the inputs. my question is how to find the disk names. like /dev/hda..

whats the command that lists the disk drives names of the disks which i inserted newly.

thanks
Govind
Vitaly Karasik_1
Honored Contributor

Re: Disk Partioning

- sometime "fdisk -l " will provide you with list of all attached harddisks.
- if you add IDE disk - it will be /dev/hda and hdb for first IDE controller, hdc and hdd for the second one
- for SCSI disks - /dev/sdX
- if it doesn't help, send us model of you server/RAID/etc
yufei_3
New Member

Re: Disk Partioning

oh,sorrry

What's I saying has been said....
Johannes Krackowizer_1
Valued Contributor

Re: Disk Partioning

Hi govinda,

look at "/proc/scsi/" or "/proc/ide/" there you will find much information about your ide and scsi controller and drives

for example my "/proc/ide/" locks like this:
[root@rondra ide]# ls -al
total 0
dr-xr-xr-x 4 root root 0 Sep 13 13:03 .
dr-xr-xr-x 49 root root 0 Jul 27 16:00 ..
-r--r--r-- 1 root root 0 Sep 13 13:03 drivers
lrwxrwxrwx 1 root root 8 Sep 13 13:03 hda -> ide0/hda <----- first device
lrwxrwxrwx 1 root root 8 Sep 13 13:03 hdc -> ide1/hdc <----- second device
dr-xr-xr-x 3 root root 0 Sep 13 13:03 ide0
dr-xr-xr-x 3 root root 0 Sep 13 13:03 ide1
-r--r--r-- 1 root root 0 Sep 13 13:03 via


so i can see there are to device on the ide bus named hda (primary master), hdc (secondary master).

There device names are /dev/hda and /dev/hdc.
There Partition names are:
[root@rondra ide]# fdisk -l

Disk /dev/hda: 30.7 GB, 30738677760 bytes
255 heads, 63 sectors/track, 3737 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 32 257008+ 83 Linux
/dev/hda2 33 3671 29230267+ 83 Linux
/dev/hda3 3672 3737 530145 82 Linux swap
"First off, I'd suggest printing out a copy of the GNU coding standards, and NOT read it. Burn them, it's a great symbolic gesture." (Linus Torvalds)
Rick Garland
Honored Contributor

Re: Disk Partioning

A df -k will provide the disk names you are seeking. They are on the left hand side of the output
Rick Garland
Honored Contributor

Re: Disk Partioning

fdisk -l will provide that info as well