Auto reboot after kernel panic

By default after a kernel panic, Linux kernel just waits there for a system administrator to hit the restart or powercycle button.  This is because of the value set on “kernel.panic” parameter.

[root@linux23 ~]# cat /proc/sys/kernel/panic 
[root@linux23 ~]# sysctl -a | grep kernel.panic
kernel.panic = 0

To disable this and make the Linux OS reboot after a kernel panic, we have to set an integer N greater than zero to the parameter “kernel.panic”, where “N” is the number of seconds to wait before a automatic reboot.

For example , if you set N = 10 , then the system waits for 10 seconds before automatic reboot. To make this permanent, edit /etc/sysctl.conf and set it.

[root@linux23 ~]# echo 10 > /proc/sys/kernel/panic
[root@linux23 ~]# grep kernel.panic /etc/sysctl.conf kernel.panic = 10

This helps in preventing manual intervention after a kernel panic. Setup some kernel dump or netdump to capture the kernel crash debug information.

pfSense – Update Realtek driver v1.95

Download driver:
jselec mirror:

Unzip & Place “if_re.ko” file at “/boot/kernel

Change ownership and permissions on the if_re.ko file

chown root:wheel if_re.ko
chmod 0555 if_re.ko

Then edit “/boot/loader.conf” to add this line:



Then go to diagnostics > command prompt in the WebGUI

Run the command


If you did everything properly you’ll see “if_re.ko” in the list that comes up. If not, the driver isn’t loaded.

(i didn’t get it loaded myself. Added the line of code to /boot/defaults/loader.conf Then it worked for me)


Proxmox – Add external usb drive to LXC container

How to mount an external USB(3) drive to a LXC container

In this example we make use of a Western Digital 1TB external USB3 drive.
This device is NTFS formatted, which is easy to handle in Windows.

Our container is used for samba services and has ID 102.

At the host system (Proxmox)

– Check which device the drive has been given on the host.
lsblk (in this case ‘sdg’, partition ‘sdg1’)

– Add a mounting location
mkdir /mnt/ext-usb

– Install the ntfs-3g package
apt-get update && apt-get install ntfs-3g

– Mount the disk to the mountlocation
mount -t ntfs-3g /dev/sdg1 /mnt/ext-usb

Op LXC client (container)

– Add a mount location inside the LXC container
mkdir /mnt/ext-usb


At the host

– Mount the drive to the container in this example we use mp1 (check if mp1 is not allready used!)
pct set 102 -mp1 /mnt/ext-usb,mp=/mnt/ext-usb


pfSense book available to everyone

Today, Netgate made the pfSense book available for everyone for free.
In the past this was a privelage to Gold-subscribers only. The book contains the complete documentation, made by Netgate with help from community supporters.
This book is available in PDF and ePub version.

View the news artical brought by Netgate at:

Interesting? Looking for a compact machine which can run this great software?
Read also my other article on pfSense. My comments on installing on a Zotac Zbox Ci327

PfSense on Zotac Zbox CI327

Some helpfull notes when installing pfSense on your Zotac Zbox CI327.

Install from usb stick

  • Preparing the drive
  • Download pfsense image
  • Write image to drive

Known problems you can run in to.

CI327 has Realtek NIC’s. For the best performance, you need to tweak some settings in the Gui:


  • CHECK Disable hardware checksum offload
  • CHECK Disable hardware TCP segmentation offload
  • CHECK Disable hardware large receive offload

Hanging during boot time

Boot hangs showing the following line:

Timecounter “HPET” frequency 19200000 Hz quality 950

You can solve this by disabling in Bios:
/Features/CPU Configuration/Monitor M-Wait -> disabled



Configure proxmox email notification

Follow the steps below to configure the Proxmox email notification.

  1. Install the authentication library:
    apt-get install libsasl2-modules
  2. If Gmail has 2FA enabled, go to App Passwords and generate a new password just for Proxmox
  3. Create a password file:
    nano /etc/postfix/sasl_passwd
  4. Insert your login details:
  5. Save the password file
  6. Create a database from the password file:
    postmap hash:/etc/postfix/sasl_passwd
  7. Protect the text password file:
    chmod 600 /etc/postfix/sasl_passwd
  8. Edit the postfix configuration file:
    nano /etc/postfix/
  9. Add/change the following (certificates can be found in /etc/ssl/certs/):
    relayhost =
    smtp_use_tls = yes
    smtp_sasl_auth_enable = yes
    smtp_sasl_security_options =
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_tls_CAfile = /etc/ssl/certs/Entrust_Root_Certification_Authority.pem
    smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
    smtp_tls_session_cache_timeout = 3600s
  10. Reload the updated configuration:postfix reload


echo "test message" | mail -s "test subject"

Proxmox ZFS Failed To Import Pool ‘rpool’

  • boot into emergency mode (in the grub menu, hit “e”, and add ” emergency” to the end of the line starting with “linux”, then press ctrl+x)
  • if needed, manually import your rpool in the initramfs prompt like you did in your first post (“zpool import -N rpool” followed by “exit”)
  • enter your root password when prompted to enter maintenance/emergency mode
  • disable the zfs-import-scan.service (“systemctl disable zfs-import-scan”)
  • continue the boot (“exit” or ctrl+d)

now you should be able to install the update with the fix, and then re-enable the zfs-import-scan service (“systemctl enable zfs-import-scan”) and reboot the host. I would recommend regenerating the initramfs (“update-initramfs -u”). if you are still dropped into the initramfs prompt after that, I would be very interested in your “pveversion -v” output and your grub config (“/boot/grub/grub.cfg”).

ZFS cheat sheet

Pool Related Commands

# zpool create datapool c0t0d0Create a basic pool named datapool
# zpool create -f datapool c0t0d0Force the creation of a pool
# zpool create -m /data datapool c0t0d0Create a pool with a different mount point than the default.
# zpool create datapool raidz c3t0d0 c3t1d0 c3t2d0Create RAID-Z vdev pool
# zpool add datapool raidz c4t0d0 c4t1d0 c4t2d0Add RAID-Z vdev to pool datapool
# zpool create datapool raidz1 c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0Create RAID-Z1 pool
# zpool create datapool raidz2 c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0Create RAID-Z2 pool
# zpool create datapool mirror c0t0d0 c0t5d0Mirror c0t0d0 to c0t5d0
# zpool create datapool mirror c0t0d0 c0t5d0 mirror c0t2d0 c0t4d0disk c0t0d0 is mirrored with c0t5d0 and disk c0t2d0 is mirrored withc0t4d0
# zpool add datapool mirror c3t0d0 c3t1d0Add new mirrored vdev to datapool
# zpool add datapool spare c1t3d0Add spare device c1t3d0 to the datapool
## zpool create -n geekpool c1t3d0Do a dry run on pool creation

Show Pool Information

# zpool status -xShow pool status
# zpool status -v datapoolShow individual pool status in verbose mode
# zpool listShow all the pools
# zpool list -o name,sizeShow particular properties of all the pools (here, name and size)
# zpool list -Ho nameShow all pools without headers and columns

File-system/Volume related commands

# zfs create datapool/fs1Create file-system fs1 under datapool
# zfs create -V 1gb datapool/vol01Create 1 GB volume (Block device) in datapool
# zfs destroy -r datapooldestroy datapool and all datasets under it.
# zfs destroy -fr datapool/datadestroy file-system or volume (data) and all related snapshots

Set ZFS file system properties

# zfs set quota=1G datapool/fs1Set quota of 1 GB on filesystem fs1
# zfs set reservation=1G datapool/fs1Set Reservation of 1 GB on filesystem fs1
# zfs set mountpoint=legacy datapool/fs1Disable ZFS auto mounting and enable mounting through /etc/vfstab.
# zfs set sharenfs=on datapool/fs1Share fs1 as NFS
# zfs set compression=on datapool/fs1Enable compression on fs1

File-system/Volume related commands

# zfs create datapool/fs1Create file-system fs1 under datapool
# zfs create -V 1gb datapool/vol01Create 1 GB volume (Block device) in datapool
# zfs destroy -r datapooldestroy datapool and all datasets under it.
# zfs destroy -fr datapool/datadestroy file-system or volume (data) and all related snapshots

Show file system info

# zfs listList all ZFS file system
# zfs get all datapool”List all properties of a ZFS file system

Mount/Umount Related Commands

# zfs set mountpoint=/data datapool/fs1Set the mount-point of file system fs1 to /data
# zfs mount datapool/fs1Mount fs1 file system
# zfs umount datapool/fs1Umount ZFS file system fs1
# zfs mount -aMount all ZFS file systems
# zfs umount -aUmount all ZFS file systems

ZFS I/O performance

# zpool iostat 2Display ZFS I/O Statistics every 2 seconds
# zpool iostat -v 2Display detailed ZFS I/O statistics every 2 seconds

ZFS maintenance commands

# zpool scrub datapoolRun scrub on all file systems under data pool
# zpool offline -t datapool c0t0d0Temporarily offline a disk (until next reboot)
# zpool onlineOnline a disk to clear error count
# zpool clearClear error count without a need to the disk

Import/Export Commands

# zpool importList pools available for import
# zpool import -aImports all pools found in the search directories
# zpool import -dTo search for pools with block devices not located in /dev/dsk
# zpool import -d /zfs datapoolSearch for a pool with block devices created in /zfs
# zpool import oldpool newpoolImport a pool originally named oldpool under new name newpool
# zpool import 3987837483Import pool using pool ID
# zpool export datapoolDeport a ZFS pool named mypool
# zpool export -f datapoolForce the unmount and deport of a ZFS pool

Snapshot Commands

# zfs snapshot datapool/fs1@12jan2014Create a snapshot named 12jan2014 of the fs1 filesystem
# zfs list -t snapshotList snapshots
# zfs rollback -r datapool/fs1@10jan2014Roll back to 10jan2014 (recursively destroy intermediate snapshots)
# zfs rollback -rf datapool/fs1@10jan2014Roll back must and force unmount and remount
# zfs destroy datapool/fs1@10jan2014Destroy snapshot created earlier
# zfs send datapool/fs1@oct2013 &gt /geekpool/fs1/oct2013.bakTake a backup of ZFS snapshot locally
# zfs receive anotherpool/fs1 &lt /geekpool/fs1/oct2013.bakRestore from the snapshot backup backup taken
# zfs send datapool/fs1@oct2013 | zfs receive anotherpool/fs1Combine the send and receive operation
# zfs send datapool/fs1@oct2013 | ssh node02 “zfs receive testpool/testfs”Send the snapshot to a remote system node02

Clone Commands

# zfs clone datapool/fs1@10jan2014 /clones/fs1Clone an existing snapshot
# zfs destroy datapool/fs1@10jan2014Destroy clone

Proxmox – Change VM ID

Change VMID from 100 to 302

Stop/Shutdown a VM.

    1. Login using SSH to Proxmox Machine or using Shell menu in Web Interface.
    2. Rename image directory name and image filename.
      root@PROXMOX01:/# cd /dev/pve
      root@PROXMOX01:/dev/pve# ls
      root swap vm-100-disk-1
      root@PROXMOX01:/dev/pve# mv vm-100-disk-1 vm-302-disk-1
      root@PROXMOX01:/dev/pve# ls

Read more