<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Syam SV</title>
    <description>The latest articles on DEV Community by Syam SV (@_undefined_).</description>
    <link>https://dev.to/_undefined_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1141401%2Fcaaca979-7fa7-452d-8f25-5a8fa560ca7d.jpg</url>
      <title>DEV Community: Syam SV</title>
      <link>https://dev.to/_undefined_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/_undefined_"/>
    <language>en</language>
    <item>
      <title>Unveiling Linux Command's - sar</title>
      <dc:creator>Syam SV</dc:creator>
      <pubDate>Mon, 28 Aug 2023 05:08:57 +0000</pubDate>
      <link>https://dev.to/_undefined_/unveiling-linux-commands-sar-42m1</link>
      <guid>https://dev.to/_undefined_/unveiling-linux-commands-sar-42m1</guid>
      <description>&lt;p&gt;In the world of computers, the SAR (System Activity Reporter) command is like a magic tool. It helps us understand how our computer is doing and where it might need some help. In this article, we'll take a look at the SAR command and see how it can tell us interesting things about our computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is SAR?
&lt;/h2&gt;

&lt;p&gt;SAR stands for System Activity Reporter. It's like a detective that watches over our computer and takes notes about what it's doing. It looks at what's happening on our computer and makes reports about it. It can tell us things like how busy our computer is, how much memory it's using, how the network is behaving, and much more. It's like a data historian that keeps track of what our computer has been up to.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For detailed matrix information, please refer to &lt;a href="https://knowledge.broadcom.com/external/article/168067/sar-system-accounting-utility.html"&gt;here&lt;/a&gt;* and &lt;a href="https://docs.oracle.com/cd/E36784_01/html/E36819/spmonitor-8.html#ADSYSenueh"&gt;here&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="o"&gt;[&lt;/span&gt; options &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;interval&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;count&amp;gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-b&lt;/span&gt; 1 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-r&lt;/span&gt; 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SAR can do many helpful jobs for us. Let's look at some of them and see what they mean&lt;/p&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Checking I/O and Transfer Rate
&lt;/h2&gt;

&lt;p&gt;Imagine your computer is sending and receiving data. SAR can tell us how busy it is doing that. It can count how many times it's doing these jobs and how much data is being sent and received every second.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-b&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;interval&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;count&amp;gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-b&lt;/span&gt; 1 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Paging Statistics
&lt;/h2&gt;

&lt;p&gt;Sometimes, our computer needs to get information from the hard drive. This is called paging. SAR can tell us how often this happens and how much data is being moved between the hard drive and the computer's memory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-B&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;interval&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;count&amp;gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-B&lt;/span&gt; 1 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Network Numbers
&lt;/h2&gt;

&lt;p&gt;If our computer is connected to the internet, SAR can tell us how much data is going in and out. It can show us how many packets of data are being sent and received. This helps us understand if our internet connection is fast or slow.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;options] &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;interval&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;count&amp;gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-n&lt;/span&gt; DEV 1 10
sar &lt;span class="nt"&gt;-n&lt;/span&gt; TCP,UDP 1 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Load and Queue
&lt;/h2&gt;

&lt;p&gt;When our computer is doing many things at once, it has a "load." SAR can tell us how heavy this load is. It can also tell us how many things are waiting to be done. This is like knowing how many people are waiting in line at a store.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-q&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;interval&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;count&amp;gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-q&lt;/span&gt; 1 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Memory and Swap Info
&lt;/h2&gt;

&lt;p&gt;Our computer uses memory to work. SAR can show us how much of this memory is being used. It can also tell us if the computer is using "swap space," which is like extra memory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;interval&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;count&amp;gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-r&lt;/span&gt; 1 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  CPU Usage
&lt;/h2&gt;

&lt;p&gt;The "brain" of our computer is called the CPU. SAR can tell us how busy the CPU is. It can say if it's mostly being used by programs, or if it's waiting for something to happen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-u&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;interval&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;count&amp;gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-u&lt;/span&gt; 1 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Page Swapping
&lt;/h2&gt;

&lt;p&gt;Sometimes, the computer needs to exchange data quickly. This is called "swapping." SAR can tell us if this is happening a lot and if it's causing any problems.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-W&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;interval&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;count&amp;gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sar &lt;span class="nt"&gt;-W&lt;/span&gt; 1 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;SAR is like a helpful friend that watches over our computer. It tells us all sorts of things about what's happening inside. Whether it's how busy our computer is, how much memory it's using, or how well the internet is working, SAR gives us answers. So, the next time you're curious about how your computer is performing, remember to ask SAR! Keep in mind that this article provides a simplified overview of SAR, and if you're interested in diving deeper, be sure to refer back to the detailed explanations above.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>terminal</category>
      <category>bash</category>
    </item>
    <item>
      <title>Unveiling Linux Command's - dmesg</title>
      <dc:creator>Syam SV</dc:creator>
      <pubDate>Thu, 24 Aug 2023 12:03:42 +0000</pubDate>
      <link>https://dev.to/_undefined_/unveiling-linux-commands-dmesg-3npd</link>
      <guid>https://dev.to/_undefined_/unveiling-linux-commands-dmesg-3npd</guid>
      <description>&lt;p&gt;&lt;code&gt;dmesg&lt;/code&gt;, short for "diagnostic messages" is a command-line utility in Linux that provides access to the kernel's ring buffer. This buffer stores messages generated by the Linux kernel during the boot process and while the system is running. These messages encompass a wide range of information, including device driver status, hardware initialization, and error messages. Users can rely on the dmesg command for several key reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Boot Process Analysis&lt;/strong&gt;: When a Linux system boots up, a plethora of hardware components and device drivers are initialized. In case of any failures or warnings during this process, dmesg becomes your go-to tool. Running &lt;code&gt;dmesg&lt;/code&gt; immediately after boot can help you identify hardware issues, driver failures, and other critical information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kernel Error Diagnosis&lt;/strong&gt;: Kernel messages displayed by &lt;code&gt;dmesg&lt;/code&gt; include errors, warnings, and information about kernel modules. When something goes wrong at the kernel level, dmesg can provide insights into the root cause of the issue, helping you diagnose and rectify the problem promptly&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Driver Debugging&lt;/strong&gt;: &lt;code&gt;dmesg&lt;/code&gt; allows you to examine the interaction between your drivers and the kernel, aiding in debugging and improving driver performance.&lt;/li&gt;
&lt;li&gt;and more ...&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Basic Usage
&lt;/h3&gt;

&lt;p&gt;The simplest way to use dmesg is by running the command without any options&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dmesg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will display the most recent kernel messages, starting from the end of the ring buffer&lt;/p&gt;

&lt;h3&gt;
  
  
  Severity based filtering
&lt;/h3&gt;

&lt;p&gt;You can filter messages based on their severity levels using the &lt;code&gt;-l&lt;/code&gt; or &lt;code&gt;--level&lt;/code&gt;option. The severity levels include &lt;code&gt;emerg&lt;/code&gt; (emergency), &lt;code&gt;alert&lt;/code&gt;, &lt;code&gt;crit&lt;/code&gt; (critical), &lt;code&gt;err&lt;/code&gt; (error), &lt;code&gt;warn&lt;/code&gt; (warning), &lt;code&gt;notice&lt;/code&gt;, &lt;code&gt;info&lt;/code&gt;, and &lt;code&gt;debug&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dmesg &lt;span class="nt"&gt;-l&lt;/span&gt; err,warn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Continuous monitoring
&lt;/h3&gt;

&lt;p&gt;To monitor the kernel messages in real-time as new messages are logged, you can use the -w or --follow option&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dmesg &lt;span class="nt"&gt;-w&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Clearing the kernel ring buffer
&lt;/h3&gt;

&lt;p&gt;Sometimes, you might want to clear the ring buffer, such as after diagnosing an issue and wanting to start with a clean slate. This can be done using the &lt;code&gt;-c&lt;/code&gt; or &lt;code&gt;--clear&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dmesg &lt;span class="nt"&gt;-c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;dmesg&lt;/code&gt; command is a versatile tool that empowers system administrators to gain insights into the inner workings of the Linux kernel. By mastering its various options, you can effectively diagnose issues, analyze system behavior, and ensure the stability and reliability of your Linux systems. Whether you're troubleshooting boot failures, managing devices and drivers, or debugging kernel-level problems, &lt;code&gt;dmesg&lt;/code&gt; remains an invaluable asset in your system administration toolkit&lt;/p&gt;

</description>
      <category>linux</category>
      <category>bash</category>
      <category>terminal</category>
    </item>
    <item>
      <title>Formatting &amp; Mounting Storage Volumes</title>
      <dc:creator>Syam SV</dc:creator>
      <pubDate>Thu, 24 Aug 2023 04:48:56 +0000</pubDate>
      <link>https://dev.to/_undefined_/formatting-mounting-storage-volumes-af</link>
      <guid>https://dev.to/_undefined_/formatting-mounting-storage-volumes-af</guid>
      <description>&lt;h2&gt;
  
  
  Listing and Identifying Storage Devices
&lt;/h2&gt;

&lt;p&gt;let's begin by learning how to list and identify the storage devices attached to your system. Using the lsblk command, you can get a comprehensive list of all the block devices, such as hard drives and USB flash drives, connected to your machine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lsblk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each storage device is uniquely identified by a device name like sda, sdb, etc., which will help you interact with them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a Partition Table and Partitions with fdisk
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;fdisk&lt;/code&gt; is a powerful command-line tool that allows you to create and manage partition tables on your storage devices. In this section, it'll walk you through the process of creating a partition table, creating partitions, and writing the changes to the disk.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Be cautious when using fdisk as it directly modifies the disk's partition table. Any incorrect actions may lead to data loss. Make sure you have a backup of your important data before proceeding.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Identify the Disk Device&lt;br&gt;
Before using fdisk, you need to identify the disk device you want to partition. To list all available disks, use the lsblk command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lsblk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Identify the disk you want to partition, such as /dev/sdX (e.g., /dev/sda, /dev/sdb, etc.), where "X" is the specific letter assigned to the disk by the system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Launching fdisk
&lt;/h2&gt;

&lt;p&gt;To start partitioning the disk, run fdisk with the chosen disk device:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;fdisk /dev/sdX
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;/dev/sdX&lt;/code&gt; with the appropriate disk identifier.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a New Partition Table
&lt;/h3&gt;

&lt;p&gt;If the disk is not yet partitioned or you want to create a new partition table, follow these steps:&lt;br&gt;
a. Press &lt;code&gt;g&lt;/code&gt; to create a new GPT (GUID Partition Table) or &lt;code&gt;m&lt;/code&gt; to create a new MSDOS (MBR) partition table.&lt;/p&gt;
&lt;h3&gt;
  
  
  Creating Partitions
&lt;/h3&gt;

&lt;p&gt;To create a new partition, follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Press n to start creating a new partition.&lt;/li&gt;
&lt;li&gt;Specify the partition number (e.g., 1, 2, etc.).&lt;/li&gt;
&lt;li&gt;Specify the starting sector (press Enter for the default).&lt;/li&gt;
&lt;li&gt;Specify the ending sector. You can either:&lt;/li&gt;
&lt;li&gt;Use a specific size (e.g., +1G for 1 gigabyte) or&lt;/li&gt;
&lt;li&gt;Press Enter to use the remaining space on the disk.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Formatting a Storage Device
&lt;/h2&gt;

&lt;p&gt;After creating partitions, you'll typically need to format them with a file system before using them. Once you've identified the storage device you want to utilize, you might need to format it with a specific file system type before you can use it. For Linux, the most common file system types are ext4, while for cross-platform compatibility with Windows, you can use exFAT. Here are the commands to format the partition:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mkfs.ext4 /dev/&amp;lt;device_partition&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mkfs.exfat &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"label"&lt;/span&gt; /dev/&amp;lt;device_partition&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace  with the appropriate partition identifier, such as /dev/sdb1, for your device.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mounting the Storage Volume
&lt;/h2&gt;

&lt;p&gt;After formatting the partition, you can mount it to make it accessible within the file system. You have the flexibility to mount the partition to any folder you like, but commonly used mount points are /mnt for permanent volumes and /media for temporary ones.&lt;/p&gt;

&lt;p&gt;Here's how you can mount the partition:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mount /dev/&amp;lt;device_partition&amp;gt; /&amp;lt;mount_path&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we can see each option can be supplied along with a value when mounting the device.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mount &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nv"&gt;uid&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;uid&amp;gt;,gid&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;group_id&amp;gt; /dev/&amp;lt;device_partition&amp;gt; /&amp;lt;mount_path&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace  with the directory where you want to access the storage volume.&lt;/p&gt;

&lt;h2&gt;
  
  
  Analyzing Disk Usage with ncdu
&lt;/h2&gt;

&lt;p&gt;Now, let's introduce you to a powerful storage management tool called ncdu. In case it's not already installed, you might need to install it first. For Fedora and Centos use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;ncdu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Debian-based systems, use apt instead of dnf.&lt;/p&gt;

&lt;p&gt;Once installed, you can use ncdu to analyze disk usage on your system. This tool provides a detailed breakdown of files and directories consuming the most space. To use ncdu, simply run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ncdu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will display the disk usage starting from your current directory. You can navigate through the results, drill down into directories, and identify which files are taking up the most space. This tool is incredibly handy when you need to reclaim storage space on your system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Automating Mounts with /etc/fstab
&lt;/h2&gt;

&lt;p&gt;For those looking to automate the process of mounting storage volumes during system boot, the /etc/fstab file comes to the rescue. However, editing this file requires caution, as mistakes can prevent your system from booting correctly.&lt;/p&gt;

&lt;p&gt;The /etc/fstab file allows you to specify the devices and mount points you want to mount automatically at startup, using UUIDs or device names to identify the storage volumes. Please note that editing this file requires an understanding of the correct syntax and should be approached carefully. If you're unsure, it's best to seek expert guidance or create proper backups before making any changes.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>disk</category>
    </item>
    <item>
      <title>Firewalld Basics and Usage with firewall-cmd:</title>
      <dc:creator>Syam SV</dc:creator>
      <pubDate>Mon, 21 Aug 2023 05:54:09 +0000</pubDate>
      <link>https://dev.to/_undefined_/firewalld-basics-and-usage-with-firewall-cmd-46if</link>
      <guid>https://dev.to/_undefined_/firewalld-basics-and-usage-with-firewall-cmd-46if</guid>
      <description>&lt;p&gt;Firewalld is a robust firewall management tool available for various Linux distributions. It provides a user-friendly interface for managing iptables, the packet filtering system within the Linux kernel. we will walk the fundamentals of setting up and configuring Firewalld using the firewall-cmd command-line utility. &lt;/p&gt;

&lt;p&gt;Detailed documentation about Firewalld can be found at the provided &lt;a href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/sec-using_firewalls#sec-Getting_started_with_firewalld"&gt;link&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Concepts in Firewalld
&lt;/h2&gt;

&lt;p&gt;Firewalld introduces the concept of "zones," which dictate the behavior of the firewall based on the level of trust associated with the networks your system is connected to. Zones provide flexibility, enabling you to tailor rules depending on your environment. For instance, a laptop might need stricter rules on a public WiFi network while being more relaxed on a trusted home network. Predefined zones range from least trusted (e.g., drop, block) to most trusted (trusted, internal). The firewall-cmd utility facilitates the management of these zones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Zones in Firewalld
&lt;/h2&gt;

&lt;p&gt;In Firewalld, zones are a crucial concept that dictates how the firewall treats network traffic based on the level of trust associated with the networks your system is connected to. Each zone defines a set of rules that determine which traffic is allowed and which is denied. Firewalld allows you to assign different interfaces to different zones, allowing for a flexible approach to network security. Zones are particularly useful for systems that might move between different networks, such as laptops, and for segmenting trust levels on servers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Default Zones
&lt;/h2&gt;

&lt;p&gt;Firewalld comes with a set of predefined zones, each with a different level of trust. Here are the default zones provided by Firewalld, listed from least trusted to most trusted:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;drop&lt;/strong&gt; : This is the lowest level of trust. All incoming connections are dropped without a reply, and only outgoing connections are possible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;block&lt;/strong&gt; : Similar to "drop," incoming connections are rejected with an ICMP message. Outgoing connections are allowed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;public&lt;/strong&gt; : Represents public, untrusted networks. You allow selected incoming connections on a case-by-case basis. This zone is useful for public Wi-Fi networks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;external&lt;/strong&gt; : Designed for external networks when your system is acting as a gateway. It configures NAT masquerading to keep your internal network private yet reachable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;internal&lt;/strong&gt; : Used for the internal side of a gateway. This zone assumes more trustworthiness for the computers and allows some additional services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;dmz&lt;/strong&gt; : Used for computers located in a DMZ (isolated computers that won't access the rest of your network). Only certain incoming connections are allowed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;work&lt;/strong&gt; : Meant for work machines. You trust most computers on the network, and a few more services might be allowed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;home&lt;/strong&gt; : Suitable for home environments. It implies a higher level of trust among computers, and more services will be accepted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;trusted&lt;/strong&gt; : The most open option, to be used sparingly. It trusts all machines in the network.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Targets
&lt;/h2&gt;

&lt;p&gt;Within each zone, there's a concept called "target." A target defines the default behavior of the firewall for incoming traffic. These targets are used to specify what happens when an incoming connection matches the rules of the zone. Here are the common targets used in Firewalld:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;default&lt;/strong&gt; : This is the default target. It allows the default behavior for the zone, which can be controlled further through rule definitions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;accept&lt;/strong&gt; : Incoming traffic is accepted without restrictions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;drop&lt;/strong&gt; : Incoming traffic is dropped without any response.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;reject&lt;/strong&gt; : Similar to "drop," but the system responds with an ICMP error message.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;masquerade&lt;/strong&gt; : Used for source NAT (Network Address Translation) to modify the source IP address of outgoing packets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;redirect&lt;/strong&gt; : Used for destination NAT to redirect incoming packets to a different IP address and port.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Rule Permanence
&lt;/h2&gt;

&lt;p&gt;Firewalld rules can be immediate (active during the current session) or permanent (persist after reboot). The --permanent flag designates permanent rules that apply across reboots. This separation allows testing rules in the current session before making them permanent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing and Enabling Firewalld
&lt;/h2&gt;

&lt;p&gt;To install Firewalld, use your package manager (e.g., &lt;code&gt;sudo apt install firewalld&lt;/code&gt;). After installation, enable the service to start at boot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;firewalld
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's recommended to configure your firewall rules and test them before enabling this behavior to avoid potential issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verifying Firewalld Status
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Check if Firewalld is up and running:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--state&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A "running" status indicates that the firewall is operational with the default configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exploring Current Firewall Rules
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; Get the default zone:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firewall-cmd &lt;span class="nt"&gt;--get-default-zone&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt; List active zones:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firewall-cmd &lt;span class="nt"&gt;--get-active-zones&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt; View rules for a zone (e.g., "public"):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;public &lt;span class="nt"&gt;--list-all&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt; To move an interface to a different zone during the current session:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;new-zone &lt;span class="nt"&gt;--change-interface&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;interface-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Adjusting Default Zone
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Change the default zone:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--set-default-zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;new-default-zone
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Adding Services to Zones
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; List available services:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firewall-cmd &lt;span class="nt"&gt;--get-services&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt; Add a service to a zone (e.g., "public"):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;public &lt;span class="nt"&gt;--add-service&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;service-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt; Make the change permanent:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;public &lt;span class="nt"&gt;--permanent&lt;/span&gt; &lt;span class="nt"&gt;--add-service&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;service-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Opening Ports for Specific Applications
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; Open a port for a zone (e.g., "public"):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;public &lt;span class="nt"&gt;--add-port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;port/protocol
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt; Open a port range:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;public &lt;span class="nt"&gt;--add-port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;start-end/protocol
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Defining Custom Services
&lt;/h2&gt;

&lt;p&gt;Copy an existing service definition (e.g., SSH) to create a custom service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo cp&lt;/span&gt; /usr/lib/firewalld/services/ssh.xml /etc/firewalld/services/custom-service.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Modify the custom service definition in /etc/firewalld/services/custom-service.xml.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reload the firewall to apply changes:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--reload&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating Your Own Zones
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create a new zone (e.g., "custom-zone"):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--permanent&lt;/span&gt; &lt;span class="nt"&gt;--new-zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;custom-zone
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Reload the firewall to activate the new zone:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--reload&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Assign interfaces to the new zone (if interface is not already assigned ):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;custom-zone &lt;span class="nt"&gt;--add-interface&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;interface-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Firewalld provides an effective way to manage firewall rules using zones and services. By understanding these concepts and the usage of the firewall-cmd utility, you can create tailored firewall configurations that cater to your network environment. Additionally, the installation of Firewalld with nftables enhances your firewall capabilities, contributing to improved security and network management.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>firewall</category>
      <category>terminal</category>
    </item>
    <item>
      <title>Unveiling Linux Command's - rsync</title>
      <dc:creator>Syam SV</dc:creator>
      <pubDate>Mon, 21 Aug 2023 05:42:15 +0000</pubDate>
      <link>https://dev.to/_undefined_/unveiling-linux-commands-rsync-1o5</link>
      <guid>https://dev.to/_undefined_/unveiling-linux-commands-rsync-1o5</guid>
      <description>&lt;p&gt;Rsync (Remote Sync) is a command-line utility used for efficiently transferring and synchronizing files and directories between local and remote systems. It uses an algorithm to minimize the amount of data copied by only moving the portions of files that have changed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Syntax:
&lt;/h2&gt;

&lt;p&gt;The basic syntax of the rsync command is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="o"&gt;[&lt;/span&gt;options] &lt;span class="nb"&gt;source &lt;/span&gt;destination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;source: The source directory or file you want to transfer.&lt;/li&gt;
&lt;li&gt;destination: The target directory or location where you want to copy the source.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Commonly Used Options:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;-a or --archive: This option enables archive mode, which preserves file permissions, ownership, timestamps, and more. It's often used for full data synchronization.&lt;/li&gt;
&lt;li&gt;-v or --verbose: Enables verbose output, showing details about the files being transferred.&lt;/li&gt;
&lt;li&gt;-r or --recursive: Enables recursive mode, ensuring that all subdirectories and their contents are transferred.&lt;/li&gt;
&lt;li&gt;--dry-run: Simulates the transfer without actually performing it. Useful for previewing what would be copied.&lt;/li&gt;
&lt;li&gt;--delete: Deletes files at the destination that are not present in the source. Useful for maintaining exact synchronization.&lt;/li&gt;
&lt;li&gt;-z or --compress: Compresses files during transfer, which can improve transfer speed over slow connections.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Use Cases and Examples:
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Local Copy:
&lt;/h2&gt;

&lt;p&gt;To copy files or directories locally, use the basic syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-av&lt;/span&gt; source_directory/ destination_directory/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Remote Copy:
&lt;/h2&gt;

&lt;p&gt;To copy files or directories from a local system to a remote server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-av&lt;/span&gt; source_directory/ user@remote_server:/path/to/destination/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Remote Copy with SSH:
&lt;/h2&gt;

&lt;p&gt;To copy files or directories from a local system to a remote server over SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-av&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"ssh -i /path/to/key.pem"&lt;/span&gt; source_directory/ user@remote_server:/path/to/destination/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-av&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; ssh source_directory/ user@remote_server:/path/to/destination/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Exclude Files or Directories:
&lt;/h2&gt;

&lt;p&gt;To exclude specific files or directories from the transfer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-av&lt;/span&gt; &lt;span class="nt"&gt;--exclude&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"file_to_exclude"&lt;/span&gt; source_directory/ destination_directory/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Dry Run:
&lt;/h2&gt;

&lt;p&gt;To preview the transfer without actually copying:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-av&lt;/span&gt; &lt;span class="nt"&gt;--dry-run&lt;/span&gt; source_directory/ destination_directory/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Delete Unwanted Files:
&lt;/h3&gt;

&lt;p&gt;To remove files at the destination that are not in the source:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-av&lt;/span&gt; &lt;span class="nt"&gt;--delete&lt;/span&gt; source_directory/ destination_directory/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Compressed Transfer:
&lt;/h2&gt;

&lt;p&gt;To enable compression during transfer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-avz&lt;/span&gt; source_directory/ user@remote_server:/path/to/destination/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Maintain Metadata:
&lt;/h2&gt;

&lt;p&gt;To ensure metadata consistency during transfers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-av&lt;/span&gt; source_directory/ destination_directory/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Synchronize Remote Directory:
&lt;/h2&gt;

&lt;p&gt;To synchronize a remote directory with a local one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-av&lt;/span&gt; user@remote_server:/path/to/source_directory/ local_destination/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Copying Remote to Local:
&lt;/h2&gt;

&lt;p&gt;To copy files from a remote server to a local machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-av&lt;/span&gt; user@remote_server:/path/to/source_directory/ local_destination/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Backup option in Rsync
&lt;/h2&gt;

&lt;p&gt;Rsync’s --backup option can be used to store backups of important files. It’s used in along with the --backup-dir option, which specifies the directory where the backup files should be stored&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rsync &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nt"&gt;--delete&lt;/span&gt; &lt;span class="nt"&gt;--backup&lt;/span&gt; &lt;span class="nt"&gt;--backup-dir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/path/to/backups /path/to/source destination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;Rsync is a versatile tool for efficiently transferring and synchronizing files between local and remote systems. It provides various options that allow you to control the behavior of the transfer, maintain metadata consistency, exclude files, and even simulate transfers before executing them. Its ability to work over SSH ensures secure data transfers across networks, making it an essential tool for managing and backing up data in a Linux environment.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>bash</category>
      <category>terminal</category>
    </item>
    <item>
      <title>Unveiling Linux Command's - usermod</title>
      <dc:creator>Syam SV</dc:creator>
      <pubDate>Mon, 21 Aug 2023 05:39:30 +0000</pubDate>
      <link>https://dev.to/_undefined_/unveiling-linux-commands-usermod-476</link>
      <guid>https://dev.to/_undefined_/unveiling-linux-commands-usermod-476</guid>
      <description>&lt;p&gt;The usermod command in Linux is a powerful tool that helps system administrators modify various attributes of user accounts. These attributes include user groups, home directories, usernames, and more. It's like a tool that lets you change how a user works with the system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding Users to Groups
&lt;/h2&gt;

&lt;p&gt;Imagine you have a Linux server where you need to give specific users special permissions. This is where usermod comes in handy. You can add a user to an existing group using this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; &amp;lt;group-name&amp;gt; &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For instance, if you want to add a user named "alice" to the "developers" group, the command would look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; developers alice
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Moving User Home Directories
&lt;/h2&gt;

&lt;p&gt;Home directories are where users store their personal files and settings. If you need to move a user's home directory to a different location, usermod can help:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-d&lt;/span&gt; &amp;lt;new-directory&amp;gt; &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Suppose you want to move the home directory of the user "bob" to "/newhome":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-d&lt;/span&gt; /newhome bob
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Changing Usernames
&lt;/h2&gt;

&lt;p&gt;Usernames might need to be changed for various reasons, like rebranding or making usernames consistent across systems. Usermod makes this process simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-l&lt;/span&gt; &amp;lt;new-username&amp;gt; &amp;lt;old-username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, if you want to change the username "olduser" to "newuser":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-l&lt;/span&gt; newuser olduser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  User Expiration
&lt;/h2&gt;

&lt;p&gt;Security is crucial in user management. With usermod, you can set an expiration date for a user to enhance security:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-e&lt;/span&gt; &amp;lt;expiration-date&amp;gt; &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Suppose you want the password for the user "jane" to expire on January 1, 2024:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-e&lt;/span&gt; 2024-01-01 jane
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Locking and unlocking user
&lt;/h2&gt;

&lt;p&gt;Locking a user account prevents the user from accessing the system. Locking can be helpful in certain situations. To lock a user account using the usermod command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-L&lt;/span&gt; &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unlocking a user account is equally important, as you may need to restore access after resolving a situation. To unlock a user account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-U&lt;/span&gt; &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In the world of Linux system administration, the usermod command plays a crucial role in managing user accounts effectively. Its ability to modify user attributes like groups, home directories, usernames, and password expiration dates empowers administrators to maintain a secure and organized system.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>terminal</category>
      <category>bash</category>
    </item>
    <item>
      <title>Unveiling Linux Command's - scp (Secure Copy)</title>
      <dc:creator>Syam SV</dc:creator>
      <pubDate>Mon, 21 Aug 2023 05:37:11 +0000</pubDate>
      <link>https://dev.to/_undefined_/unveiling-linux-commands-scp-secure-copy-1k5c</link>
      <guid>https://dev.to/_undefined_/unveiling-linux-commands-scp-secure-copy-1k5c</guid>
      <description>&lt;p&gt;SCP (Secure Copy) is a command-line utility in Unix-like operating systems that enables secure and efficient file transfers between a local and remote host or between two remote hosts. It is built on top of the SSH protocol, ensuring data confidentiality and integrity during the transfer process. SCP is widely used for transferring files and directories in a secure manner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Syntax:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp &lt;span class="o"&gt;[&lt;/span&gt;options] &lt;span class="nb"&gt;source &lt;/span&gt;destination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Common Options:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;-r: Recursively copy directories and their contents.&lt;/li&gt;
&lt;li&gt;-p: Preserve modification times, access times, and modes from the original files.&lt;/li&gt;
&lt;li&gt;-P port: Specify a different port for SSH. Default is 22.&lt;/li&gt;
&lt;li&gt;-i identity_file: Use an identity file (private key) for authentication.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Some common usecases
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Copying a File from Local to Remote:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp file.txt user@remotehost:/path/to/destination/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This copies the local file file.txt to the remote server at the specified path.&lt;/p&gt;

&lt;h3&gt;
  
  
  Copying a File from Remote to Local:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp user@remotehost:/path/to/source/file.txt /local/destination/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This copies the remote file file.txt to the local machine at the specified path.&lt;/p&gt;

&lt;h3&gt;
  
  
  Copying a Directory Recursively:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp &lt;span class="nt"&gt;-r&lt;/span&gt; directory/ user@remotehost:/path/to/destination/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The -r option allows you to copy the entire directory and its contents.&lt;/p&gt;

&lt;h3&gt;
  
  
  Copying with a Different Port:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp &lt;span class="nt"&gt;-P&lt;/span&gt; 2222 file.txt user@remotehost:/path/to/destination/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command specifies a non-default SSH port (2222) for the transfer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preserving File Metadata:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp &lt;span class="nt"&gt;-p&lt;/span&gt; file.txt user@remotehost:/path/to/destination/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The -p option maintains the original modification times and permissions of the file.&lt;/p&gt;

&lt;p&gt;Copying Between Two Remote Hosts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp user1@remotehost1:/file.txt user2@remotehost2:/path/to/destination/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This copies a file from one remote host to another.&lt;/p&gt;

&lt;p&gt;Using Identity File for Authentication:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp &lt;span class="nt"&gt;-i&lt;/span&gt; ~/.ssh/my_private_key.pem file.txt user@remotehost:/path/to/destination/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The -i option specifies the private key for SSH authentication.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparison with Other Tools:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SCP&lt;/strong&gt; vs. &lt;strong&gt;rsync&lt;/strong&gt; : SCP is suitable for simple one-time transfers, while rsync is more versatile for syncing and incremental transfers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;The SCP command provides a secure and efficient way to transfer files and directories between local and remote hosts. Its use cases include simple file transfers, recursive directory transfers, specifying custom SSH ports, preserving file metadata, and more. By leveraging the SSH protocol, SCP ensures data security and integrity during the transfer process.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>terminal</category>
      <category>bash</category>
    </item>
    <item>
      <title>Unveiling Linux Command's - useradd &amp; adduser</title>
      <dc:creator>Syam SV</dc:creator>
      <pubDate>Mon, 21 Aug 2023 05:32:11 +0000</pubDate>
      <link>https://dev.to/_undefined_/unveiling-linux-commands-useradd-adduser-1pa1</link>
      <guid>https://dev.to/_undefined_/unveiling-linux-commands-useradd-adduser-1pa1</guid>
      <description>&lt;p&gt;When it comes to managing user accounts on a Linux system, two commonly used commands are &lt;code&gt;useradd&lt;/code&gt; and &lt;code&gt;adduser&lt;/code&gt;. While both commands are used to create user accounts, they have distinct differences in terms of flexibility, user-friendliness, and functionalities. In this blog post, we'll delve into the nuances of each command and provide step-by-step guides on how to use them.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;useradd&lt;/code&gt; Command
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;useradd&lt;/code&gt; command is a fundamental utility for creating user accounts on Linux systems. It's a low-level command that allows system administrators to create new users with specific configurations. However, using &lt;code&gt;useradd&lt;/code&gt; requires you to set various options manually, which can be more complex and time-consuming, especially for beginners.&lt;/p&gt;

&lt;p&gt;To create a user named "newuser," use the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;useradd newuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set a password for the new user&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;passwd newuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To specify the home directory for the user, use the &lt;code&gt;-d&lt;/code&gt; option&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;useradd &lt;span class="nt"&gt;-d&lt;/span&gt; /home/customdir newuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Assign a specific user ID (UID) using the &lt;code&gt;-u&lt;/code&gt; option (replace &lt;code&gt;UID&lt;/code&gt; with the desired ID):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;useradd &lt;span class="nt"&gt;-u&lt;/span&gt; UID newuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To set an expiration date for the user account, use the &lt;code&gt;-e&lt;/code&gt; option followed by the date in YYYY-MM-DD format&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;useradd &lt;span class="nt"&gt;-e&lt;/span&gt; 2023-12-31 newuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;adduser&lt;/code&gt; Command
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;adduser&lt;/code&gt; command is a higher-level utility designed to simplify the process of adding new user accounts. It prompts the user with a series of questions, allowing for interactive configuration. This makes it more user-friendly and suitable for those who are less familiar with command-line options&lt;/p&gt;

&lt;p&gt;To start the interactive user creation process, type&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;adduser newuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command will prompt you to set a password, full name, phone number, etc., for the new user. You can specify additional information such as the home directory, user groups, and expiration date for the account&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In summary, both the &lt;code&gt;useradd&lt;/code&gt; and &lt;code&gt;adduser&lt;/code&gt; commands serve the purpose of creating user accounts on Linux systems. The choice between them depends on your level of familiarity with command-line options and the degree of user interaction you desire. If you're comfortable with configuring options manually, &lt;code&gt;useradd&lt;/code&gt; offers fine-grained control. On the other hand, if you prefer a more user-friendly and interactive approach, &lt;code&gt;adduser&lt;/code&gt; is a better choice.&lt;/p&gt;

&lt;p&gt;Regardless of the command you choose, managing user accounts is a critical aspect of Linux system administration. Select the command that aligns with your needs and expertise to efficiently create and manage user accounts on your system.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>terminal</category>
      <category>bash</category>
    </item>
    <item>
      <title>Unveiling Linux Command's - find</title>
      <dc:creator>Syam SV</dc:creator>
      <pubDate>Sat, 19 Aug 2023 14:28:13 +0000</pubDate>
      <link>https://dev.to/_undefined_/unveiling-linux-commands-find-5ffg</link>
      <guid>https://dev.to/_undefined_/unveiling-linux-commands-find-5ffg</guid>
      <description>&lt;p&gt;Searching for files on your Linux system can sometimes feel like searching for a needle in a haystack. The &lt;code&gt;find&lt;/code&gt; command is here to make your file-finding tasks easy. In this post, we'll walk you through various scenarios where the &lt;code&gt;find&lt;/code&gt; command becomes very useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding files by name
&lt;/h2&gt;

&lt;p&gt;Ever found yourself hunting for a file but forgetting where you stashed it? The &lt;code&gt;find&lt;/code&gt; command can help you pinpoint it. When you're in your terminal, type&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find /path/to/search &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"filename"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just replace &lt;code&gt;/path/to/search&lt;/code&gt; with your starting directory and &lt;code&gt;filename&lt;/code&gt; with the elusive file's name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding files by size
&lt;/h2&gt;

&lt;p&gt;Sometimes you're dealing with large files, and sometimes it's the tiny ones causing a stir. &lt;code&gt;find&lt;/code&gt; can help with that too! To locate files based on their size, use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find /path/to/search &lt;span class="nt"&gt;-size&lt;/span&gt; +size_unit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace&lt;code&gt;/path/to/search&lt;/code&gt; with your directory and size_unit with the size you're after (like &lt;code&gt;10M&lt;/code&gt; for 10 megabytes). To find small files, use - instead of +.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding files by user
&lt;/h2&gt;

&lt;p&gt;Who's the owner of that file? &lt;code&gt;find&lt;/code&gt; can answer that. To discover files owned by a specific user or group&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find /path/to/search &lt;span class="nt"&gt;-user&lt;/span&gt; username
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace /path/to/search with your directory and username with the owner's name. Similar to the user scenario, you can also use &lt;code&gt;-group groupname&lt;/code&gt; to find files owned by a particular group.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding files by permission
&lt;/h2&gt;

&lt;p&gt;Permissions can be quite the puzzle. But &lt;code&gt;find&lt;/code&gt;can help you unravel it. To identify files with specific permissions, type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find /path/to/search &lt;span class="nt"&gt;-perm&lt;/span&gt; permissions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;/path/to/search&lt;/code&gt; is your directory, and &lt;code&gt;permissions&lt;/code&gt; are the numeric values (like 755 for read, write, and execute). If you want files with any of the specified permission bits, use -perm /permissions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding files by date and time
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;find&lt;/code&gt; command help you to navigate through time and locate files based on their access, modification, or change times.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find /path/to/search &lt;span class="nt"&gt;-atime&lt;/span&gt;/-ctime/-mtime +/-time_unit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;/path/to/search&lt;/code&gt; with your directory, pick &lt;code&gt;atime&lt;/code&gt;, &lt;code&gt;ctime&lt;/code&gt;, or &lt;code&gt;mtime&lt;/code&gt;, and adjust &lt;code&gt;+/-time_unit&lt;/code&gt; to specify the time frame.&lt;/p&gt;

&lt;p&gt;Following are some example cases to understand &lt;/p&gt;

&lt;h3&gt;
  
  
  Find Recently Modified Files in the a directory
&lt;/h3&gt;

&lt;p&gt;Imagine you've made some recent changes to your system configuration files in a directory, and you want to identify files that have been modified within the last 10 minutes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find /path/to/search  &lt;span class="nt"&gt;-mmin&lt;/span&gt; &lt;span class="nt"&gt;-10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will provide you with a list of files in the &lt;code&gt;/etc&lt;/code&gt; directory that have been modified within the last 10 minutes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Locate Recently Changed files
&lt;/h3&gt;

&lt;p&gt;To find files that have been changed within the last 2 days across multiple important directories, use this &lt;code&gt;find&lt;/code&gt; command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find /usr/bin /usr/sbin &lt;span class="nt"&gt;-ctime&lt;/span&gt; &lt;span class="nt"&gt;-2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By executing this command, you'll obtain a list of files that have undergone changes in the specified time frame.&lt;/p&gt;

&lt;h3&gt;
  
  
  Identify Unused Files in Web Directories
&lt;/h3&gt;

&lt;p&gt;When managing websites, it's important to keep track of files that haven't been accessed for a while. For instance, let's say you want to find files in the &lt;code&gt;/var/www&lt;/code&gt; directory that haven't been accessed for over 300 days. Here's the &lt;code&gt;find&lt;/code&gt; command to achieve that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find /var/www &lt;span class="nt"&gt;-atime&lt;/span&gt; +300
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Upon executing this command, you'll receive a list of files within the specified directories that meet the time-based criteria.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding files and executing commands
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;find&lt;/code&gt; command is not just about discovering files; it's also about taking action on them. This is where the &lt;code&gt;-exec&lt;/code&gt; flag comes into play. With it, you can execute a command on each file that matches your search criteria.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find /path/to/search &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"filename"&lt;/span&gt; &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;command&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, find text files and print their contents&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find /home/user/documents &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"*.txt"&lt;/span&gt; &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Interactively Approve Actions
&lt;/h2&gt;

&lt;p&gt;Sometimes, before making changes to files, you want to be sure. The &lt;code&gt;-ok&lt;/code&gt; flag in &lt;code&gt;find&lt;/code&gt; enables an interactive mode that asks for your confirmation before executing a command on each file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find /path/to/search &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"filename"&lt;/span&gt; &lt;span class="nt"&gt;-ok&lt;/span&gt; &lt;span class="nb"&gt;command&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example safely deleting files&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find /home/user/trash_files &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"*~"&lt;/span&gt; &lt;span class="nt"&gt;-ok&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With these scenarios, &lt;code&gt;find&lt;/code&gt; becomes a tool not only for locating files but also for performing actions on them, whether you're printing file contents or confirming deletions. It adds a layer of efficiency and control to your file management tasks&lt;/p&gt;

</description>
      <category>linux</category>
      <category>find</category>
      <category>terminal</category>
    </item>
    <item>
      <title>Logical Volume Manager (LVM) in Linux - A Walkthrough - Part 2</title>
      <dc:creator>Syam SV</dc:creator>
      <pubDate>Fri, 18 Aug 2023 18:55:28 +0000</pubDate>
      <link>https://dev.to/_undefined_/logical-volume-manager-lvm-in-linux-a-walkthrough-part-2-2o7d</link>
      <guid>https://dev.to/_undefined_/logical-volume-manager-lvm-in-linux-a-walkthrough-part-2-2o7d</guid>
      <description>&lt;p&gt;Logical Volume Manager (LVM) provides several benefits such as dynamic resizing, volume snapshots, and simplified disk management. In this Part, we'll walk through how to achieve these tasks. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Remember to exercise caution as these commands can affect your storage and preferably use a virtual machine and virtual disks to test around as example shown below.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5yfVwoyI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nxlwhahhjoe9s64lq3uk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5yfVwoyI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nxlwhahhjoe9s64lq3uk.png" alt="virtualBox" width="800" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can use the &lt;code&gt;lsblk&lt;/code&gt; command to check the disk layout of your system&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lsblk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating Physical Volumes
&lt;/h3&gt;

&lt;p&gt;To create physical volumes on existing partitions, use the following &lt;code&gt;pvcreate&lt;/code&gt; command. This will erase any data in the respective disks :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvcreate &amp;lt;...list of block devices...&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvcreate /dev/sdb1 /dev/sdb2 /dev/sdc1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List the created physical volumes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvdisplay
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating Volume Groups
&lt;/h3&gt;

&lt;p&gt;Create a volume group with the vgcreate command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vgcreate volume_group_name &amp;lt;...list of physical volumes... &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vgcreate vgvolume /dev/sdb1 /dev/sdb2 /dev/sdc1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Display information about the volume group&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vgdisplay
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating Logical Volumes
&lt;/h3&gt;

&lt;p&gt;Create logical volumes using &lt;code&gt;lvcreate&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lvcreate &lt;span class="nt"&gt;-n&lt;/span&gt; name &lt;span class="nt"&gt;-L&lt;/span&gt; size[G,M] volume_group_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lvcreate &lt;span class="nt"&gt;-n&lt;/span&gt; LV_main &lt;span class="nt"&gt;-L&lt;/span&gt; 7G vgvolume
lvcreate &lt;span class="nt"&gt;-n&lt;/span&gt; LV_secondary &lt;span class="nt"&gt;-L&lt;/span&gt; 1G vgvolume
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Display information about the logical volumes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lvdisplay
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we can mount the logical volume's by using the &lt;code&gt;mount&lt;/code&gt; command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; mount /dev/vgvolume/LV_main /mnt/my_mount_point
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Extending LVM
&lt;/h3&gt;

&lt;p&gt;Extending Logical Volumegives a flexible way to manage storage by dynamically resizing logical volumes and effectively utilizing newly added physical storage.&lt;/p&gt;

&lt;h4&gt;
  
  
  Adding New Physical Volumes:
&lt;/h4&gt;

&lt;p&gt;When additional physical storage is available, connect a new drive to the system. Create a new physical volume on this drive using the &lt;code&gt;pvcreate&lt;/code&gt; command&lt;/p&gt;

&lt;p&gt;example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pvcreate /dev/sdd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Extending the Volume Group:
&lt;/h4&gt;

&lt;p&gt;Extend the existing volume group to incorporate the newly created physical volume&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vgextend vgvolume /dev/sdd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace vgvolume with the name of your volume group and the physical volume with appropriate name .&lt;/p&gt;

&lt;h4&gt;
  
  
  Extending Logical Volumes:
&lt;/h4&gt;

&lt;p&gt;Extend the size of the desired logical volume to utilize the added space. In following example command, where &lt;code&gt;LV_main&lt;/code&gt; is the name of the logical volume and i am adding 10GB to &lt;code&gt;LV_main&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lvextend &lt;span class="nt"&gt;-L&lt;/span&gt; +10G LV_main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Resizing the Filesystem:
&lt;/h4&gt;

&lt;p&gt;After extending the logical volume, the filesystem within it needs to be resized to utilize the additional space. For ext2/3/4 filesystems, use the resize2fs command or xfs_growfs for XFS filesystems&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;resize2fs /dev/vgvolume/LV_main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Snapshots with LVM
&lt;/h3&gt;

&lt;p&gt;Snapshots in Logical Volume Management (LVM) offer a powerful way to capture a point-in-time copy of a logical volume, allowing for data preservation, testing, and recovery. &lt;/p&gt;

&lt;p&gt;LVM allows you to create a snapshot of a logical volume. In the following example command, you can see how to create a snapshot named snapshot_name of the LV_main logical volume, with a size of 1GB&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lvcreate &lt;span class="nt"&gt;-L&lt;/span&gt; 1G &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; snapshot_name /dev/vgvolume/LV_main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To see the used space of all snapshots, run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lvs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command provides information about logical volumes, including snapshots and the orgin of the snapshot (ie. the orginal logical volume)&lt;/p&gt;

&lt;p&gt;You can mount a snapshot like any other block device. Use this command to mount the snapshot at a specified mount point&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mount /dev/vgvolume/snapshot_name /mnt/snapshot_mount_point
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And to restore a snapshot, first unmount the original logical volume if it's currently mounted&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;umount /mnt/snapshot_mount_point
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, restore the snapshot back to the original logical volume using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lvconvert &lt;span class="nt"&gt;--merge&lt;/span&gt; /dev/vgvolume/snapshot_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This operation merges the changes made to the snapshot back into the original volume. After restoring a snapshot, you may need to deactivate and reactivate the logical volume to ensure proper functioning&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lvchange &lt;span class="nt"&gt;-an&lt;/span&gt; /dev/vgvolume/LV_main
lvchange &lt;span class="nt"&gt;-ay&lt;/span&gt; /dev/vgvolume/LV_main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using LVM snapshots can provide a safety net when making changes to data or systems, allowing you to experiment without fear of losing critical information. However, keep in mind that snapshots consume space, and frequent or large snapshots can affect overall storage performance. Always monitor your storage usage and consider proper management strategies&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, Logical Volume Manager (LVM) is a versatile tool that offers dynamic storage management capabilities, making it an indispensable asset for system administrators, DevOps professionals, and anyone involved in managing storage resources efficiently. With LVM, you can resize volumes on the fly, create snapshots for data safety, and simplify disk management tasks. Remember that while LVM is a powerful tool, proper management practices are essential.&lt;/p&gt;

</description>
      <category>linux</category>
    </item>
    <item>
      <title>Logical Volume Manager (LVM) in Linux - Introduction - Part 1</title>
      <dc:creator>Syam SV</dc:creator>
      <pubDate>Fri, 18 Aug 2023 18:02:44 +0000</pubDate>
      <link>https://dev.to/_undefined_/logical-volume-manager-lvm-in-linux-introduction-part-1-1p4l</link>
      <guid>https://dev.to/_undefined_/logical-volume-manager-lvm-in-linux-introduction-part-1-1p4l</guid>
      <description>&lt;p&gt;Logical Volume Manager (LVM) is a technology and system for managing disk storage in Linux and other Unix-like operating systems. It provides a layer of abstraction between physical storage devices and the operating system, allowing for more flexible and dynamic management of storage resources. LVM offers several advantages over traditional disk partitioning, making it a popular choice for managing storage in modern Linux systems.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6IDTQeMI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ju0qr6bz4fx5m02dx4xu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6IDTQeMI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ju0qr6bz4fx5m02dx4xu.png" alt="LVM Base Image" width="401" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Physical Volumes (PVs)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Physical Volumes&lt;/strong&gt; are actual storage devices, such as hard drives or solid-state drives.&lt;/li&gt;
&lt;li&gt;LVM abstracts these physical devices into PVs, which are the building blocks of logical storage management.&lt;/li&gt;
&lt;li&gt;PVs can span entire disks or only specific partitions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Volume Groups (VGs)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Volume Groups&lt;/strong&gt; are created by grouping one or more physical volumes together.&lt;/li&gt;
&lt;li&gt;VGs act as a pool of storage space that can be used to create logical volumes.&lt;/li&gt;
&lt;li&gt;They provide a level of isolation between physical devices and logical volumes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Logical Volumes (LVs)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Logical Volumes&lt;/strong&gt; are the virtual partitions created within volume groups.&lt;/li&gt;
&lt;li&gt;LVs provide the filesystems and storage space that the operating system and applications use.&lt;/li&gt;
&lt;li&gt;They can be easily resized, extended, or shrunk without affecting other logical volumes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Snapshots
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Snapshots&lt;/strong&gt; are read-only copies of logical volumes at a specific point in time.&lt;/li&gt;
&lt;li&gt;They are useful for creating backups or testing changes without affecting the original data.&lt;/li&gt;
&lt;li&gt;Snapshots are created quickly and consume minimal additional space.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Advantages of LVM
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic Resizing:&lt;/strong&gt; LVM allows you to resize logical volumes and filesystems while the system is running, avoiding the need to unmount or reboot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility:&lt;/strong&gt; LVM provides a way to abstract and pool physical storage, making it easier to manage and allocate space as needed.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage Management:&lt;/strong&gt; LVM simplifies storage management tasks such as adding new disks, extending volumes, and managing storage space across multiple drives.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Volume Snapshots:&lt;/strong&gt; LVM enables the creation of read-only snapshots of logical volumes, facilitating data backups and recovery.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Striping and Mirroring:&lt;/strong&gt; LVM allows you to configure data striping (RAID 0) and data mirroring (RAID 1) for improved performance and redundancy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Logical Volume Migration:&lt;/strong&gt; LVM enables the migration of data between physical volumes, helping to optimize storage performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Less Risky:&lt;/strong&gt; Unlike traditional partitions, where resizing or changing requires significant effort and can be risky, LVM offers safer and more flexible alternatives.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Use Cases
&lt;/h2&gt;

&lt;p&gt;LVM is beneficial in various scenarios:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Server environments where storage needs are dynamic and may change over time.&lt;/li&gt;
&lt;li&gt;Virtualization environments where logical volumes can be allocated to virtual machines.&lt;/li&gt;
&lt;li&gt;Database servers that require flexible storage for growing data.&lt;/li&gt;
&lt;li&gt;Systems where data protection is crucial, thanks to mirroring and snapshot&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Logical Volume Manager (LVM) provides an efficient and flexible way to manage storage in Linux systems. By abstracting physical storage into logical volumes, LVM simplifies tasks such as resizing, extending, and managing storage space. Its dynamic resizing capabilities, support for snapshots, and data protection features make it a powerful tool for modern storage management needs.&lt;/p&gt;

</description>
      <category>linux</category>
    </item>
    <item>
      <title>Exploring Vagrant: Snapshots - Part 6</title>
      <dc:creator>Syam SV</dc:creator>
      <pubDate>Fri, 18 Aug 2023 12:12:02 +0000</pubDate>
      <link>https://dev.to/_undefined_/exploring-vagrant-snapshots-part-6-j7j</link>
      <guid>https://dev.to/_undefined_/exploring-vagrant-snapshots-part-6-j7j</guid>
      <description>&lt;p&gt;A snapshot is a saved state of a virtual machine at a specific point in time. This allows you to capture the current state of the virtual machine and return to it later if needed. Snapshots are useful for various scenarios, such as testing different configurations, rolling back changes, and isolating development environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a Snapshot
&lt;/h2&gt;

&lt;p&gt;To create a snapshot of a running virtual machine, use the &lt;code&gt;vagrant snapshot save&lt;/code&gt; command followed by the snapshot name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vagrant snapshot save &amp;lt;VM Name&amp;gt; &amp;lt;Snapshot Name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vagrant snapshot save my-vm snapshot1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Vagrant snapshots invoke the "snapshots" method of the provider. In the case of using Vagrant snapshot with VirtualBox, it triggers VirtualBox's snapshot functionality and the snapshots will be stored in the same location where the virtual machine was created.&lt;/p&gt;

&lt;h2&gt;
  
  
  Listing Snapshots
&lt;/h2&gt;

&lt;p&gt;To list all the snapshots associated with a virtual machine, use the &lt;code&gt;vagrant snapshot list&lt;/code&gt; &lt;br&gt;
command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vagrant snapshot list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or to list snapshots of a specific VM&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vagrant snapshot list &amp;lt;VM Name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Roll Back or Restoring a Snapshot
&lt;/h2&gt;

&lt;p&gt;You can roll back a virtual machine to a snapshot by restoring it. This is particularly useful when you want to revert to a known state before making changes. To restore a virtual machine to a specific snapshot, use the &lt;code&gt;vagrant snapshot restore&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vagrant snapshot restore &amp;lt;VM Name&amp;gt; &amp;lt;Snapshot Name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vagrant snapshot restore default snap1 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Deleting a Snapshot
&lt;/h2&gt;

&lt;p&gt;To delete a snapshot, use the &lt;code&gt;vagrant snapshot delete&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vagrant snapshot delete &amp;lt;VM Name&amp;gt; &amp;lt;Snapshot Name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vagrant snapshot delete default snap1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember that snapshots consume disk space, and managing them is important to avoid excessive disk usage. Also, snapshots might not capture every aspect of the system, such as network configurations, so be aware of potential limitations.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ubuntu</category>
      <category>virtualmachine</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
