Sunday, March 28, 2021

Want to delete all Thumbs.db recusively?

In a power shell run..

# to view

Get-ChildItem -Path . -Include Thumbs.db -Recurse -Name -Force

# to delete

Get-ChildItem -Path . -Include Thumbs.db -Recurse -Name -Force | Remove-Item -Force

Friday, March 12, 2021

Fedora 33 install latest kernel from koji

dnf install koji
koji list-builds --package=kernel --after="2021-03-01"
koji download-build --arch=x86_64 kernel-5.11.5-50.fc33
dnf update kernel-*.rpm


#source
#https://fedoraproject.org/wiki/Test_Day:2021-03-08_Kernel_5.11_Test_Week

Fedora 32 -> 33 Upgrade

dnf upgrade -y --refresh
dnf install -y dnf-plugin-system-upgrade
dnf system-upgrade download --releasever=33

dnf system-upgrade reboot

dnf system-upgrade clean
dnf clean packages



#source
#https://www.linuxjournal.com/content/how-upgrade-fedora-32-fedora-33-cli-graphical-methods

Same faster way to generate ramdom data and store into a file

openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt < /dev/zero > /tmp/randomfile.bin


#source, idea
#https://dev.to/thojest/comment/ilfi

Thursday, March 4, 2021

Fedora 32/33 time not synced

... this is now done via Chrony...

 

timedatectl
              Local time: Thu 2021-03-04 13:15:06 EST
           Universal time: Thu 2021-03-04 18:15:06 UTC
                 RTC time: Thu 2021-03-04 18:14:27
                Time zone: America/New_York (EST, -0500)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no


systemctl status systemd-timesyncd
systemd-timesyncd.service - Network Time Synchronization
     Loaded: loaded (/usr/lib/systemd/system/systemd-timesyncd.service; disabled; vendor preset: disabled)
     Active: inactive (dead)
       Docs: man:systemd-timesyncd.service(8)

systemctl start systemd-timesyncd
systemctl enable systemd-timesyncd
hwclock --systohc


timedatectl

              Local time: Thu 2021-03-04 13:16:06 EST
           Universal time: Thu 2021-03-04 18:16:06 UTC
                 RTC time: Thu 2021-03-04 18:16:27
                Time zone: America/New_York (EST, -0500)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

Tuesday, January 5, 2021

Specific drive IO stats grouped per time

> dstat -tdD total,sde 60
----system---- --dsk/sde----dsk/total-
            time     | read  writ       : read  writ
05-01 10:32:47 |                      :
05-01 10:33:47 | 9896k  112k : 630M  833M
05-01 10:34:00 |    11M     0   : 660M  994M

Friday, October 30, 2020

Check the open files limit and current for a process

> for p in $(pidof java); do printf "$p: "; ls -l /proc/$p/fd |wc -l; done
54055: 93
54008: 9


> for p in $(pidof java); do printf "$p: "; cat /proc/$p/limits |grep open; done
54055: Max open files            65536                65536                files
54008: Max open files            65536                65536                files

Friday, October 9, 2020

Compiler flags

want to find compiler flags supported by your CPU?

gcc -v -E -x c /dev/null -o /dev/null -march=native 2>&1 | grep /cc1

Saturday, August 8, 2020

LVM Raid10 on 4 HD with SSD cache

sdc/sdd are SSD, sde through sdh are 3TB HDD

vgcreate data_sata1 /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh


lvcreate --type raid10 -m 1 -i 2 --stripesize 1024k -l100%free -n plots data_sata1 /dev/sde /dev/sdf /dev/sdg /dev/sdh


lvcreate --type raid1 -m 1 -l 100%free -n cache data_sata1 /dev/sdc /dev/sdd

lvconvert --type cache --cachevol cache --cachemode writeback --chunksize 1024 data_sata1/plots

mkfs.xfs /dev/mapper/data_sata1-plots

Wednesday, July 29, 2020

LVM Looking up stripes and stripesize of logical volumes

lvs -o+lv_layout,stripes,stripesize
  LV    VG            Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Layout     #Str Stripe
  data  fedora_node-2 -wi-ao---- 400.00g                                                     linear        1     0
  data  fedora_node-2 -wi-ao---- 400.00g                                                     linear        1     0
  root  fedora_node-2 -wi-ao---- <33.45g                                                     linear        1     0
  root  fedora_node-2 -wi-ao---- <33.45g                                                     linear        1     0
  swap  fedora_node-2 -wi-ao----  15.73g                                                     linear        1     0
  plots scratch_nvme1 rwi-aor---  <1.82t                                                     raid,raid0    2  1.00m
  plots scratch_sata1 rwi-aor---   2.91t                                                     raid,raid0    4  1.00m
  plots scratch_sata2 rwi-aor---  <1.46t                                                     raid,raid0    4  1.00m

Tuesday, June 23, 2020

Test if a mounted drive works with timeout

timeout -k 10s -s SIGKILL 10 touch /mnt/disk1/foo

> this worked well with a stale NFS mount, yet need to test if works also with "hung" SATA/USB drive etc.

Find out to which HBA disks are connected to


[root@node-2d current]# udevadm info --query=path --name /dev/sdd
/devices/pci0000:00/0000:00:03.2/0000:10:00.0/host10/port-10:0/end_device-10:0/target10:0:0/10:0:0:0/block/sdd

[root@node-2d current]# lspci -v -s 10:00.0
10:00.0 Serial Attached SCSI controller: Broadcom / LSI SAS3008 PCI-Express Fusion-MPT SAS-3 (rev 02)
        Subsystem: Broadcom / LSI SAS9300-8i
        Flags: bus master, fast devsel, latency 0, IRQ 152
        I/O ports at d000 [size=256]
        Memory at f6e40000 (64-bit, non-prefetchable) [size=64K]
        Memory at f6e00000 (64-bit, non-prefetchable) [size=256K]
        Expansion ROM at f6d00000 [disabled] [size=1M]
        Capabilities: [50] Power Management version 3
        Capabilities: [68] Express Endpoint, MSI 00
        Capabilities: [a8] MSI: Enable- Count=1/1 Maskable+ 64bit+
        Capabilities: [c0] MSI-X: Enable+ Count=96 Masked-
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [1e0] Secondary PCI Express
        Capabilities: [1c0] Power Budgeting <?>
        Capabilities: [190] Dynamic Power Allocation <?>
        Capabilities: [148] Alternative Routing-ID Interpretation (ARI)
        Kernel driver in use: mpt3sas
        Kernel modules: mpt3sas


[root@node-2d current]# udevadm info --query=path --name /dev/sdc
/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:0a.0/0000:0e:00.0/ata8/host7/target7:0:0/7:0:0:0/block/sdc


[root@node-2d current]# lspci -v -s 02:00.0
02:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Matisse Switch Upstream (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0, IRQ 24
        Bus: primary=02, secondary=03, subordinate=0e, sec-latency=0
        I/O behind bridge: 0000f000-0000ffff [size=4K]
        Memory behind bridge: f6200000-f69fffff [size=8M]
        Prefetchable memory behind bridge: 00000000f2400000-00000000f2cfffff [size=9M]
        Capabilities: [50] Power Management version 3
        Capabilities: [58] Express Upstream Port, MSI 00
        Capabilities: [a0] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?>
        Capabilities: [270] Secondary PCI Express
        Capabilities: [370] L1 PM Substates
        Capabilities: [400] Data Link Feature <?>
        Capabilities: [410] Physical Layer 16.0 GT/s <?>
        Capabilities: [440] Lane Margining at the Receiver <?>
        Kernel driver in use: pcieport


Resources: