Add filesystem mountpoint in linux

After storage team provision the physical disk layer,check the logical units of the disks using fdisk

[root@orcl oracle]# fdisk -l|grep -A5 sde
Disk /dev/sde: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe418c16e
--
/dev/sde1               1         391     3140676   83  Linux
[root@orcl oracle]#

Create a mount point with type(-t) ext4 on /dev/sde

[root@orcl oracle]# mkfs -t ext4 /dev/sde
mke2fs 1.43-WIP (20-Jun-2013)
/dev/sde is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
786432 inodes, 3145728 blocks
157286 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=3221225472
96 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

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

Create a directory to mount the logical mount point

[root@orcl oracle]# mkdir /u01
[root@orcl oracle]# mount /dev/sde /u01

Check if the mount point is added to the OS.Note that so far we have temporarily mounted the filesystem.Post reboot of the system,changes will not reflect for the mount point

[root@orcl oracle]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdd1        20G  6.9G   12G  38% /
tmpfs           1.9G  635M  1.2G  35% /dev/shm
/dev/sdd5        15G  9.3G  4.5G  68% /grid
/dev/sdd2        15G  5.4G  8.4G  40% /oracle
/dev/sde         12G   30M   12G   1% /u01

Give appropriate permissions to the directory of mount point

[root@orcl oracle]# chown oracle:oinstall /u01/
[root@orcl oracle]# chmod -R 755 /u01

Check the UUID of the particular disk

[root@orcl by-uuid]# ls -lrt
total 0
lrwxrwxrwx 1 root root 10 Feb 27 10:43 5307b124-8485-4f2c-ac2f-88af16028c11 -> ../../sdd3
lrwxrwxrwx 1 root root 10 Feb 27 10:43 de13c2f8-d3f3-41a7-9928-46001af5faf9 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Feb 27 10:43 1121a652-c653-4bc5-b475-6285703020ba -> ../../sdd5
lrwxrwxrwx 1 root root 10 Feb 27 10:43 e3a73203-7975-4750-8ab4-e24542c24f31 -> ../../sdd2
lrwxrwxrwx 1 root root  9 Feb 27 11:38 1c1e8596-f9c2-4250-9fcc-1658ab4fec69 -> ../../sde
[root@orcl by-uuid]# pwd
/dev/disk/by-uuid

As we have already mounted the filesystem for current session earlier which vanish after reboot.So we have to update the fstab entry for permanent change

[root@orcl by-uuid]# cat /etc/fstab |grep u01
UUID=1c1e8596-f9c2-4250-9fcc-1658ab4fec69 /u01                    ext4    defaults      1 2

After reboot,you can see the changes using blkid command.

[root@orcl oracle]# blkid
/dev/sdd1: LABEL="FRA" TYPE="oracleasm"
/dev/sda1: UUID="de13c2f8-d3f3-41a7-9928-46001af5faf9" TYPE="ext4"
/dev/sdc1: LABEL="DATA" TYPE="oracleasm"
/dev/sda2: UUID="e3a73203-7975-4750-8ab4-e24542c24f31" TYPE="ext4"
/dev/sda3: UUID="5307b124-8485-4f2c-ac2f-88af16028c11" TYPE="swap"
/dev/sda5: UUID="1121a652-c653-4bc5-b475-6285703020ba" TYPE="ext4"
/dev/sdb: UUID="1c1e8596-f9c2-4250-9fcc-1658ab4fec69" TYPE="ext4"
/dev/sde1: LABEL="CRS" TYPE="oracleasm"

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s