N6XRE DokuWiki

This is an old revision of the document!


Linux - Programming and Computing - ShellScript
Installing Linux on TBao Laptops - PartedMagic


PDF Documents and Plugin
Embed videos & playlists Instructions

My TwitterMy Twitter Search GoogleGoogle Search

1. Snapcraft Store

2. How do you monitor the progress of dd?

Top
dd if=/dev/sda of=/dev/sdb bs=4096 status=progress
Also see Making a Dedicated Grub Partition


3. How to Update Ubuntu packages on 18.04 Bionic Beaver Linux

Top


4. Things to do After Installing Ubuntu 18.04 and 18.10

Top


5. OpenZFS channel

6. ZFS Wiki

7. ZFS quick command reference with examples

Top


8. Managing Devices in ZFS Storage Pools

Top


9. Zfs playlist

10. ZFS Datasets dissappear on reboot

Top

I have installed ZFS(0.6.5) in my Centos 7 and I have also created a zpool, everything works fine apart from the fact that my datasets disappear on reboot.
I have been trying to debug this issue with the help of various online resources and blogs but couldn't get the desired result.
After reboot, when I issue the zfs list command I get "no datasets available" , and zpool list gives "no pools available" After doing a lot of online research, I could make it work by manually importing the cache file using zpool import -c cachefile, but still I had to run zpool set cachefile=/etc/zfs/zpool.cache Pool before the reboot so as to import it later on after reboot.

This is what systemctl status zfs-import-cache looks like,

zfs-import-cache.service - Import ZFS pools by cache file
Loaded: loaded (/usr/lib/systemd/system/zfs-import-cache.service; static)
Active: inactive (dead)

cat /etc/sysconfig/zfs

# ZoL userland configuration.

# Run `zfs mount -a` during system start?
ZFS_MOUNT='yes'

# Run `zfs unmount -a` during system stop?
ZFS_UNMOUNT='yes'

# Run `zfs share -a` during system start?
# nb: The shareiscsi, sharenfs, and sharesmb dataset properties.
ZFS_SHARE='yes'

# Run `zfs unshare -a` during system stop?
ZFS_UNSHARE='yes'

# Specify specific path(s) to look for device nodes and/or links for the
# pool import(s). See zpool(8) for more information about this variable.
# It supersedes the old USE_DISK_BY_ID which indicated that it would only
# try '/dev/disk/by-id'.
# The old variable will still work in the code, but is deprecated.
#ZPOOL_IMPORT_PATH="/dev/disk/by-vdev:/dev/disk/by-id"

# Should the datasets be mounted verbosely?
# A mount counter will be used when mounting if set to 'yes'.
VERBOSE_MOUNT='no'

# Should we allow overlay mounts?
# This is standard in Linux, but not ZFS which comes from Solaris where this
# is not allowed).
DO_OVERLAY_MOUNTS='no'

# Any additional option to the 'zfs mount' command line?
# Include '-o' for each option wanted.
MOUNT_EXTRA_OPTIONS=""

# Build kernel modules with the --enable-debug switch?
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_DKMS_ENABLE_DEBUG='no'

# Build kernel modules with the --enable-debug-dmu-tx switch?
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_DKMS_ENABLE_DEBUG_DMU_TX='no'

# Keep debugging symbols in kernel modules?
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_DKMS_DISABLE_STRIP='no'

# Wait for this many seconds in the initrd pre_mountroot?
# This delays startup and should be '0' on most systems.
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_INITRD_PRE_MOUNTROOT_SLEEP='0'

# Wait for this many seconds in the initrd mountroot?
# This delays startup and should be '0' on most systems. This might help on
# systems which have their ZFS root on a USB disk that takes just a little
# longer to be available
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_INITRD_POST_MODPROBE_SLEEP='0'

# List of additional datasets to mount after the root dataset is mounted?
#
# The init script will use the mountpoint specified in the 'mountpoint'
# property value in the dataset to determine where it should be mounted.
#
# This is a space separated list, and will be mounted in the order specified,
# so if one filesystem depends on a previous mountpoint, make sure to put
# them in the right order.
#
# It is not necessary to add filesystems below the root fs here. It is
# taken care of by the initrd script automatically. These are only for
# additional filesystems needed. Such as /opt, /usr/local which is not
# located under the root fs.
# Example: If root FS is 'rpool/ROOT/rootfs', this would make sense.
#ZFS_INITRD_ADDITIONAL_DATASETS="rpool/ROOT/usr rpool/ROOT/var"

# List of pools that should NOT be imported at boot?
# This is a space separated list.
#ZFS_POOL_EXCEPTIONS="test2"

# Optional arguments for the ZFS Event Daemon (ZED).
# See zed(8) for more information on available options.
#ZED_ARGS="-M"
I am not sure if this is a known issue,.. if yes, Is there any workaround for this? perhaps an easy way to preserve my datasets after reboot and preferably without the overhead of an cache file.

linux zfs centos7 zfsonlinux
shareimprove this question
edited Oct 28 '15 at 11:09
asked Oct 28 '15 at 10:16

Vincent
143117
what zpool status -v and zpool import says? – ostendali Oct 28 '15 at 10:28
Hi, zpool status -v zpool status -v no pools available And, zpool import gives me this pool: zfsPool id: 10064980395446559551 state: ONLINE action: The pool can be imported using its name or numeric identifier. config: zfsPool ONLINE sda4 ONLINE – Vincent Oct 28 '15 at 10:39
zfs import is how I could make it work, by setting the cachefile initially using the set cachefile command – Vincent Oct 28 '15 at 10:40
you missed /etc/init/zpool-import.conf, can you post the content of that file as well? – ostendali Oct 28 '15 at 11:19
1
Is the ZFS target enabled? systemctl status zfs.target – Michael Hampton♦ Oct 28 '15 at 12:44
show 6 more comments
3 Answers
active oldest votes
up vote
5
down vote
accepted
Please make sure the zfs service (target) is enabled. That's what handles pool import/export on boot/shutdown.

zfs.target      loaded active active    ZFS startup target

You should never have to struggle with this. If you have a chance, run an update on your zfs distribution, as I know the startups services have improved over the last few releases:

[root@zfs2 ~]# rpm -qi zfs
Name        : zfs
Version     : 0.6.5.2
Release     : 1.el7.centos
shareimprove this answer
answered Oct 28 '15 at 12:50

ewwhite
170k73356704
Hi, I had tested 0.6.5.3 as well which happens to be the latest release I believe, but still faced this issue, with .6.5.3 I had to even run modprobe zfs everytime I did a reboot to load the modules. Btw, Target is not enabled please check the output in comments above(reply to Michael). May I know how to set one ? thanks. – Vincent Oct 28 '15 at 13:02
All you need to do is probably something like: systemctl enable zfs.target – ewwhite Oct 28 '15 at 13:19
add a comment
up vote
3
down vote
I also had the problem of the zfs disappearing after a reboot. Running CentOS 7.3 and ZFS 0.6.5.9 Reimporting brought it back (zpool import zfspool) only until the next reboot.

Here's the command that worked for me (to make it persist through reboots):

systemctl preset zfs-import-cache zfs-import-scan zfs-mount zfs-share zfs-zed zfs.target
(Found this at: https://github.com/zfsonlinux/zfs/wiki/RHEL-%26-CentOS )

shareimprove this answer
edited Apr 5 '17 at 23:50

chicks
2,93771730
answered Apr 5 '17 at 22:28

Jeff
312
add a comment
up vote
1
down vote
ok, so the pool is there, which means the problem is with your zfs.cache, it is not persistent and that is why it looses its config when your reboot. what I'd suggest to do is to run:

      zpool import zfsPool 
      zpool list 
And check if the if it is available. Reboot the server and see if it comes back, if it doesn't then perform the same steps and run:

      zpool scrub
Just to make sure everything is alright with your pool etc.

Pls also post the content of:

      /etc/default/zfs.conf
      /etc/init/zpool-import.conf
Alternatively, if you are looking for workaround to this issue you can set it of course as follow.

Change the value in from 1 to 0:

    /etc/init/zpool-import.conf
and add the following to your /etc/rc.local:

    zfs mount -a
That will do the trick.

11. Why use zfs for virtual machines??

12. SparkleShare - Samba - or Something Else?

Top


13. Pacman/Rosetta - Arch Linux

Top


14. Linux Guide

Top


15. List of Unix commands - ShellScript

Top


16. SSH Forwarding: Local vs Remote with examples

Top
Execute Script or Command
Note that the exec functions are non interactive
so they cannot prompt for a sudo password. A trick
is to use -S which reads the password from stdin:

command <- 'echo "mypassword!" | sudo -s -S apt-get update -y'
out <- ssh_exec_wait(session, command)

Be very careful with hardcoding passwords!

ssh -R 8080:localhost:80 user@host 


https://www.youtube.com/watch?v=g_Row8zEJZc
SSH PORT FORWARDING EXAMPLE - Free-tier server from Amazon AWS


17. How To Use SSH Remote Login - ShellScript

18. How To Automate Tasks using Cron

19. The Linux Foundation

Top


Yocto Project - Also see Building Raspberry Pi Systems with Yocto and Learn Yocto section below.


20. Joe Collins channel

Top


21. Install list of packages using apt-get

Top
DistroWatch.com - try ubuntu mini install (good for pendrives and re-installs using pkglist)
The LiveCD List - KnoppixCD


* Generate pkglist for Debian

sudo dpkg --get-selections | sed "s/.*deinstall//" | sed "s/install$//g" > ~/pkglist


* Use pkglist for Debian

sudo apt-get install $(cat pkglist)


Pacman/Rosetta for other distributions - see Arch Linux


22. How to change ubuntu install from legacy to uefi

Top


23. Ubuntu Doc BasicChroot

Top
schroot man page sudo apt-get install schroot


24. Linux kernel interfaces

Top


25. Comparison of platform virtualization software - oVirt

Top


26. Docker (software)

27. oVirt Virtualization Management Platform

28. Proxmox Virtual Environment

29. Sportage 12 channel

Top


30. Xen

31. What is Xvisor (for ARM platforms)

32. Linux From Scratch

33. Embedded Linux Wiki

Top


34. Go to KNOPPIX

35. Cross compileing

36. Parted Magic (Modifying)

Top


37. Mounting Linux Partitions in Windows with FSproxy

Top


38. How to Add a Hard Drive to a Linux System

39. How to Convert a Physical Server to a Citrix Xen Virtual Server (P2V)

Top


40. LVM HOWTO

Top


41. Remove Disk from LVM Array on Ubuntu

Top


42. Move your Ubuntu system to another computer in 3 simple steps

Top


43. chrysocome.net>>virtualvolumes on Windows

Top


44. Synology 2 bay NAS DiskStation DS218+

Top
with Advanced Btrfs file system and eSata Port - $298.00 - Amazon and has upgradable memory
Also, the DS218+ supports on-the-fly hardware transcoding


45. Welcome to the FreeNAS Documentation Project!

46. QNAP Virtualization Station enables virtualized desktop operations

47. How to convert a VirtualBox virtual machine to QEMUwto image?

Top


48. How do I convert a VirtualBox VDI file to a VMware vdmk?

Top


49. File-based dynamically-allocated hard-disk on Linux

Top


50. How to use loop devices (losetup)

Top


51. How To Host a Web Server with a Raspberry Pi

Top
Raspian - arm - Emulating Raspberry Pi in Windows the easy way with Qemu
Raspberry Pi’s PIXEL Linux desktop now available for x86 PCs or Virtualbox Article

Raspberry Pi Commands: 

sudo apt-get install apache2 -y
hostname -I
sudo nano /var/www/index.html
sudo apt-get install php5 libapache2-mod-php5 -y
sudo nano /var/www/example.php
PHP File Code: 
<?php
echo "Today's date is ".date('Y-m-d H:i:s');
?>
sudo apt-get install mysql-server php5-mysql -y
cd /var/www
sudo chown pi: .
rm *
wget http://wordpress.org/latest.tar.gz
tar xzf latest.tar.gz
mv wordpress/* ./
rm -rf wordpress latest.tar.gz
sudo chown -R -f www-data:www-data /var/www
mysql -uroot -pInsert Password Here

create database wordpress;

Manjaro Community Editions - x86 - for Virtualbox
How To Install Manjaro Arm On The Raspberry pi 1 2 3 Or Zero
http://manjaro-arm.org/

https://www.youtube.com/watch?v=nu6j5lfjO_w

Go to Pacman/Rosetta page for Manjaro install.

Basic operations
Action  Arch    Red Hat/Fedora  Debian/Ubuntu   SLES/openSUSE   Gentoo
Install a package(s) by name    pacman -S   dnf install apt install zypper install
zypper in   emerge [-a]
Remove a package(s) by name pacman -Rs  dnf remove  apt remove  zypper remove
zypper rm   emerge -C

Arch Linux for Raspberry Pi Youtube
INSTALLING ARCH LINUX ON RASPBERRY PI


52. Emulating Raspberry Pi in Windows the easy way

Top
https://sourceforge.net/projects/rpiqemuwindows/

There is a very nice raspberry pi forum posting about "Emulating Raspberry Pi
in Windows the easy way". Somebody all ready did all the work to make
raspberry pi emulation in Windows as simple as possible. The instructions are

download a zip from sourceforge - https://sourceforge.net/projects/rpiqemuwindows/

Unzip the file when it finishes downloading.

Inside the folder you should find a run.bat file which will do all the magic for you.

The zip file is literally Raspberry Pi in a zip, it contains Qemu along with the 
Wheezy squeeze, and the batch file that you run to start the emulation contains 
the exact command to start Qemu as an ARM CPU running Wheezy. This is the epitome of KISS.

It should be noted that others have downloaded and checked the files for viruses and that 
the emulation has been confirmed on several versions of Windows. I can confirm the 
emulation works in Windows 7 Ultimate.

Installing and running Debian armel on an emulated ARM machine on Windows (QEMU)


53. Make a VPN Server with a Raspberry Pi, OpenVPN and Stunnel

54. Fast, Free, and Easy VPN Build in Minutes - Hak5 2022

Top
Setting up an OpenVPN Server on Debian, Ubuntu and CentOS
Setting up an OpenVPN Server on Raspberry Pi - Kali (goddess) destroyer of evil forces.

Linux Server Build: OpenVPN From Scratch - Hak5 2019

How to Build An OpenVPN Access Point - Hak5 2017

SSH into our VPS and get openvpn-as going

wget http://swupdate.openvpn.org/as/openvpn-as-2.1.1-Ubuntu14.amd_64.deb
dpkg -i openvpn*.deb
 /usr/local/openvpn_as/bin/ovpn-init
#Choose 0.0.0.0
Log in as Admin
Auth  General  Local
User Permissions  Create new user

LOGIN not Connect
Download "Yourself (autologin profile)"

Test connection at with a test.php script.

Finalizing the OpenVPN-AS Home Server Build - Hak5 1823

How to Build an OpenVPN Access Point Pt 2 - Hak5 2018

Access Internal Networks with Reverse VPN connections - Hak5 1921

How to Tether Without The Fees - Hak5 2111

Fast and Easy Free VPN from Google - The Open Source OUTLINE - Hak5 2403

55. Hak5.org

56. How-to get MySQL setup properly

Top


57. How to Upgrade or Reload Linux while Keeping Your Data

58. Procedural programming

Top


59. Object-oriented programming

Top


60. List of object-oriented programming languages


61. My 5 Favorite Linux Shell Tricks for SPEED (and efficiency)

62. A Bunch Of Tips And Fun Tricks

63. Linux Tip | System Tools

Top
https://www.youtube.com/watch?v=OCAjv6DCJBQ

Useful Linux Applications | What You'll Need To Get Things Done

USEFUL LINUX APPLICATIONS

Browsers: 

Chromium
Firefox
Google Chrome

E-Mail:

Evolution
Geary
Thunderbird

BitTorrent:

Transmission

Chat:

HexChat
Pidgin

Text Editors:

Gedit
Kate
Nano
Pluma
Vi

Office:

AbiWord
Gnumeric 
LibreOffice

CD Rippers:

Asunder

CD/DVD Burners:

Brasero
K3b

Audio/Video/Music:

Amarok
Banshee
Clementine
Rhythmbox
VLC

Audio Editors:

Ardour
Audacity
Ocenaudio

Audio/Video Converters:

Handbreak
SoundConverter

Video Editors:

Kdenlive
Lightworks
OpenShot

Screen Capture/Webcasting:

Cheese
GUVCView
Kazam
OBS
RecordMyDesktop
SimpleScreenRecorder
Vocoscreen

Visualization:

Gnome Boxes
VirtualBox
VMware

Photo/Graphics:

Blender
Eye of GNOME/Image Viewer
GIMP
gThumb
Inkscape
Shotwell
SimpleScan

Utilities:

Archive Manager
BleachBit
Disks
Document Viewer
Grsync 

64. The advanced parameters for restoring mode in Clonezilla

65. An Introduction To Snap Packages for Linux

Top
https://www.youtube.com/watch?v=j40tNL3t4gw

What is SimpleScreenRecorder


Basic Snap Usage


Snap packages on MX-17


  • SNAP COMMANDS:
  • sudo snap find : To list the available packages.
  • sudo snap install (package name): To install a package.
  • sudo snap list: To view all the installed snap packages.
  • sudo snap changes: To view a list of logged actions.
  • sudo snap refresh (package name): To upgrade a package to its latest available version.
  • sudo snap remove: To uninstall a package.

Snapcraft Store


66. chroot - for OpenZim_Servers

Top


67. Linux copy and clone USB stick including partitions command

Top
Linux copy and clone USB stick including partitions command
sudo dd if=/dev/sdi of=/dev/sdh bs=4M status=progress


68. What Has My Compiler Done for Me Lately?

69. You're Wrong About the Linux Code of Conduct

70. Hybris (software)

Top


71. VirMach Hosting - $1.00 monthly

72. A2 Hosting - $3.92 monthly

Top


73. Fast, Easy and Free SSL Certificates with Let's Encrypt - Hak5 2023

QR Code
QR Code linux (generated for current page)