Operating System - Linux
1829638 Members
1609 Online
109992 Solutions
New Discussion

Re: Linux new hard disk partition/filesystem creation.

 
SOLVED
Go to solution
Gulam Mohiuddin
Regular Advisor

Linux new hard disk partition/filesystem creation.

I need help in using one new hard disk (/dev/sdb) which is already attached to the Redhat server.

I want to know how to create partition, create filesystems and mount them.


[root@GEOADM exp]# fdisk -l

Disk /dev/sda: 73.4 GB, 73406611456 bytes
254 heads, 63 sectors/track, 8959 cylinders
Units = cylinders of 16002 * 512 = 8193024 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 32 256000+ 83 Linux
/dev/sda2 33 1312 10241280 83 Linux
/dev/sda3 1313 1824 4096512 82 Linux swap
/dev/sda4 1825 8959 57087135 5 Extended
/dev/sda5 1825 2336 4096480+ 83 Linux
/dev/sda6 2337 2592 2048224+ 83 Linux
/dev/sda7 2593 4128 12289504+ 83 Linux
/dev/sda8 4129 5024 7168864+ 83 Linux
/dev/sda9 5025 5536 4096480+ 83 Linux
/dev/sda10 5537 6048 4096480+ 83 Linux
/dev/sda11 6049 8959 23290879+ 83 Linux

Disk /dev/sdb: 73.4 GB, 73406611456 bytes
254 heads, 63 sectors/track, 8959 cylinders
Units = cylinders of 16002 * 512 = 8193024 bytes

Disk /dev/sdb doesn't contain a valid partition table

Thanks,

Gulam.
Everyday Learning.
6 REPLIES 6
Gopi Sekar
Honored Contributor

Re: Linux new hard disk partition/filesystem creation.


run 'fdisk /dev/sdb'

it will drop you in to a prompt where you can partition the hard disk and create partitions as u want. for information on various options with fdisk type 'h' and enter. For more information check 'man fdisk'

Remember after creating new partitions and saving it, you have to reboot the server for kernel to refresh the partition table information about the new hard disk.

Regards,
Gopi
Never Never Never Giveup
Tvs
Regular Advisor
Solution

Re: Linux new hard disk partition/filesystem creation.

1.fdisk /dev/sdb
2.press n to create the partion
3.give the size
4.save and exit
5.mkfs.ext2 or mkfs.ext3 /dev/sdb1
(depending on u want to creat ext2 or ext3 )
6. five the entry in /etc/fstab

Gulam Mohiuddin
Regular Advisor

Re: Linux new hard disk partition/filesystem creation.

Thanks for your responses.

I forgot to mention that the disk is configured as RAID 1 (2x 73.5GB SCSI drives).

Thanks,

Gulam.
Everyday Learning.
Gopi Sekar
Honored Contributor

Re: Linux new hard disk partition/filesystem creation.


If it is hardware RAID (with RAID controller and configuration done at BIOS level) then you dont have to worry. the procedure is same as above.

Regards,
Gopi
Never Never Never Giveup
Gulam Mohiuddin
Regular Advisor

Re: Linux new hard disk partition/filesystem creation.

Thanks for you response. It is H/W RAID.

One more question:

Do I need to mention somewhere that this is secondary Partition?.

Thanks.

Gulam.


Everyday Learning.
Gopi Sekar
Honored Contributor

Re: Linux new hard disk partition/filesystem creation.


you dont have to mention it as secondary hard disk. It will be treated by its name (/dev/sdb).

For eg: to create single partition on the new hard disk which occupies full hard disk, do something like this:

fdisk /dev/sdb
press 'n' to create new partition
press 'p' to create it as primary partition (e for extended)
press '1' to create it as first primary partition
type two enters, first one is for start of cylinder and second for end of cylinder. if you leave them blank by entering by default fdisk uses the default value (which is 0 and the maximum number of cylinders)
type 'w' to write this new partition information.

after coming to shell reboot the system and format the new partition.

Regards,
Gopi
Never Never Never Giveup