How to enlarge root partition and filesystem size of cloud Linux VM at runtime without rebooting Linux

Posted on

It is common that the root disk space is not enough when running a Virtual Machine in the cloud such as Amazon Web Service (AWS). The cloud storage usually provides tools or facilities to enlarge a virtual disk size. However, to make the Linux recognize and and use the enlarged disks without rebooting the OS,
Read more

How to synchronize Google Drive and Google Docs files in Ubuntu/Debian/Mint Linux using Insync

Posted on

Google Drive is a nice cloud storage service. It provides a suite of nice online document spreadsheet and slide editors Google Docs, Google Sheets and Google Slides. The collaborative editing and full history tracking features of Google Docs are excellent. Google Drive gives 16GB free storage which is pretty much larger compared to other free
Read more

Installing Zlib from Source Code in Ubuntu Linux

Posted on

Zlib is a popular open-source compression library used by many software applications to compress and decompress data. While it can be installed in Ubuntu using the apt package manager, you may need to install it from the source code if the version available in the Ubuntu repositories is outdated or if you need to customize
Read more

Handling Sparse Files on Linux

Posted on

Sparse files are common in Linux/Unix and are also supported by Windows (e.g. NTFS) and macOSes (e.g. HFS+). Sparse files uses storage efficiently when the files have a lot of holes (contiguous ranges of bytes having the value of zero) by storing only metadata for the holes instead of using real disk blocks. They are
Read more

How to Add a File Based Swap for Linux

Posted on

We may want to add some swap space for a Linux box while only find that all disk space is partitioned and mounted. Some partition has large available free space. For such cases, we may not want to change the partition allocation. The solution may be to add a file based swap for Linux as
Read more

How to disable the fastestmirror yum plugin in CentOS 7 Linux?

Posted on

How to disable the fastmirror yum plugin in CentOS 7 Linux? The fastestmirror function of yum is provided by the package `yum-plugin-fastestmirror`. However, because `yum` depends on it, the `yum-plugin-fastestmirror` package can not be removed. If you try to remove it, `yum` will report failures like. # yum remove yum-plugin-fastestmirror Loaded plugins: fastestmirror Resolving Dependencies
Read more

How to find the disk where root / is on in Bash on Linux?

Posted on

Question: how to find the disk where the Linux’s root(/) is on in Bash? The root may be on a LVM volume or on a raw disk. 2 cases: One example: # df -hT | grep /$ /dev/sda4 ext4 48G 32G 14G 71% / For another example: # df -hT | grep /$ /dev/mapper/fedora-root ext4
Read more

Getting Hostname in Bash in Linux in 3 Ways

Posted on

Getting the hostname of the node running a program can be useful in various scenarios, such as creating logs with the hostname, identifying which node a script is running on, or configuring a distributed system with different nodes. In Bash, there are several ways to retrieve the hostname of the machine, as mentioned in the
Read more

Allowing root Access to NFS Directories

Posted on

For local filesystems, root usually has full access (read/write) to directories/files inside of it. But for NFS directory mounted from network, root usually has no permission to write to directories or files within the NFS directory. How to make root act similarly in an NFS directory to the behavior in local directories? The reason that
Read more

How to deactivate a LVM logical volume on Linux?

Posted on

How to deactivate a LVM logical volume activated by #vgchange -aay on Linux You may need to make a LVM volume group inactive and thus unknown to the kernel. To deactivate a volume group, use the -a (–activate) argument of the vgchange command. To deactivates the volume group vg, use this command # vgchange -a
Read more

Decrypting a Password Protected RSA Private Key

Posted on

I got a password protected RSA private key with headers like (I have the password): —–BEGIN RSA PRIVATE KEY—– Proc-Type: 4,ENCRYPTED DEK-Info: AES-256-CBC,… How to decrypt a password protected RSA private key? You can use the openssl command to decrypt the key: openssl rsa -in /path/to/encrypted/key -out /paht/to/decrypted/key For example, if you have a encrypted
Read more

Where Does Evolution Save Its Data and Configuration Files on Linux?

Posted on

Evolution is a great personal information management tool that provides Email, address book and calendar tools. Evolution provides many enterprise friendly feature such as native support to Microsoft Exchange connectivity for Emails, address books and calendars. Evolution uses various ways including plain files and dconf configuration systems. This post will give an introduction to the
Read more

A Beginners’ Guide to x86-64 Instruction Encoding

Posted on

The encoding of x86 and x86-64 instructions is well documented in Intel or AMD’s manuals. However, they are not quite easy for beginners to start with to learn encoding of the x86-64 instructions. In this post, I will give a list of useful manuals for understanding and studying the x86-64 instruction encoding, a brief introduction
Read more

How To Debug Linux Kernel With Less Efforts

Posted on

Introduction In general, if we want to debug Linux Kernel, there are lots of tools such as Linux Perf, Kprobe, BCC, Ktap, etc, and we can also write kernel modules, proc subsystems or system calls for some specific debugging aims. However, if we have to instrument kernel to achieve our goals, usually we would not
Read more

USB Standards and Supports in Linux

Posted on

The USB standards have evolved to 3.1 and the supported throughput have been increased too. On Linux, the support to USB standards are following the standards development. In this post, we will survey the standards that common hardware support and the support in Linux. USB standards USB 2.0: https://en.wikipedia.org/wiki/USB#USB_2.0 Speed: <= 60MB/s, or 480 Mbps
Read more

Building and Installing Linux Kernel from the Source Code in an Existing Linux OS

Posted on

Building Linux kernel may sound a complex and geek-only thing. However, as Linux kernel itself has much less depended tools/packages compared to other software packages, it is quite easy to compile, build and install a Linux kernel from the source code in an existing Linux OS. Building Linux kernel is needed if you need to
Read more

How does linux kernel collect task stats data

Posted on

Motivation Recently, I find it is hard to know the percentage of time that one process uses to wait for synchronous I/O (eg, read, etc). One way is to use the taskstats API provided by Linux Kernel [1]. However, for this way, the precision may be one problem. With this problem, I dig into Linux
Read more

Vim Tutorial for Beginners: vimtutor

Posted on

There are many Vim tutorials and Vim tips on the Web. However, I find the vimtutor provides the best tutorial among those so far as I found on the Web while the vimtutor seems usually reachable from a terminal which is not obviously known to Vim beginners who are usually Linux beginners too. This page
Read more

x-data-plane feature in QEMU/KVM

Posted on

Abstract In systems, sometimes, we use one global lock to keep synchronization among different threads. This principle also happens in QEMU/KVM (http://wiki.qemu.org/Main_Page) system. However, this may cause lock contention problem. The performance/scalability of whole system will be decreased. In order to solve this problem in QEMU/KVM, x-data-plane feature is designed/implemented, which the high-level idea is
Read more