In this article we are going to see step by step backup and restore Block Volume from in oracle cloud infrastructure
We can restore a backup of a volume as a new volume using Block Volume.
High Level steps are:-
- Already we have created 2 VM instance India and china with different Domain AD1 and AD2
- Create new block volume and attach to india vm instance
- Create testing file inside the mount poinr
- Take Manual backup of block volume,which we attached in India instance
- Using Block volume backup create new block volume in AD2 Domain.
- Restore the block volume to china instance
- Finally check the testing file is available
Step:-1 2 instance details India and China
India Mount point
China Mount Point
Source side configuration India Vm instance
Creating a new block volume and attach to india vm instance
Step:-2 Navigate to the Menu and click on Block Storage.
Step:-3 In Bock Volume service, click on Create Block Volume
Step:-4 Provide the following details (Note we need create block volume in AD1 Domain because our India instance is running in AD1.
Create In Compartment: Your Compartment Name
Availability Domain: It must be the same as the AD you choose for your instance.
Size: Choose Min 50 GB.
Step:-5 Block Volume storage is ready to attach India VM instance
Step:-6 Go to the Compute instance Menu, and navigate to the VM instance you created before and click on the Attach Block Volume button.
Compute Instances -> Instance Details -> click Devdb -> Next click Attached block Volumes
Step:-7 Provide the below details
- Attachement mode: iSCSI
- Block Volume: Select the volume which we created before (BackupTest)
- Device Path: Select /dev/oracleoci/oraclevdb
- Cick Attach
Step:-8 Once the volume is attached, you can click on the ellipsis and then click iSCSI Command and Information link.
Step:-9 Connect to the instance through SSH and run the iSCSI ATTACH COMMANDS.Click on COPY to copy all attach commands run all these commands by pasting it in the terminal
Step:11 Once the disk is attached, you can run the following commands to format the disk and mount it.
[root@india ~]# sudo mkfs -t ext4 /dev/oracleoci/oraclevdb
mke2fs 1.42.9 (28-Dec-2013)
/dev/oracleoci/oraclevdb is entire device, not just one partition!
Proceed anyway? (y,n) y
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=256 blocks
3276800 inodes, 13107200 blocks
655360 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2162163712
400 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@india /]# sudo mkdir /backup
[root@india /]# sudo mount /dev/oracleoci/oraclevdb /backup
[root@india /]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 459M 0 459M 0% /dev
tmpfs 486M 0 486M 0% /dev/shm
tmpfs 486M 13M 473M 3% /run
tmpfs 486M 0 486M 0% /sys/fs/cgroup
/dev/sda3 39G 2.0G 37G 5% /
/dev/sda1 200M 9.7M 191M 5% /boot/efi
tmpfs 98M 0 98M 0% /run/user/1000
/dev/sdb 50G 53M 47G 1% /backup
Step:12 Create testing file for this demo
Ready for testing on China Server
Step:-1 Take backup of block volume to Restore to another AD.
Navigate to the Menu and click on Block Storage
- Select block volume which we added to India VM instance
- Create Manual Backup
Step:-2 Provide the below details
- Name:- Any Name
- Backup type:-Full backup
- Click Create block volume backup
Step:-3 Using backup volume block to create new block volume
Step:-4 important is here to select AD2
Step:-5 Block volume is ready to attach china Vm instance
Step:-6 Now same steps to follow to attach the block volume for China instance.
- Attachement mode: iSCSI
- Block Volume: Select the volume created using block volume backup (Backuptest)
- Device Path: Select /dev/oracleoci/oraclevdc
- Cick Attach
Step:-7 Once the volume is attached, you can click on the ellipsis and then click iSCSI Command and Information link.
Step:-8 Connect to the instance through SSH and run the iSCSI ATTACH COMMANDS.Click on COPY to copy all attach commands run all these commands by pasting it in the terminal
Step:-9 Once the disk is attached, you can run the following commands to mount it.
[root@china ~]# sudo mkdir /backuptest
[root@china ~]# ls -lrt /dev/oracleoci/oraclev*
lrwxrwxrwx. 1 root root 6 Nov 25 18:40 /dev/oracleoci/oraclevda -> ../sda
lrwxrwxrwx. 1 root root 7 Nov 25 18:40 /dev/oracleoci/oraclevda2 -> ../sda2
lrwxrwxrwx. 1 root root 7 Nov 25 18:40 /dev/oracleoci/oraclevda1 -> ../sda1
lrwxrwxrwx. 1 root root 7 Nov 25 18:40 /dev/oracleoci/oraclevda3 -> ../sda3
lrwxrwxrwx. 1 root root 6 Nov 26 12:27 /dev/oracleoci/oraclevdc -> ../sdb
[root@china ~]# sudo mount /dev/oracleoci/oraclevdc /backuptest
Step:-10 Successfully completed backup and restore block volume in Oracle Cloud Infrastructure
Note:-If you want to attach a restored volume that has the original volume attached, be aware that some operating systems do not allow you to restore identical volumes. To resolve this, you should change the partition IDs before restoring the volume. How to change an operating system’s partition ID varies by operating system; for instructions, see your operating system’s document.
Note:- When users create a backup from a volume or restore a volume from a backup, the volume and backup don’t have to be in the same compartment .However, users must have access to both compartments.
Connect with me:-
FB Page : https://www.facebook.com/dbahariprasath/?
Twitter : https://twitter.com/hariprasathdba