Category: Ubuntu
-
How to restart NFS server on Ubuntu
Once you set up your NFS exports by adding lines to /etc/exports you need to restart your NFS server; do this with the following: sudo /etc/init.d/nfs-kernel-server restart You should see output along the lines of: * Stopping NFS kernel daemon [ OK ] * Unexporting directories for NFS kernel daemon… [ OK…
-
ZFS on Ubuntu error: Failed to load ZFS module stack
If you see the above error in a fresh installation of ZFS on Ubuntu one cause may be that the package build-essentials wasn’t installed prior to installing the ubuntu-zfs package; run: sudo apt-get purge ubuntu-zfs then check for the remaining packages with the following: dpkg –list | grep zfs …and…
-
Ubuntu: Clear terminal screen
Sometimes you may wish to clear the terminal window, whether it be to hide what you’ve just done, clear some irrelevant/distracting output or any other reason. The best command to do this is simple: reset This completely clears the output shown in your terminal window but doesn’t log you out. If you…
-
Ubuntu: How to create a file or folder using today’s date
This is a useful little trick to use in your scripts – particularly for things like periodic backups. For a file: touch $(date +%F) creates the file 2012-11-18 For a folder, let’s add the time after the date: mkdir $(date +%F-%H:%M) creates the folder 2012-11-18-09:00 We can use…
-
Ubuntu: Securing your remote SSH logins with Denyhosts
Being able to log in to your server remotely via SSH is an incredibly powerful way of remotely managing your system. With so many devices now able to support consoles (just about any current smartphone or current OS, really) you can check on things, update or make changes from just about anywhere. One of…
-
How to exclude results from grep
Sometimes you may wish to further filter grep output, such as in the following situation: # zfs get all | grep compressratio backup01 compressratio 1.23x – backup01 refcompressratio 1.00x – backup01/data compressratio 1.50x – backup01/data refcompressratio 1.50x – backup01/photos compressratio 1.05x – backup01/photos refcompressratio 1.05x – Here we only really want to see…
-
DNS troubles with Ubuntu Server 12.04
Some customers have been having DNS issues after setting a static IP on Ubuntu 12.04.1 where the server is no longer picking up the DNS settings as it was before; this can be easily fixed by adding the following to /etc/network/interfaces after the eth0 entry: dns-nameservers [ip.of.your.router] e.g., for a modem/router that’s 10.1.1.1…
-
Ubuntu: How to view results of “ls” one page at a time
If you’re listing the contents of a directory using the “ls -l” command in a terminal window you may find that the number of results cause pages of text to fly past your screen, leaving you with only the last page to look at. If you aren’t using a terminal which you can scroll back…
-
ZFS folders on Ubuntu not mounting after reboot
After upgrading to 12.04 people seem to be finding that their ZFS shares aren’t mounting on boot; this has an easy fix, fortunately – edit your /etc/rc.local file and add: stop smbd stop nmbd zfs mount -a start smbd start nmbd Save and reboot and your shares should be intact. This has worked…
-
How to find kernel version in Ubuntu 12.04 Precise Pangolin
Note: This also works in other versions of Ubuntu, such as 11.10, 11.04, 10.10, 10.04 and earlier. Sometimes you may wish to find out which kernel you’re currently running; fortunately, this is quite easy to do with the uname command. If you’re running Ubuntu Desktop, open up a Terminal; if you’re using Ubuntu Server…