Creating New Partition on Redhat Linux
1.Create New Primary Partition
2.Inform the OS of partition table changes
3.Create an ext3 filesystem
4.Mount the File System
5.Configuration in /etc/fstab
1.Create New Primary Partition
[root@sys80 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 49G 6.8G 39G 15% /
none 1.5G 0 1.5G 0% /dev/shm
[root@sys80 ~]# fdisk /dev/sda
The number of cylinders for this disk is set to 60801.
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/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6374 51199123+ 83 Linux
/dev/sda2 6375 6948 4610655 82 Linux swap
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (6949-60801, default 6949):
Using default value 6949
Last cylinder or +size or +sizeM or +sizeK (6949-60801, default 60801): +50G
Command (m for help): p
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6374 51199123+ 83 Linux
/dev/sda2 6375 6948 4610655 82 Linux swap
/dev/sda3 6949 13028 48837600 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
2.Inform the OS of partition table changes
[root@sys80 ~]# cat /proc/partitions
major minor #blocks name
8 0 488386584 sda
8 1 51199123 sda1
8 2 4610655 sda2
8 16 156290904 sdb
[root@sys80 ~]# partprobe
[root@sys80 ~]# cat /proc/partitions
major minor #blocks name
8 0 488386584 sda
8 1 51199123 sda1
8 2 4610655 sda2
8 3 48837600 sda3
8 16 156290904 sdb
3.Create an ext3 filesystem
[root@sys80 ~]# mkfs.ext3 -b 2048 -i 4096 -L /db /dev/sda3
mke2fs 1.35 (28-Feb-2004)
Filesystem label=/db
OS type: Linux
Block size=2048 (log=1)
Fragment size=2048 (log=1)
12214272 inodes, 24418800 blocks
1220940 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=562036736
1491 block groups
16384 blocks per group, 16384 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
16384, 49152, 81920, 114688, 147456, 409600, 442368, 802816, 1327104,
2048000, 3981312, 5619712, 10240000, 11943936
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
4.Mount the File System
[root@sys80 ~]# mount
/dev/sda1 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
[root@sys80 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 49G 6.8G 39G 15% /
none 1.5G 0 1.5G 0% /dev/shm
[root@sys80 ~]# mkdir /db
[root@sys80 ~]# mount /dev/sda3 /db (or) mount -a
[root@sys80 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 49G 6.8G 39G 15% /
none 1.5G 0 1.5G 0% /dev/shm
/dev/sda3 46G 32M 43G 1% /db
[root@sys80 ~]# mount
/dev/sda1 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sda3 on /db type ext3 (rw)
5.Configuration in /etc/fstab
[root@sys80 ~]# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
/dev/hda /media/cdrecorder auto pamconsole,exec,noauto,managed 0 0
Please Add the below entry in /etc/fstab
LABEL=/db /db ext3 defaults 0 0
[root@sys80 ~]# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
/dev/hda /media/cdrecorder auto pamconsole,exec,noauto,managed 0 0
LABEL=/db /db ext3 defaults 0 0

No comments:
Post a Comment