Category - LINUX

Add Mount Point in VirtualBox

We will be adding Extra Disk to Virtual Box and create as Mount point in Linux Guest OS

Step =>1 Right click on virtual box -> settings

 

Step =>2 Click on Add harddisk => create  new disk

Step =>3 Select VDI as disk

 

Step =>4 Choose Fixed Size Disk for good performance

Step =>5 Provide Location for Disk 

And Click on CREATE ,And will prompt below screen for status .

Once completed we need to move to Next step .

 

 

Step =>6

Login to Guest OS as root and find that disk using below command

[root@HOST12C2020 ~]# fdisk -l

Disk /dev/sdc: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 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: 0x00000000

Step =>7 

Let we format that disk now

[root@HOST12C2020 ~]# fdisk /dev/sdc

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0x1a78dfeb.

After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

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): 1

First cylinder (1-2610, default 1):

Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610):

Using default value 2610

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

Step =>8

Check Partition details now  

[root@HOST12C2020 ~]# fdisk -l /dev/sdc

Disk /dev/sdc: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 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: 0x1a78dfeb

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1               1        2610    20964793+  83  Linux

Step =>9

Now create File system as EXT3 extension

[root@HOST12C2020 ~]# mkfs.ext3 /dev/sdc1

mke2fs 1.43-WIP (20-Jun-2013)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

1310720 inodes, 5241198 blocks

262059 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

160 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

Allocating group tables: done

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

Step =>10

Create Directory as Root 

[root@HOST12C2020 ~]# mkdir /wls

[root@HOST12C2020 ~]# mkdir /wls

Step =>11

Mount that file system 

[root@HOST12C2020 ~]# mount /dev/sdc1 /wls/

Step =>12

Edit values in /etc/fstab to persist value as permanent

[root@HOST12C2020 ~]# vi /etc/fstab

[root@HOST12C2020 ~]#cat /etc/fstab

/dev/sdc1               /wls                    ext3    defaults        1 2

Step =>13

Change Owner for mount point

 [root@HOST12C2020 ~]# chown oracle:oinstall /wls

Step =>14 

Check now for details  

[oracle@HOST12C2020 ~]$ df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/vg_host12c2020-lv_root

                       27G  4.1G   22G  17% /

tmpfs                 1.1G  304K  1.1G   1% /dev/shm

/dev/sda1             477M   78M  370M  18% /boot

/dev/sdb1              40G   30G  8.1G  79% /u01

/dev/sdc1              20G   45M   19G   1% /wls

[oracle@HOST12C2020 ~]$ cd /wls/

Step =>15 

Verify after using below command

 [oracle@HOST12C2020 wls]$ touch t

[oracle@HOST12C2020 wls]$ ls -lt

total 16

-rw-r--r--. 1 oracle oinstall     0 Jun  5 00:13 t

drwx------. 2 root   root     16384 Jun  5 00:06 lost+found

[oracle@HOST12C2020 wls]$