So let's start
[root@GLUG ~]# fdisk -l /dev/hda
Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
[root@GLUG ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
37G 28G 7.0G 80% /
/dev/hdb1 99M 9.0M 85M 10% /boot
none 375M 0 375M 0% /dev/shm
FDISK command shows you disk partition details...
[root@GLUG ~]# fdisk -l /dev/hdb
Disk /dev/hdb: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 * 1 13 104391 83 Linux
/dev/hdb2 14 4865 38973690 8e Linux LVM
Now i have to conduct following task to use new HDD
1) Create Extended Paritition
2 ) Create Logical partition
3) Format newly created partition
4) Mount formated partition in my Linux box !
1) Create Extended Paritition
2 ) Create Logical partition
3) Format newly created partition
4) Mount formated partition in my Linux box !
Step : 1 Create Extended Paritition
[root@GLUG ~]# fdisk /dev/hda
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)
As i have already primary partition and Linux is booting from there..so it doesn't make sense to create primary partition..As i will going to use this whole new space for data saving...
( i m not going to in detail what extended and logical and why logical needs to be created !!! HOPE u all guys n gals know already )
Step 2 : Creating new Logical partition under Extended partition we created...
Now i am going format this newly created logical partition..... using mkfs command... Command (m for help): nViewing partition ....which i created !!
Command action
e extended
p primary partition (1-4)
e
Partition number (1-4): 1
First cylinder (1-19457, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457):
Using default value 19457
Command (m for help): pExtended partition won't help or useful or OS can not use. We must have to create logical partition... so i m going to do next ....
Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 19457 156288321 5 Extended
( i m not going to in detail what extended and logical and why logical needs to be created !!! HOPE u all guys n gals know already )
Step 2 : Creating new Logical partition under Extended partition we created...
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): n
Command action
l logical (5 or over)
p primary partition (1-4)
l ( i pressed L (Small )
First cylinder (1-19457, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457):
Using default value 19457
Command (m for help): p
Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 19457 156288321 5 Extended
/dev/hda5 1 19457 156288289+ 83 Linux
Saving partition Table !!!!
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
In Linux there is various file support if u want to create ext2 or ext3 file system there is specially command to create special file system....
Step 3:Format newly created partition
[root@GLUG ~]# mkfs -t ext3 /dev/hda5
mke2fs 1.35 (28-Feb-2004)
max_blocks 4294967295, rsv_groups = 0, rsv_gdb = 1024
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
19546112 inodes, 39072072 blocks
1953603 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=41943040
1193 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
inode.i_blocks = 122888, i_size = 4243456
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
I am creating directory ... and then i will mount this whole 160 GB @ that directory as mount pt ....
Step 4 : Mount formated partition in my Linux box !
[root@GLUG ~]# mkdir /GLUG
[root@GLUG ~]# mount /dev/hda5 /GLUG/
[root@GLUG ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
37G 28G 7.0G 80% /
/dev/hdb1 99M 9.0M 85M 10% /boot
none 375M 0 375M 0% /dev/shm
/dev/hda5 147G 93M 140G 1% /GLUG
No comments:
Post a Comment