Sharing files between computers and servers is an essential networking task. Thankfully, Linux’s NFS(Networked File System) makes it extremely easy. With NFS properly configured, moving files between machines is as easy as moving files around on the same machine. Since NFS functionality is built directly into the Linux kernel, it is both powerful and available on every distro, though the configuration differs slightly between them.
Setting Up The Server
Installing The PackagesLinux NFS uses the Client-Server model, so the first step in getting NFS set up is setting up the server. Because the core NFS capabilities are rooted in the kernel, there isn’t much required in the way of packages, but there are still a few regardless of the distribution as well as some configuration. Almost all major distributions have NFS enabled, so unless you’re running a custom one, it should already be set up. The next step in getting the server set up is to install the packages.
$ sudo apt-get install nfs-kernel-headers On Fedora
$ sudo yum install nfs-utils system-config-nfs
Read more ...
Approx is a proxy server for Debian archive files. Having such a service within your LAN with multiple Debian like systems will provide you with number of benefits such as update speed since any update package needs to be downloaded only once. This will also lower down Internet download usage requirements, etc. This article will describe a process of approx setup for Ubuntu Linux.
As any other installation from standard Ubuntu repository, installation of the approx apt proxy server is a fairy simple process. Install the approx apt proxy server with:
$ sudo apt-get install approx
The above command will also install all prerequisites including Internet superserver inetd, which is used to invoke the approx server.
Read more ...
Here's another installment of the Linux CLI basics series. This time we will deal with other interest-worthy tasks, like setting up your keyboard layout or using utilities to find files on your drive(s). We hope that the series will help you become a keyboard/terminal guru.
The tasks, part three
Setting the keyboard layout
When you're using some fancy desktop environment, changing the layout of your keyboard is simple and easy. A few clicks, you choose your preferred layout and maybe other localization settings and that's that. But what if you find yourself at a command-line-only machine and you have to use the machine, but the layout is set to French? The keys show a symbol but you type another and nothing works as it should. What to do? Or you decided to dump bloated GNOME or KDE for some lightweight window manager like Fluxbox. What you should use for this task strictly depends on whether you have X installed or not. If you do, the utility is called setxkbmap. If you don't you can use various tools provided by your distro (by the way, remember that we are using Ubuntu for our examples), but we will show you how to do it in terminal-only mode without depending on some distro-specific tools.
The first method shown will be the one that assumes that you have X.org installed and you're using it in conjunction with some WM, but you don't have any specific GUI tools for layout changes. As always, I recommend you take a few minutes to look over the setxkbmap manual page to get an idea of the options and general usage flags. As you can imply, the utility's name stands for "set X keyboard map". I remember using shell scripts that contained only the setxkbmap lines needed and then setting up keyboard shortcuts that invoked said scripts as needed (~/.fluxbox/keys): maybe this is a trick you will use after reading this article so that your work will become easier. That's the charm of Linux, there are virtually no limits on what you can do with it.
Enough talk, let's see some practical examples. If I have the US English layout set as default, which happens in most cases, and I want to change it to French, all I have to do is
Read more ...
Hello, and welcome to part two of our Linux command line series. You will learn some more interesting tips that you can use to master your system, so hold on to your seats, because here we go.
The tasks, part two
Setting date and time
I must confess, this was a task that I had to do a long time ago in front of a terminal and had no idea how to do it. That is because I was used to the Gnome way of doing that but at the time I had no Gnome. So what to do?
, of course. Depending on the country you live in, the date format differs from other parts of the world. In the United States, the date/time format is of the form mm/dd/yy or mm/dd/yyyy, where m is month, d is day and y is year, either in two-digit format (e.g. 86 for 1986). Where I'm getting at is the fact that the way that you set your date with the date command may differ from the format you're used to (or what is used in your country). This paragraph will not be a manual page replacement, but it will help you set your system's date/time quickly, provided you have root privileges. If you simply type
with no other arguments/flags, it will show you the current date. To set the date, you should type something like
M is month, D is day, h is hour, m is minute, C is century (the first two digits of year, like 20 for 2012), Y is year and s stands for seconds. Therefore to set your date for example to "Fri Jul 6 13:45:50 2012" you would do:
# date 070613452012.50
Read more ...
By creating a Logical Volume snapshots you are able to freeze a current state of any of your logical volumes. This means that you can very easily create a backup and once needed rollback to a original logical volume state. This method is very similar to what you already know from using Virtualization software such as Virtualbox or VMware where you can simply take a snapshot of entire virtual machine and revert back in case something went wrong etc. Therefore, using LVM snapshots allows you to take a control of your system's logical volumes whether it is your personal laptop or server. This tutorial is self-contained as no previous experience with Logical Volume Manager is required.
In this article we will explain how to manually create and restore logical volume snapshots. Since we do not assume any previous experience with Logical Volume Manager we will start from a scratch using a dummy physical hard drive /dev/sdb with size of 1073 MB. Here are all steps in nutshell:
- First we will create two partitions on our /dev/sdb drive. These partitions will be of "8e Linux LVM" type and will be used to create a physical volumes
- Once both partitions are created we use pvcreate command to create physical volumes
- In this step we create a new Logical Volume Group and a single 300MB in size logical volume using ext4 filesystem
- Mount our new logical volume and create some sample data
- Take a snapshot and remove sample data
- Rollback logical volume snapshot
Read more ...