• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How To Create/Remove and Mount a Stratis Filesystem in CentOS/RHEL 8

by admin

“stratis” is the new volume manager introduced in the CentOS/RHEL 8 release. This post outlines steps to create or remove a new stratis filesystem in CentOS/RHEL 8 system. We will also see how to mount and umount a stratis filesystem in this post.

Creating and mounting a stratis filesystem

1. Install Stratis packages:

# rpm -qa | grep "strati*"
stratisd-1.0.3-1.el8.x86_64
stratis-cli-1.0.2-1.el8.noarch

2. Enable and start the stratisd service:

# systemctl enable --now stratisd
# systemctl start stratisd

Verify the status of the stratisd service:

# systemctl status stratisd
● stratisd.service - A daemon that manages a pool of block devices to create flexible filesystems
Loaded: loaded (/usr/lib/systemd/system/stratisd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-08-19 17:12:11 EDT; 1s ago
Docs: man:stratisd(8)
Main PID: 8642 (stratisd)
Tasks: 1 (limit: 26213)
Memory: 876.0K
CGroup: /system.slice/stratisd.service
└─8642 /usr/libexec/stratisd --debug

3. Create a pool:

# stratis pool create Stratis_Test /dev/sdb

Verify the pool you just created:

# stratis pool list
Name Total Physical Size Total Physical Used
Stratis_Test 1.09 GiB 52 MiB

4. Create a filesystem on the newly created “Stratis_Test” pool:

# stratis filesystem create Stratis_Test x01

Verify the filesystem creation:

# stratis filesystem list
Pool Name Name Used Created Device UUID
Stratis_Test x01 546 MiB Aug 19 2019 17:19 /stratis/Stratis_Test/x01 aa24d4adfd4342e38a1ffe0c5e7debe6

5. Create a mount point and mount the filesystem:

# mkdir /x01
# mount /stratis/Stratis_Test/x01 /x01

Verify:

# df -h | grep /x01
/dev/mapper/stratis-1-6c2cd4f86a58439f9f1aa6a004b919db-thin-fs-aa24d4adfd4342e38a1ffe0c5e7debe6 1.0T 7.2G 1017G 1% /x01
# grep x01 /proc/mounts
/dev/mapper/stratis-1-50fb0bbeb3e24ceaafd7be90917208df-thin-fs-9b9d33fac8734406907283fde7567889 /x01 xfs rw,seclabel,relatime,attr2,inode64,sunit=2048,swidth=2048,noquota 0 0
Note: If it is needed to add more blockdevs to an existing pool proceed with step 6.

6. Add more blockdevs to an existing pool:

Syntax:

pool add-data [pool_name] [blockdev] [[blockdev]..]
Add one or more blockdevs to an existing pool, to enlarge its storage capacity.

In our case the command would be:

# stratis pool add-data Stratis_Test /dev/sdb
# stratis pool list
Name Total Physical Size Total Physical Used
Stratis_Test 1.09 GiB 598 MiB ----------------

# stratis filesystem list
Pool Name Name Used Created Device UUID
Stratis_Test x01 546 MiB Aug 19 2019 17:19 /stratis/Stratis_Test/x01 aa24d4adfd4342e38a1ffe0c5e7debe6

# stratis blockdev list
Pool Name Device Node Physical Size State Tier
Stratis_Test /dev/sdb 1.09 GiB In-use Data

Auto Mount the filesystem

1. Check the UUID:

# blkid -p /stratis/Stratis_Test/x01
/stratis/Stratis_Test/x01: UUID="aa24d4ad-fd43-42e3-8a1f-fe0c5e7debe6" TYPE="xfs" USAGE="filesystem"

2. Write the UUID into the file /etc/fstab:

# echo "UUID="aa24d4ad-fd43-42e3-8a1f-fe0c5e7debe6 /x01 xfs defaults 0 0" >> /etc/fstab
# cat /etc/fstab
/dev/mapper/ol-root / xfs defaults 0 0 
UUID=0c39942a-a85b-454c-bdbc-44443874241e /boot xfs defaults 0 0
/dev/mapper/ol-swap swap swap defaults 0 0
UUID=9b9d33fa-c873-4406-9072-83fde7567889 /x01 xfs defaults 0 0
Note: If you already have the filesystem mounted, proceed to step 3, if not, do step 4.

3. Umount the mount point:

# umount /x01

4. Mount the mount point using /etc/fstab:

# mount -a
# df -h | grep x01
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/stratis-1-6c2cd4f86a58439f9f1aa6a004b919db-thin-fs-aa24d4adfd4342e38a1ffe0c5e7debe6 1.0T 7.2G 1017G 1% /x01

Removing a Stratis filesystem

1. Check the pool and filesystem configuration:

# stratis pool list
Name Total Physical Size Total Physical Used
Stratis_Test 1.09 GiB 598 MiB 
# stratis filesystem list
Pool Name Name Used Created Device UUID
Stratis_Test x01 546 MiB Aug 19 2019 17:19 /stratis/Stratis_Test/x01 aa24d4adfd4342e38a1ffe0c5e7debe6
# stratis blockdev list
Pool Name Device Node Physical Size State Tier
Stratis_Test /dev/sdb 1.09 GiB In-use Data

2. Umount the filesystem and distroy filesystem and then the pool.

# umount /x01
Destroy the stratis filesystem/pool
# stratis fs destroy Stratis_Test x01
# stratis pool destroy Stratis_Test

3. Verify:

# stratis pool list
Name Total Physical Size Total Physical Used
# stratis filesystem list
Pool Name Name Used Created Device UUID
# stratis blockdev list
Pool Name Device Node Physical Size State Tier

Filed Under: CentOS/RHEL 8, Linux

Some more articles you might also be interested in …

  1. trust Command Examples in Linux
  2. Archiving Failures with ORA-16038, ORA-19504, ORA-00312
  3. scriptreplay Command Examples in Linux
  4. partx: command not found
  5. mandb: command not found
  6. sic Command Examples in Linux
  7. “az redis” Command Examples
  8. apt-cache: command not found
  9. dnsrecon: command not found
  10. How to Disable “alt+ctrl+Del” Key Combination causing reboot in CentOS/RHEL 4,5

You May Also Like

Primary Sidebar

Recent Posts

  • batch: Execute commands at a later time when the system load levels permit
  • bat: Print and concatenate files
  • bastet: Clone of the game Tetris in the terminal
  • bashmarks: Save and jump to commonly used directories using 1 character commands

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright