Resize Storage in Centos7

Recently one of the VirtualBox system (OS is Centos7) is running out of space, so trying to enlarge the storage. Change disk/snapshot size in VirtualBox Open Vitual Media Manager Select the disk or snapshot to be resized, current is 20GB Enter the new size 40GB and click Apply turn on the system, and check with lsblk # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 40G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 19G 0 part ├─centos-root 253:0 0 17G 0 lvm / └─centos-swap 253:1 0 2G 0 lvm [SWAP] Allocate the Free Space Enter command cfdisk Select the Free Space one Select New and Press Enter Select Primary and Press Enter Update Size or keep default to use full free space, and Press Enter Select Write and type yes to write the partition table to disk Select Quit to exit from cfdisk Extend partition # fdisk /dev/sda Enter p to print the initial partition table Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 41943039 19921920 8e Linux LVM /dev/sda3 41943040 83886079 20971520 83 Linux Enter t then 3 then 8e to change the new partion type to “Linux LVM” Enter p to print the new partition table Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 41943039 19921920 8e Linux LVM /dev/sda3 41943040 83886079 20971520 8e Linux LVM Enter w to write the partition table to disk Update kernel in-memory partition table Update the kernel in-memory partition table, and we can see sda3

How to Create Site With Hugo

Install hugo on Centos7 Add epel repo The Hugo package can be found at https://copr.fedorainfracloud.org/coprs/daftaupe/hugo/, take the correct version, and place it in /etc/yum.repos.d/hugo.repo vim /etc/yum.repos.d/hugo.repo # add content below the file [copr:copr.fedorainfracloud.org:daftaupe:hugo] name=Copr repo for hugo owned by daftaupe baseurl=https://download.copr.fedorainfracloud.org/results/daftaupe/hugo/epel-7-$basearch/ type=rpm-md skip_if_unavailable=True gpgcheck=1 gpgkey=https://download.copr.fedorainfracloud.org/results/daftaupe/hugo/pubkey.gpg repo_gpgcheck=0 enabled=1 enabled_metadata=1 Install yum -y install hugo hugo version Quick start # Create a new site hugo new site mysite # Add a Theme cd mysite git init git submodule add https://github.

Mount S3 Bucket to a Local System

In this exercise, we will try to mount s3 to local system with s3fs package. Mount the s3 bucket to local directory aws configure aws s3 mb s3://testbucket sudo cp -r ~/.aws /root # install s3fs sudo yum install s3fs-fuse -y mkdir /mnt/s3data sudo s3fs {BUCKET_name} /mnt/s3data -o allow_other -o default_acl=public-read -o use_cache=/tmp/s3fs echo "<html><h1>test</h1><html>" > index.html #check file in local folder and s3 ll /mnt/s3data aws s3 ls s3://{BUCKET_name} Access the s3 bucket data from Docker Container Once mounted we can access the data in a container as well

Add Disk Storage to VirtualBox on Centos7

Add the Virtual Dirve Open Oracle VM VirtualBox Manager, select the virtual box which we want to add the storage, click Settings Click Storage, Select Drive (Controller: SCSI or Controller: IDE etc.) and click Adds hard disk Follow the instructions to enter all the details, such as disk file location, size etc. Partition the New Drive and file system # the new driver assigned to /dev/sdb ls /dev/sd* /dev/sda /dev/sda1 /dev/sda2 /dev/sdb # partition with fdisk fdisk /dev/sdb # change: DOS Compatibility flag is not set (command 'c') and Changing display/entry units to sectors (command 'u') # enter n (new partion) , p(primary partition), 1 (partition number) ls /dev/sd* /dev/sda /dev/sda1 /dev/sda2 /dev/sdb /dev/sdb1 # create a file system /sbin/mkfs.