Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
    • Ubuntu
    • LTSP
    • HowTo
    • BASH
      • Scripts
        • Bild-O-Mat.sh
        • Create thumbnail
        • Etope-O-Mat.sh
        • Fix file permissions
        • Linux Kernel Benchmark
        • SSH backup
        • connectToVPN.sh
        • copyCd.sh
        • formatCamcard.sh
        • mkBackupMx.sh
        • mkEbook.sh
        • mkHomeBackup.sh
        • mkNewsletterImg.sh
        • runPhotoshop.sh
        • setFileRights.sh
        • sshToHost.sh
      • check_http_access
      • extractEbook.sh
      • fdupes
      • fiXorg.sh
      • getUniqueFirstLetter.sh
      • mkBackup.sh
      • script-server
      • snippets
      • syncHome.sh
      • syncStore.sh
      • syncTs.sh
    • Backtrack
    • CUPS
    • CentOS
    • Debian
    • FreeNX
    • GRML
    • Gnome
    • Grub
    • IpFire
    • Kernel
    • Linux Lite
    • SSH
    • UEFI
    • dban
    • logrotate
    • parted
    • proxy
    • systemd
  • Hardware
  • Programming
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid
  • linux

Wipe all SAS disks

# wipe enclosure
screen -S badblocks
for DISK in $(lsblk -n -S | grep -v usb | cut -d" " -f1); do
    echo ${DISK}

    wipefs -a /dev/${DISK}
    badblocks -svw -b 16384 -c 65536 /dev/${DISK} -o /tmp/badblocks.${DISK}.log 2> /tmp/badblocks.${DISK}.out &
done

# show progress
grep done /tmp/badblocks.sd*.out
grep 0xaa /tmp/badblocks.sd*.out

# show errors
grep done /tmp/badblocks.sd*.log

<strong>Wipe all SAS disks (onliner)</strong>
<code>
lsblk -d -n -o NAME,TRAN | grep -v usb | cut -d' '  -f1 | xargs -I {} sudo wipefs -af /dev/{}
# extract audio from video file
IFS=$(echo -en "\n\b")
for i in $(ls /media/${USER}/*/*); do
    avconv -i $i -vn -c:a copy /tmp/${i##*/}.mp3
done

# join multiple PDF files
cd /media/*/Linux-Magazin*/pdf
for DIR in $(ls); do
    gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/tmp/lm2013-${DIR}.pdf ./${DIR}/*.pdf
done

# lm
for i in $(ls *.jpg); do
    convert -page A4 -density 72 $i $i.pdf
done

rm /tmp/lm20*.pdf 
for x in {01..12}; do
    pdftk lm13/c/cover-${x}-*.pdf lm13/pdf/${x}/*.pdf cat output /tmp/lm2013-${x}.pdf
done


# wipe enclosure
# 2th
for i in $(lsblk | grep 931 | cut -d" " -f1 | grep -v 1); do
    echo /dev/$i
    #wipefs -a /dev/$i
    #badblocks -svw -b 4096 -c 8192 /dev/$i -o badblocks.$i.log > badblocks.$i.out &
    ionice -c 3 dd if=/dev/zero of=/dev/$i bs=32M > dd.$i.out &
    #smartctl -t short /dev/$i
done

for i in $(lsblk  | grep 931  | cut -d" " -f1 | grep -v 1); do
    DEV=/dev/${i}

    DEV_SN=$(smartctl -i ${DEV} | egrep "Device Model|Serial Number" | cut -d":" -f2 |  awk '$1=$1' | paste -d" " - - | tr -s " " "_")
    OUTPUT="${DEV_SN}.txt"
    echo ${OUTPUT}

    sudo smartctl -d sat -a ${DEV} > "${OUTPUT}"
    egrep "Error.*occurred|Raw_Read_Error_Rate|Power_On_Hours|overall-health|self-tests|# 1" "${OUTPUT}"
done

for i in $(lsblk  | grep 931  | cut -d" " -f1 | grep -v 1); do
    parted -s -- /dev/${i} mklabel gpt
    echo -n "/dev/${i} "
done

for i in $(lsblk  | grep 931  | cut -d" " -f1); do
    parted /dev/${i} -s mklabel msdos
    parted /dev/${i} -s mkpart primary ext4 0% 100%
    mkfs.ext4 -L $(smartctl -i /dev/${i} | egrep "Serial Number" | cut -d":" -f2 |  awk '$1=$1') /dev/${i}1
done

# geth Health status
for DISK in $(lsblk -n -S | grep -v usb | cut -d" " -f1); do
    DEV=/dev/${DISK}

    smartctl -H ${DEV} | grep Health
done

Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung