How to set up NFS server and client on CentOS 7

Question: I would like to share a directory via NFS between CentOS 7 hosts. What is the procedure for configuring NFS server and client, and enabling NFS mounts between them in CentOS 7 environment? NFS is a distributed file system protocol built on top of Sun’s RPC (remote procedure call). NFS is popularly used to […]
Continue reading…

 

How to back up and restore file permissions on Linux

Question: I want to back up the file permissions of the local filesystem, so that if I accidentally mess up the file permissions, I can restore them to the original state. Is there an easy way to back up and restore file permissions on Linux? You may have heard of a tragic mistake of a […]
Continue reading…

 

How to add disks to LVM volume on Linux

Question: I have new unused hard drives, and want to add them to an existing LVM volume to increase its size. How can I add disks to LVM to extend an LVM volume? The biggest advantage of LVM over traditional disk partitions is its support for “dynamic partitions”; you can create and resize (grow or […]
Continue reading…

 

How to install Gparted on Linux

Question: I need to (re)partition my hard disk. How can I install Gparted on [insert your Linux distro]? GParted is an open-source GUI-based disk partition editor originally developed for Linux GNOME Desktop. Gparted allows you to create, resize, copy and paste, move, and repair disk partitions using easy-to-use GUI. It supports many filesystems including btrfs, […]
Continue reading…

 

How to mount an LVM partition on Linux

Question: I have an external USB drive which contains several LVM partitions on it. I want to access some of those LVM partitions on my Linux. How can I mount an LVM partition on Linux? LVM is a logical volume management tool which allows you to manage disk space using the notion of logical volumes […]
Continue reading…

 

How to check disk space on Linux with df command

Question: I know I can use df command to check a file system’s disk space usage on Linux. Can you show me practical examples of the df command so that I can make the most out of it? As far as disk storage is concerned, there are many command-line or GUI-based tools that can tell […]
Continue reading…

 

How to install 7zip on Linux

Question: I need to extract files from an ISO image, and for that I want to use 7zip program. How can I install 7zip on [insert your Linux distro]? 7zip is an open-source archive program originally developed for Windows, which can pack or unpack a variety of archive formats including its native format 7z as […]
Continue reading…

 

How to rename multiple files on Linux

Question: I know I can rename a file using mv command. But what if I want to change the name of many files? It will be tedius to invoke mv command for every such file. Is there a more convenient way to rename multiple files at once? In Linux, when you want to change a […]
Continue reading…

 

How to change character encoding of a text file on Linux

Question: I have an “iso-8859-1”-encoded subtitle file which shows broken characters on my Linux system, and I would like to change its text encoding to “utf-8” character set. In Linux, what is a good tool to convert character encoding in a text file? As you already know, computers can only handle binary numbers at the […]
Continue reading…

 

How to create and mount an XFS file system on Linux

Question: I heard good things about XFS, and would like to create an XFS file system on my disk partition. What are the Linux commands to format and mount an XFS file system? XFS is a high-performance file system which was designed by SGI for their IRIX platform. Since XFS was ported to the Linux […]
Continue reading…

 

How to expand an XFS file system

Question: I have extra space in my disk, so I want to grow the size of an existing XFS file system created on it, in order to fully utilize the extra space. What is a proper way to expand an XFS file system? XFS is an open-source (GPL) journaling file system originally developed by Silicon […]
Continue reading…

 

How to find the biggest files or directories on Linux

Question: I want to know which files (or directories) consume the largest disk space on my Linux. What is a command line which finds the biggest files or directories? When it comes to checking which files or directories waste your disk space the most, du command is probably the easiest way. To find the biggest […]
Continue reading…

 

How to find the device name of a USB drive on Linux

Question: I need to know the device name (e.g., /dev/sdb) assigned to my USB flash drive after I plug the drive into my Linux system. Is there an easy way to identify the device name of a USB drive on Linux? To find out the device name assigned to a USB drive or USB stick, […]
Continue reading…

 

How to regenerate /etc/mtab file on Linux

Question: I accidentally messed up (or removed) /etc/mtab file. How can I recreate the original /etc/mtab file which reflects the current mount information? In case /etc/mtab file is lost or corrupted by accident, and you want to recover the original /etc/mtab file, you can use /proc/mounts, which shows an up-to-date list of all mounts currently […]
Continue reading…

 

How to change extension of multiple files at once on Linux

Question: On my Linux computer, I have many picture files whose extension I want to change from *.JPEG to *.jpg. In general, how can I change the extension of multiple files at once? Most Linux distros come with a command line utility called rename pre-installed, which, as the name implies, can rename multiple files at […]
Continue reading…

 

How to remount filesystem as read-write in Ubuntu recovery mode

Question: I booted Ubuntu into recovery mode to fix a configuration file, but I noticed that the root filesystem is mounted as read-only. How can I remount a filesystem as “read-write” in Ubuntu recovery mode? When you enter a recovery mode in Ubuntu, the root filesystem gets mounted as “ready-only” by default, not allowing you […]
Continue reading…