Linux operating system to add new hard disk method

  
                  

#fdisk /dev/sdb

Enter fdisk mode:

Command (m for help):p //View the partition of the new hard disk

Command (m for Help):n //Create a new partition


Command action

e extended //Enter e to create an extended partition

p primary partition (1-4) //Enter p to create the primary partition, here we choose p


Partion number (1-4): 1 //the first extended partition, according to your needs can be divided into up to 4 primary partition < Br>

First Cylinder(1-1014,default 1): 1 //The number of disk blocks starting from the first primary partition

Last cylindet or +siza or +sizeM or +sizeK: +1024MB //Can be a number in MB or a number of


disk blocks, input +1024MB to indicate that the partition size is 1G.


Command (m for help): w

The partition table has been altered!


Calling ioctl() to re-read partition table.

Syncing disks.


#mkfs -t ext3 -c /dev/sdb1 //If there are multiple partitions, the partition is modified to sdb2

< BR>#mkdir www //Create /www directory, we will hang the new partition to www

#mount /dev/sdb1 /www //mount /dev/sdb1 to /www

# df //View with df command

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/sda2 3771316 1388956 2190788 39% /

/dev/sda1 101089 9463 86407 10% /boot

none 62988 0 62988 0% /dev/shm

/dev/sdb1 485906 8239 452580 2% /www //

I saw this, this is the newly mounted partition.


#vi /etc/fstab

/dev/sdb1 /www ext3 defaults 1 2

Copyright © Windows knowledge All Rights Reserved