GNU/Linux >> Belajar Linux >  >> Linux

Cara Membuat/Menghapus dan Memasang Sistem File Stratis di CentOS/RHEL 8

"stratis" adalah manajer volume baru yang diperkenalkan dalam rilis CentOS/RHEL 8. Posting ini menguraikan langkah-langkah untuk membuat atau menghapus sistem file stratis baru di sistem CentOS/RHEL 8. Kita juga akan melihat cara memasang dan meng-umount sistem file stratis di postingan ini.

Membuat dan memasang sistem file stratis

1. Instal paket Stratis:

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

2. Aktifkan dan mulai layanan stratisd:

# systemctl enable --now stratisd
# systemctl start stratisd

Verifikasi status layanan stratisd:

# 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. Buat kumpulan:

# stratis pool create Stratis_Test /dev/sdb

Verifikasi kumpulan yang baru saja Anda buat:

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

4. Buat sistem file pada kumpulan “Stratis_Test” yang baru dibuat:

# stratis filesystem create Stratis_Test x01

Verifikasi pembuatan sistem file:

# 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. Buat titik mount dan mount sistem file:

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

Verifikasi:

# 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
Catatan :Jika diperlukan untuk menambahkan lebih banyak blockdev ke kumpulan yang ada, lanjutkan dengan langkah 6.

6. Tambahkan lebih banyak blockdev ke kumpulan yang ada:

Sintaks :

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

Dalam kasus kami, perintahnya adalah:

# 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

Mount sistem file secara otomatis

1. Periksa UUID:

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

2. Tulis UUID ke dalam 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
Catatan :Jika sistem file sudah terpasang, lanjutkan ke langkah 3, jika belum, lakukan langkah 4.

3. Umount titik pemasangan:

# umount /x01

4. Pasang titik pemasangan menggunakan /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

Menghapus sistem file Stratis

1. Periksa kumpulan dan konfigurasi sistem file:

# 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 filesystem dan distroy filesystem dan kemudian pool.

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

3. Verifikasi:

# 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


Linux
  1. Cara membuat dan mengaktifkan Partisi Swap di Centos / RHEL 8

  2. Bagaimana Cara Membuat File Dan Memasangnya Sebagai Sistem File?

  3. Cara Menghapus Antarmuka virbr0 dan lxcbr0 di CentOS/RHEL 6,7

  1. Cara membuat wadah LXC menggunakan lxcbr0 dan virbr0 di CentOS/RHEL

  2. Cara Menambah dan Menghapus Memori Logis di CentOS/RHEL 7

  3. Cara Menginstal dan mengkonfigurasi telnet di RHEL / CentOS 5,6

  1. Cara Mount dan Unmount Filesystem/Partition di Linux (Contoh Perintah Mount/Umount)

  2. CentOS / RHEL 7 :Cara Membuat dan Menghapus Mirror LVM Menggunakan lvconvert

  3. CentOS / RHEL :Cara membuat dan menghosting repositori yum melalui httpd