Saturday, September 22, 2012

Create a new Mount point in UNIX


[allocate a disk /dev/sdf in UNIX and format it using fdisk command as /dev/sdf1  give it a mount point name as /u02 ]

[root@localhost ~]# fdisk -l

Disk /dev/sda: 22.4 GB, 22429040640 bytes
255 heads, 63 sectors/track, 2726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2726    21792172+  8e  Linux LVM

Disk /dev/sdb: 11.4 GB, 11494490112 bytes
255 heads, 63 sectors/track, 1397 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1397    11221371   83  Linux

Disk /dev/sdc: 11.1 GB, 11162091520 bytes
255 heads, 63 sectors/track, 1357 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1357    10900071   83  Linux

Disk /dev/sdd: 10.8 GB, 10829692928 bytes
255 heads, 63 sectors/track, 1316 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        1316    10570738+  83  Linux

Disk /dev/sde: 11.1 GB, 11162091520 bytes
255 heads, 63 sectors/track, 1357 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1        1357    10900071   83  Linux

Disk /dev/sdf: 22.4 GB, 22429040640 bytes
255 heads, 63 sectors/track, 2726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1        2726    21896563+  83  Linux

Disk /dev/dm-0: 16.5 GB, 16542334976 bytes
255 heads, 63 sectors/track, 2011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 5771 MB, 5771362304 bytes
255 heads, 63 sectors/track, 701 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-1 doesn't contain a valid partition table


[root@localhost ~]# mkfs.ext3 /dev/sdf1

mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2741760 inodes, 5474140 blocks
273707 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
168 block groups
32768 blocks per group, 32768 fragments per group
16320 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@localhost ~]# e2label /dev/sdf1 /u02
[root@localhost ~]# mkdir /u02
[root@localhost ~]# vi /etc/fstab

[root@localhost ~]# mount -a
[root@localhost ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       15G   12G  2.7G  82% /
/dev/sda1              99M   27M   68M  29% /boot
tmpfs                 1.8G  154M  1.6G   9% /dev/shm
/dev/sdf1              21G  173M   20G   1% /u02
[root@localhost ~]# reboot

Broadcast message from root (pts/2) (Mon Jul 23 16:04:49 2012):

The system is going down for reboot NOW!

Reference : http://linuxgazette.net/150/prestia.html