Problem: How to add a secondary partition to archive data in Versa Analytics?
Solution:
Follow these steps to add a secondary partition to archive data in Versa Analytics:
- Add a new storage disk after shutting down the VM.
2. Reboot the VM.
3. Run the sudo lsblk command to see the new disk.
versa@versa-analytics:~$ sudo lsblk [sudo] password for versa: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda 253:0 0 90G 0 disk |-vda1 253:1 0 243M 0 part /boot |-vda2 253:2 0 1K 0 part |-vda5 253:5 0 79.8G 0 part | |-system-root (dm-0) 252:0 0 81.8G 0 lvm / | `-system-swap_1 (dm-1) 252:1 0 8G 0 lvm [SWAP] `-vda6 253:6 0 10G 0 part `-system-root (dm-0) 252:0 0 81.8G 0 lvm / vdb 253:16 0 30G 0 disk
4. Create a new physical partition with entire 30 G. Select Linux as the file system type and then write the partition table to disReboot the VM. Run sudo lsblk command to see the new partition is available after the reboot.
versa@versa-analytics:~$ sudo lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda 253:0 0 90G 0 disk |-vda1 253:1 0 243M 0 part /boot |-vda2 253:2 0 1K 0 part |-vda5 253:5 0 79.8G 0 part | |-system-root (dm-0) 252:0 0 81.8G 0 lvm / | `-system-swap_1 (dm-1) 252:1 0 8G 0 lvm [SWAP] `-vda6 253:6 0 10G 0 part `-system-root (dm-0) 252:0 0 81.8G 0 lvm / vdb 253:16 0 30G 0 disk `-vdb1 253:17 0 30G 0 part
5. Run the sudo mkfs.ext2 /dev/vdb command to create a file system on the new partition.
versa@versa-analytics:~$ sudo mkfs.ext2 /dev/vdb . . . mke2fs 1.42.9 (4-Feb-2014) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 1966080 inodes, 7864320 blocks 393216 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 240 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 Writing superblocks and filesystem accounting information: done
6. Run the sudo mkdir /mnt/archive command to create a directory for archiving.
versa@versa-analytics:~$ sudo mkdir /mnt/archive
7. Run the sudo mount -t ext2 /dev/vdb /mnt/archive command to mount the directory.
versa@versa-analytics:~$ sudo mount -t ext2 /dev/vdb /mnt/archive
8. To make sure the mount persists after reboot, check it in fstab file.
versa@versa-analytics:~$ cat /etc/fstab # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> /dev/mapper/system-root / ext4 errors=remount-ro 0 1 # /boot was on /dev/vda1 during installation UUID=d457fe41-733c-443c-a4a7-dd4d67df7232 /boot ext2 defaults 0 2 /dev/mapper/system-swap_1 none swap sw 0 0 /dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0 /dev/vdb /mnt/archive ext2 errors=remount-ro 0 1
9. Run the sudo unmount/mnt/archive to check the unmount and mount.
sudo umount /mnt/archive df -kh sudo mount –a
versa@versa-analytics:~$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/system-root 84251136 2879256 77175620 4% / none 4 0 4 0% /sys/fs/cgroup udev 4076888 4 4076884 1% /dev tmpfs 817612 416 817196 1% /run none 5120 0 5120 0% /run/lock none 4088056 0 4088056 0% /run/shm none 102400 0 102400 0% /run/user /dev/vda1 240972 37549 190982 17% /boot /dev/vdb 30963708 44992 29345852 1% /mnt/archive
10. Change ownership of the /mnt/archive
chown versa:versa /mnt/archive