Author: Bian Xi

Exporting swap space on TrueNAS

Exporting swap space on TrueNAS

There are quite number of swap partitions on TrueNAS. In short, swap are mirror partitions on /dev/sdX1, which is 2GB for each mirror, data partitions are on /dev/sdX2.

As the top information, it has not been used, so just leave it until performance impacted.

Total Space

Following screen shows 4GB swap space in top command

top - 16:31:05 up  5:26,  4 users,  load average: 11.79, 11.36, 10.90
Tasks: 540 total,   1 running, 538 sleeping,   0 stopped,   1 zombie
%Cpu(s):  0.8 us,  9.4 sy,  0.0 ni, 46.1 id, 43.1 wa,  0.0 hi,  0.5 si,  0.0 st
MiB Mem :  32052.4 total,  13522.1 free,  17935.6 used,    594.7 buff/cache
MiB Swap:   4096.0 total,   4096.0 free,      0.0 used.  13739.1 avail Mem

Devices

There are two partitions as swap

truenas# swapon
NAME      TYPE      SIZE USED PRIO
/dev/dm-0 partition   2G   0B   -2
/dev/dm-1 partition   2G   0B   -3
truenas#

Partitions

DM info, shows /dev/dm-0 and /dev/dm-1 map to md127 and md126.

truenas# dmsetup ls
md127   (253:0)
md126   (253:1)
truenas# dmsetup info /dev/dm-0
Name:              md127
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        2
Event number:      0
Major, minor:      253, 0
Number of targets: 1
UUID: CRYPT-PLAIN-md127

truenas# dmsetup info /dev/dm-1
Name:              md126
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        2
Event number:      0
Major, minor:      253, 1
Number of targets: 1
UUID: CRYPT-PLAIN-md126

truenas#

MD info

Total 4 partitions involve, mirror into 2 raid1 devices.

Reported by proc

truenas# cat /proc/mdstat      
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md126 : active raid1 sde1[1] sdd1[0]
      2097152 blocks super non-persistent [2/2] [UU]

md127 : active raid1 sdc1[1] sdb1[0]
      2097152 blocks super non-persistent [2/2] [UU]

unused devices: <none>
truenas#

Reported by mdadm

truenas# mdadm --detail /dev/md127
/dev/md127:
           Version : 
     Creation Time : Wed Oct  6 11:08:56 2021
        Raid Level : raid1
        Array Size : 2097152 (2.00 GiB 2.15 GB)
     Used Dev Size : 2097152 (2.00 GiB 2.15 GB)
      Raid Devices : 2
     Total Devices : 2

             State : clean 
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : resync

    Number   Major   Minor   RaidDevice State
       0       8       17        0      active sync   /dev/sdb1
       1       8       33        1      active sync   /dev/sdc1
truenas# mdadm --detail /dev/md126
/dev/md126:
           Version : 
     Creation Time : Wed Oct  6 11:08:57 2021
        Raid Level : raid1
        Array Size : 2097152 (2.00 GiB 2.15 GB)
     Used Dev Size : 2097152 (2.00 GiB 2.15 GB)
      Raid Devices : 2
     Total Devices : 2

             State : clean 
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : resync

    Number   Major   Minor   RaidDevice State
       0       8       49        0      active sync   /dev/sdd1
       1       8       65        1      active sync   /dev/sde1
truenas#

Block device info

Structure of partitions

truenas# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda           8:0    0   1.4T  0 disk  
├─sda1        8:1    0     2G  0 part  
└─sda2        8:2    0   1.4T  0 part  
sdb           8:16   0   7.3T  0 disk  
├─sdb1        8:17   0     2G  0 part  
│ └─md127     9:127  0     2G  0 raid1 
│   └─md127 253:0    0     2G  0 crypt [SWAP]
└─sdb2        8:18   0   7.3T  0 part  
sdc           8:32   0 298.1G  0 disk  
├─sdc1        8:33   0     2G  0 part  
│ └─md127     9:127  0     2G  0 raid1 
│   └─md127 253:0    0     2G  0 crypt [SWAP]
└─sdc2        8:34   0 296.1G  0 part  
sdd           8:48   0 232.9G  0 disk  
├─sdd1        8:49   0     2G  0 part  
│ └─md126     9:126  0     2G  0 raid1 
│   └─md126 253:1    0     2G  0 crypt [SWAP]
└─sdd2        8:50   0 230.9G  0 part  
sde           8:64   0 298.1G  0 disk  
├─sde1        8:65   0     2G  0 part  
│ └─md126     9:126  0     2G  0 raid1 
│   └─md126 253:1    0     2G  0 crypt [SWAP]
└─sde2        8:66   0 296.1G  0 part  
sdf           8:80   1  14.9G  0 disk  
├─sdf1        8:81   1     1M  0 part  
├─sdf2        8:82   1   512M  0 part  
└─sdf3        8:83   1  14.4G  0 part  
zd0         230:0    0    20G  0 disk  
truenas# 

zpool structure

List all zpool

truenas# zpool list
NAME        SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
boot-pool    14G  3.70G  10.3G        -         -     2%    26%  1.00x    ONLINE  -
pool0       296G  9.13G   287G        -         -     1%     3%  1.00x    ONLINE  /mnt
pool1      1.36T   383G  1009G        -         -    16%    27%  1.09x    ONLINE  /mnt
pool2      7.27T  1.12T  6.14T        -         -     2%    15%  1.10x    ONLINE  /mnt
pool3       230G  2.63G   227G        -         -     0%     1%  1.00x    ONLINE  /mnt
truenas#

For individual pool, can use following command find out partition info

truenas# zpool status pool0 -v
  pool: pool0
 state: ONLINE
status: Some supported and requested features are not enabled on the pool.
    The pool can still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
    the pool may no longer be accessible by software that does not support
    the features. See zpool-features(7) for details.
  scan: resilvered 600K in 00:00:03 with 0 errors on Mon Oct  4 04:49:30 2021
config:

    NAME                                      STATE     READ WRITE CKSUM
    pool0                                     ONLINE       0     0     0
      mirror-0                                ONLINE       0     0     0
        bf410fcf-2209-11ec-b8aa-001132dbfc9c  ONLINE       0     0     0
        bfcc498a-2209-11ec-b8aa-001132dbfc9c  ONLINE       0     0     0

errors: No known data errors
truenas#

find partition by id

zpool list doesn't have partition name, only got partition id, use following command to find out mapping partition id.

truenas# ls -l /dev/disk/by-partuuid
total 0
lrwxrwxrwx 1 root root 10 Oct  6 11:05 0e8d0027-65cc-4fa5-bb68-7d91668ca1f4 -> ../../sdf1
lrwxrwxrwx 1 root root 10 Oct  6 11:05 41ba87d7-2137-11ec-9c17-001132dbfc9c -> ../../sdb1
lrwxrwxrwx 1 root root 10 Oct  6 11:05 41cbb8fa-2137-11ec-9c17-001132dbfc9c -> ../../sdb2
lrwxrwxrwx 1 root root 10 Oct  6 11:05 5626c0ae-2137-11ec-9c17-001132dbfc9c -> ../../sdd1
lrwxrwxrwx 1 root root 10 Oct  6 11:05 563bbde1-2137-11ec-9c17-001132dbfc9c -> ../../sdd2
lrwxrwxrwx 1 root root 10 Oct  6 11:05 672278c8-92bc-4e99-8158-25e53eb085c9 -> ../../sdf2
lrwxrwxrwx 1 root root 10 Oct  6 11:05 757ce69e-207a-11ec-afcf-005056a390b2 -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct  6 11:05 75827da1-207a-11ec-afcf-005056a390b2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct  6 11:05 bf3063db-2209-11ec-b8aa-001132dbfc9c -> ../../sdc1
lrwxrwxrwx 1 root root 10 Oct  6 11:05 bf410fcf-2209-11ec-b8aa-001132dbfc9c -> ../../sdc2
lrwxrwxrwx 1 root root 10 Oct  6 11:05 bfb5835e-2209-11ec-b8aa-001132dbfc9c -> ../../sde1
lrwxrwxrwx 1 root root 10 Oct  6 11:05 bfcc498a-2209-11ec-b8aa-001132dbfc9c -> ../../sde2
lrwxrwxrwx 1 root root 10 Oct  6 11:05 e384f2ee-96dd-4b1b-ac68-8fe14ea92797 -> ../../sdf3
truenas#

Reuse ASUS P9X79 DELUXE motherboard

Reuse ASUS P9X79 DELUXE motherboard

CPU

ASUS Info

P9X79 DELUXE

Following CPUs are supported

Core i7-3820 (3.6G,L3:10M,4C,HT,rev.M0)
Core i7-3820 (3.6G,L3:10M,4C,HT,rev.M1)
Core i7-3930K (3.2G,L3:12M,6C,HT,rev.C1)
Core i7-3930K (3.2G,L3:12M,6C,HT,rev.C2)
Core i7-3960X Extreme Edition(3.3G,L3:15M,6C,HT,rev.C1)
Core i7-3960X Extreme Edition(3.3G,L3:15M,6C,HT,rev.C2)
Core i7-3970X Extreme Edition(3.5G,L3:15M,6C,HT,150W,rev.C2)
Core i7-4820K (3.7GHz, L3:10M, 4C, HT, 130W, rev.S1)
Core i7-4930K (3.4GHz, L3:12M, 6C, HT, 130W, rev.S1)
Core i7-4960X (3.6G, L3:15M, 6C, HT, 130W, rev.S1)

Following CPUs are partially supported as description below

Intel Xeon Processor Family is designed for servers. Some features may not support when installed on X79 series chipsets. For more details, refer to ASUS support site at http://support.asus.com.

Intel Xeon E5-1620 v2 (3.7G,130W,L3:10M,4C,HT)
Intel Xeon E5-1650 v2 (3.5G,130W,L3:12M,6C,HT)
Intel Xeon E5-1660 v2 (3.7G,130W,L3:15M,6C,HT)
Intel Xeon E5-2603 v2 (1.8G,80W,L3:10M,4C,HT)
Intel Xeon E5-2609 v2 (2.5G,80W,L3:10M,4C,HT)
Intel Xeon E5-2620 v2 (2.1G,80W,L3:15M,6C,HT)
Intel Xeon E5-2630 v2 (2.6G,80W,L3:15M,6C,HT)
Intel Xeon E5-2630L v2 (2.4G,60W,L3:15M,6C,HT)
Intel Xeon E5-2637 v2 (3.5G,130W,L3:15M,4C,HT)
Intel Xeon E5-2640 v2 (2.0G,95W,L3:20M,8C,HT)
Intel Xeon E5-2643 v2 (3.5G,130W,L3:25M,6C,HT)
Intel Xeon E5-2650 v2 (2.6G,95W,L3:20M,8C,HT)
Intel Xeon E5-2650L v2 (1.7G,70W,L3:25M,10C,HT)
Intel Xeon E5-2660 v2 (2.2G,95W,L3:25M,10C,HT)
Intel Xeon E5-2667 v2 (3.3G,130W,L3:25M,8C,HT)
Intel Xeon E5-2670 v2 (2.5G,115W,L3:25M,10C,HT)
Intel Xeon E5-2680 v2 (2.8G,115W,L3:25M,10C,HT)
Intel Xeon E5-2687W v2 (3.4G,150W,L3:20M,8C,HT)
Intel Xeon E5-2690 v2 (3.0G,130W,L3:25M,10C,HT)
Intel Xeon E5-2695 v2 (2.4G,115W,L3:30M,12C,HT)
Intel Xeon E5-2697 v2 (2.7G,130W,L3:30M,12C,HT)

Intel Info

Compatibility for FCLGA2011, FCLGA2011-v3, and FCLGA2066 Sockets (Intel® Core™ X-series Processors)

FCLGA2011 socket compatibility

These processors are compatible with the FCLGA2011 socket. They are backward and forward compatible with the motherboard supporting FCLGA2011 socket. We recommend you always download the latest BIOS from the motherboard vendor when installing a new processor. For any issues, please check with your board manufacturer to see if your board is compatible with the processor you intend to use.

Intel® Core™ i7-4960X Processor Extreme Edition
Intel® Core™ i7-4930K / i7-4820K Processors
Intel® Core™ i7-3960X / i7-3970X Processor Extreme Edition
Intel® Core™ i7-3930K / i7-3820 Processors

Memory

CORSAIR Vengeance 32GB (4 x 8GB) 240-Pin DDR3 SDRAM DDR3 1600 (PC3 12800) Desktop Memory Model CMZ32GX3M4X1600C10

Final result

CPU Info

lscpu output

Memory

Memory and Performance

References

P9X79 DELUXE

Automator in MacOS Basic

Automator in MacOS Basic

To automate tasks in MacOS, Automator can be used. For example, convert selected images to JPG format, the steps as below

Create new task

Run Automator

Select Quick Action

Select action

Find out action Change Type of Images

Set actions' options

Select Show this action when workflow runs

Save

Run in Finder

In Finder, select images, then select Services menu can be found after clicked following icon, then follow steps.

Services Menu

Rename Action

Right click on Action name in Automator, select Services, then rename the action.

Delete Action

Right click on Action name in Automator, select Services, then delete the action.

Screen Capture

Screen Capture

iMac 27″ Video Card Repair Using Heat Gun

iMac 27" Video Card Repair Using Heat Gun

Refering to some YouTube video, I tried to repair my iMac 27" (Mid 2011) Video Card, because my iMac could not boot and only apple logo appears. Steps as below

Hardware Info

Information
Identifier iMac12,2
Model A1312 (EMC 2429)
Family iMac (27-inch, Mid 2011)
CPU 3.4 GHz Intel Core i7
Graphic AMD Radeon HD 6970M 2048 MB

Steps

Take out glass panel

Use sucker to take it out.

Take out screen

Got 8 screws.

Take out power supply

Power Supply Cable Connectors

Power Supply Screws

Left of Power Supply

Take out CDROM Drive

CD Drive

CD Temperature Sensor

Take out fan

Fan

Fan (no screw)

Take out main board

Mainboard Battery

Mainboard Screws

Mainboard Below Fan

Below Fan

Below Fan Cables

Bottom

Infra-ray

Mainboard Wifi

Speaker

Speaker Cable

Speaker Connection

Just for info

Battery

Take out main board back cable

Mainboard Back

Mainboard Back Unplug

Take out video card

Video Fan

Right Top Video Card

GPU

GPU Back

GPU Heat Sink

GPU Heat Sink Screws

GPU Screws

GPU no Screw

Damages

The video card to LCD screen cable damaged, bought new one, waiting for delivery.

Damaged Cable

LCD Cable

Working now

Oct 13, After purchased cable, replace it, works immeditially, then continue OS reinstallation.

Future use

Due to this machine is too hot, I think better only use it in aircon room, and no background service should be executed.

References

My iMac is different model as below, but similar.

A1312 iMac GPU Replacement
Late 2009 iMac 27" Video Card Repair — 4850 — 2nd Bake

Rsync Basic

Rsync Basic

rsync a directory to a new directory with different name

A trailing slash on the source avoids creating an additional directory level at the destination.

rsync -a src/ dest

You can think of a trailing / on a source as meaning "copy the contents of this directory" as opposed to "copy the directory by name".

Show progress

rsync -a -P src dest
rsync -a --progress src dest

Location of core files in Linux

Location of core files in Linux

Some core files are in the executable file running directory, some core files are in system directory, depending on the system configuration.

Filename

By default, the core file name is core only, different OSs change it's name.

Software

Abrt

Abrt stores core files in /var/cache/abrt.

Apport

Apport stores core files in /var/crash.

Systemd

Systemd updated /proc/sys/kernel/core_pattern as below.

$ cat /proc/sys/kernel/core_pattern
|/usr/lib/systemd/systemd-coredump %p %u %g %s %t %e

OS

TrueNAS Scale

The core files in Linux can be found in /var/db/system/cores/, they can be removed if no debugging required.

Fedora

Fedora store core files in /var/spool/abrt/ instead

Archlinux

Archlinux stores core files in /var/lib/systemd/coredump/