DEV Community

Cover image for Attaching Volume to a Linux Instance (EC2) cmd
3 1

Attaching Volume to a Linux Instance (EC2) cmd

1-lsblk ( List Block )
This command lists information regarding all available block devices attached to an instance and it does that by reading sysfs filesystem

Image description

2- file -s
This is used to check if a volume has file system. This command gather information about a specific device such as system type.When the ouput shows "data", this means the device has no file system on the device.

Image description

3- mkfs ( Make File System)
This command is used to create file in linux. when combined with -t=type (mkfs-t), it specified the file type

Image description

4-mount
This command is used to attaches the file system to a volume to the file tree. It is used to mount the volume at the directory created using the mkdir command.

Image description

5-/etc/fstab
This command is used to automatically mount a volume after reboot.

To mount an attached EBS volume on every system reboot, add an entry for the device to the /etc/fstab file. You can use the device name, such as /dev/xvdf, but using the device's 128-bit universally unique identifier (UUID) is the recommended method. You can open and edit the /etc/fstab using an editor such as nano or vim.

Image description

6- blkid (block ID)

The blkid (block ID) command identifies the 128-bit universally unique identifier (UUID) of the device.
Use the blkid command to identify the UUID, and make a note of the UUID of the device that you want to mount after reboot. Then add the UUID to the /etc/fstab file. (See the following item for for an explanation of the /etc/fstab file.)

Device names can change, but the UUID persists throughout the life of the partition. By using the UUID, you reduce the chances that the system becomes unbootable after a hardware reconfiguration.

Image description

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post