Replacing a Disk in a Zpool

ZFS is one of my favorite file systems. I use it at home on my nas server (running FreeBSD) as well as my Fedora 32 desktop. Today, I’m going to show you (and my future self) how to replace a (faulty) disk in a Zpool. The server I’ll be working on is nas2 and the pool is tank. List the status of the current pool. Password: root@nas2:~ # zpool status tank pool: tank state: DEGRADED status: One or more devices could not be opened. Sufficient replicas exist for the pool to continue functioning in a degraded state. action: Attach the missing device and online it using 'zpool online'. see: http://illumos.org/msg/ZFS-8000-2Q scan: resilvered 472K in 0 days 00:00:02 with 0 errors on Sun Aug 23 16:17:21 2020 config: NAME STATE READ WRITE CKSUM tank DEGRADED 0 0 0 mirror-0 DEGRADED 0 0 0 diskid/DISK-Z4Z46MXG ONLINE 0 0 0 620907994788427922 UNAVAIL 0 0 0 was /dev/diskid/DISK-Z1E4ZCM2 mirror-1 ONLINE 0 0 0 diskid/DISK-Z1E5PFCH ONLINE 0 0 0 diskid/DISK-Z4Z46XQP ONLINE 0 0 0 errors: No known data errors From the above output, we can see that one of the disk in mirro-0 vdev was missing. (In fact, it has been removed prior to the system rebooted. I also inserted a new disk to the system.) ...

September 20, 2020 · 3 min · 445 words · kenno

Managing Security Risk on RHEL 8

This blog post is mainly about my practicing of managing security risk on a RHEL system, especially learning how to use the occasionally option passed to YUM command. It is probably not a good resource teaching how to properly manage security risks in general. Identify all critical, important, and moderate security notices on this server. [root@puppet2 ~]# yum updateinfo --security Updating Subscription Management repositories. Red Hat Enterprise Linux 8 for x86_64 - Supplementary (RPMs) 21 kB/s | 2.1 kB 00:00 Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) 27 kB/s | 2.8 kB 00:00 Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) 475 B/s | 2.4 kB 00:05 EPEL8 x86_64 28 kB/s | 2.8 kB 00:00 Updates Information Summary: available 2 Security notice(s) 2 Important Security notice(s) Determine how many security-related packages are available for this machine. ...

June 30, 2020 · 3 min · 540 words · kenno

Create Disk Partition With GNU Parted

My favourite tool to create disk partitions on Linux is c[fg]disk. cfdisk used to create MBR based partition, and cgdisk is for GPT one. Today, I want to learn to use another tool called GNU Parted. After plugging an external disk, we can use udiskctl command to identify the disk device. # udisksctl status MODEL REVISION SERIAL DEVICE -------------------------------------------------------------------------- Samsung SSD 850 EVO 250GB EMT01B6Q S21MNXAG919308T sda ST2000DM001-1ER164 HP51 Z4Z46TMA sdb ST2000DM001-1ER164 HP51 Z4Z46W3E sdc Samsung SSD 850 EVO 250GB EMT01B6Q S21MNXAG919312Y sdd Samsung SSD 840 EVO 250G 0309 533144424E4541443837343335324120 sde The last Samsung SSD 840 (/dev/sde) is the one that I’m going to work with. ...

May 20, 2020 · 2 min · 419 words · kenno

Upgrading Kernel Issues and Fixes on Gentoo

Today I decided to upgrade the kernel (gentoo-sources) from 4.19.64 to 5.2.6 on my old ThinkPad X220. Apart from a few hiccups, everything went quite smoothly. I already have a blog post about upgrading the kernel on Gentoo, so I’ll skip many things here. First, ensure the sys-kernel/gentoo-sources-5.2.6 is installed: # emerge -av =sys-kernel/gentoo-sources-5.26 After the above package installed, we should be able to list it: ~ ❯❯❯ eselect kernel list Available kernel symlink targets: [1] linux-4.14.63-gentoo-r1 [2] linux-4.14.65-gentoo [3] linux-4.14.78-gentoo [4] linux-4.14.83-gentoo [5] linux-4.19.27-gentoo-r1 [6] linux-4.19.44-gentoo [7] linux-4.19.52-gentoo [8] linux-4.19.57-gentoo [9] linux-4.19.64-gentoo * [10] linux-5.2.6-gentoo Let’s select linux-5.2.6-gentoo as the version we’d like to switch to: ...

August 6, 2019 · 1 min · 204 words · kenno