Monday, May 9, 2016

How to add mount point in Redhat Linux

[root@sbdbdr01 ~]# fdisk -l | grep '^Disk'
Disk /dev/sda: 42.9 GB, 42949672960 bytes
Disk identifier: 0x00021498
Disk /dev/sdb: 51.5 GB, 51539607552 bytes
Disk identifier: 0x0003bf53
Disk /dev/sdc: 51.5 GB, 51539607552 bytes
Disk identifier: 0x00056c3c
Disk /dev/sdd: 51.5 GB, 51539607552 bytes
Disk identifier: 0x000c3727
Disk /dev/sdf: 51.5 GB, 51539607552 bytes
Disk identifier: 0x000a83f6
Disk /dev/sde: 51.5 GB, 51539607552 bytes
Disk identifier: 0x000de7f7
Disk /dev/sdh: 24.7 GB, 24696061952 bytes
Disk identifier: 0x000a9203
Disk /dev/sdi: 24.7 GB, 24696061952 bytes
Disk identifier: 0x000c3e2d
Disk /dev/sdg: 51.5 GB, 51539607552 bytes
Disk identifier: 0x00006616
Disk /dev/sdj: 24.7 GB, 24696061952 bytes
Disk identifier: 0x000de89e
Disk /dev/sdk: 24.7 GB, 24696061952 bytes
Disk identifier: 0x00005510
Disk /dev/sdl: 24.7 GB, 24696061952 bytes
Disk identifier: 0x00071fbd
Disk /dev/sdm: 24.7 GB, 24696061952 bytes
Disk identifier: 0x0008e468
[root@sbdbdr01 ~]# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4):
Value out of range.
Partition number (1-4): 1
First cylinder (1-6266, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-6266, default 6266):
Using default value 6266

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@sbdbdr01 ~]#
[root@sbdbdr01 ~]# mkfs.ext4 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
3145728 inodes, 12582903 blocks
629145 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
384 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424

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

This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@sbdbdr01 ~]# mkdir /u01
[root@sbdbdr01 ~]#
[root@sbdbdr01 ~]# mount /dev/sdb1 /u01
[root@sbdbdr01 ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Mon May  9 16:34:50 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=3f2c16d3-6add-4a4d-89a2-824bd6090239 /                       ext4    defaults        1 1
UUID=4af12c05-0f8a-4082-bbeb-55d9e77931c3 /tmp                    ext4    defaults        1 2
UUID=2469b10b-3673-4b9b-8fcb-7d1465db42e9 swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
[root@sbdbdr01 ~]#
[root@sbdbdr01 u01]# vi /etc/fstab
[root@sbdbdr01 u01]#
[root@sbdbdr01 u01]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Mon May  9 16:34:50 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=3f2c16d3-6add-4a4d-89a2-824bd6090239 /                       ext4    defaults        1 1
UUID=4af12c05-0f8a-4082-bbeb-55d9e77931c3 /tmp                    ext4    defaults        1 2
UUID=2469b10b-3673-4b9b-8fcb-7d1465db42e9 swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/sdb1 /u01                   ext4    defaults        1 2

No comments:

Post a Comment