You are on page 1of 6

Create and extend File system:

1. Create block volume

2. Attach block volume:


[root@ociqapsc ~]# sudo iscsiadm -m node -o new -T iqn.2015-12.com.oracleiaas:87f10879-7e80-4e15-891c-c707cb3c6a12 -p 169.254.2.2:3260
New iSCSI node [tcp:[hw=,ip=,net_if=,iscsi_if=default] 169.254.2.2,3260,-1 iqn.2015-12.com.oracleiaas:87f10879-7e80-4e15-891c-c707cb3c6a12]
added
[root@ociqapsc ~]# sudo iscsiadm -m node -o update -T iqn.2015-12.com.oracleiaas:87f10879-7e80-4e15-891c-c707cb3c6a12 -n node.startup -v
automatic
[root@ociqapsc ~]# sudo iscsiadm -m node -T iqn.2015-12.com.oracleiaas:87f10879-7e80-4e15-891c-c707cb3c6a12 -p 169.254.2.2:3260 -l Logging in
to [iface: default, target: iqn.2015- 12.com.oracleiaas:87f10879-7e80-4e15-891c-c707cb3c6a12, portal: 169.254.2.2,3260] (multiple)
Login to [iface: default, target: iqn.2015-12.com.oracleiaas:87f10879-7e80-4e15-891c-c707cb3c6a12, portal: 169.254.2.2,3260] successful.

We will use device path

[root@ociqapsc /]# fdisk /dev/oracleoci/oraclevdg


Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table


Building a new DOS disklabel with disk identifier 0x11a76af8.

The device presents a logical sector size that is smaller than


the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.

Command (m for help): n


Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-209715199, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199):
Using default value 209715199
Partition 1 of type Linux and of size 100 GiB is set

Command (m for help): w


The partition table has been altered!

Calling ioctl() to re-read partition table.


Syncing disks.
[root@ociqapsc ~]# /sbin/mkfs.ext4 /dev/oracleoci/oraclevdh
mke2fs 1.42.9 (28-Dec-2013)
/dev/oracleoci/oraclevdh 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=256 blocks
4587520 inodes, 18350080 blocks
917504 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
560 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

Allocating group tables: done


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

[root@ociqapsc ~]# mount /dev/oracleoci/oraclevdh /u03

Edit the /etc/fstab and add below lines :

/dev/oracleoci/oraclevde /u01 ext3 defaults,_netdev,noatime 0 2


/dev/oracleoci/oraclevdf /u02 ext3 defaults,_netdev,noatime 0 2
/dev/oracleoci/oraclevdg /u03 ext3 defaults,_netdev,noatime 0 2

Resizing the /u03 from 100GB to 420GB


- Shutdown database
- Unmount the filesystem
- Disconnect from host
- Detach the volume
-
Attach the resized block volume to instance ** make sure the device path is same /dev/oracleoci/oraclevdg
[root@ociqapsc ~]# sudo iscsiadm -m node -T iqn.2015-12.com.oracleiaas:6d5d1fb9-847c-4f47-b105-325d0ef56c16 -p 169.254.2.7:3260 -u
Logging out of session [sid: 10, target: iqn.2015-12.com.oracleiaas:6d5d1fb9-847c-4f47-b105-325d0ef56c16, portal: 169.254.2.7,3260]
Logout of [sid: 10, target: iqn.2015-12.com.oracleiaas:6d5d1fb9-847c-4f47-b105-325d0ef56c16, portal: 169.254.2.7,3260] successful.
[root@ociqapsc ~]# sudo iscsiadm -m node -o delete -T iqn.2015-12.com.oracleiaas:6d5d1fb9-847c-4f47-b105-325d0ef56c16 -p 169.254.2.7:3260
[root@ociqapsc ~]# sudo iscsiadm -m node -o new -T iqn.2015-12.com.oracleiaas:6d5d1fb9-847c-4f47-b105-325d0ef56c16 -p 169.254.2.9:3260
New iSCSI node [tcp:[hw=,ip=,net_if=,iscsi_if=default] 169.254.2.9,3260,-1 iqn.2015-12.com.oracleiaas:6d5d1fb9-847c-4f47-b105-325d0ef56c16]
added
[root@ociqapsc ~]# sudo iscsiadm -m node -o update -T iqn.2015-12.com.oracleiaas:6d5d1fb9-847c-4f47-b105-325d0ef56c16 -n node.startup -v
automatic
[root@ociqapsc ~]# sudo iscsiadm -m node -T iqn.2015-12.com.oracleiaas:6d5d1fb9-847c-4f47-b105-325d0ef56c16 -p 169.254.2.9:3260 -l
Logging in to [iface: default, target: iqn.2015-12.com.oracleiaas:6d5d1fb9-847c-4f47-b105-325d0ef56c16, portal: 169.254.2.9,3260] (multiple)
Login to [iface: default, target: iqn.2015-12.com.oracleiaas:6d5d1fb9-847c-4f47-b105-325d0ef56c16, portal: 169.254.2.9,3260] successful.
[root@ociqapsc ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdd 8:48 0 70G 0 disk /u01
sdb 8:16 0 420G 0 disk /u02
sdc 8:32 0 450G 0 disk /u03
sda 8:0 0 46.6G 0 disk
├─sda2 8:2 0 8G 0 part [SWAP]
├─sda3 8:3 0 38.4G 0 part /
└─sda1 8:1 0 200M 0 part /boot/efi

To resize
- Unmount /u03
- e2fsck -f /dev/sdc
- resize2fs /dev/sdc
- mount /dev/oracleoci/oraclevdg /u03

TROUBLESHOOTING ;

Unit u02-oradata-FCAAQA.mount is bound to inactive unit dev-sdq.device

If after extending disk remounting pick old device

You might also like