UnixPedia : HPUX / LINUX / SOLARIS: 2023

Monday, October 16, 2023

Striping an LVM (Logical Volume Manager) filesystem in Red Hat Linux

 Striping an LVM (Logical Volume Manager) filesystem in Red Hat Linux involves spreading the data across multiple physical volumes (PVs) to improve performance. Here are the general steps to stripe an LVM filesystem:

  1. Prepare the Physical Volumes (PVs):

    • Ensure you have multiple PVs available. These could be physical disks or partitions.
    • If you need to add new disks, use tools like fdisk or parted to create partitions on them.
  2. Create Volume Group (VG):

    • Use the vgcreate command to create a new volume group that encompasses all the PVs you want to use for striping. For example:
      bash
      vgcreate myvg /dev/sdX1 /dev/sdY1
  3. Create Striped Logical Volume (LV):

    • Use the lvcreate command with the -i option to specify the number of stripes you want. For example, to create a striped LV named mylv with a stripe count of 2:

      lvcreate -i 2 -L 10G -n mylv myvg
      This command will create a 10GB striped LV named mylv in the volume group myvg with data striped across the PVs.
  4. Create a File System:

    • Create a file system on the new LV. The specific command depends on the type of file system you want to use. For example, to create an ext4 file system:

      mkfs.ext4 /dev/myvg/mylv
  5. Mount the File System:

    • Create a mount point and mount the file system:
      bash
      mkdir /mnt/myfilesystem mount /dev/myvg/mylv /mnt/myfilesystem
  6. Update /etc/fstab:

    • To ensure the file system is mounted at boot, add an entry to the /etc/fstab file. For example:
      bash
      /dev/myvg/mylv /mnt/myfilesystem ext4 defaults 0 0
  7. Test and Verify:

    • Mount the file system and verify that it works as expected.
  8. Monitor and Maintain:

    • Regularly monitor the performance and health of your striped LVM setup.
    • You can add more PVs or extend the LV if needed.

Remember that striping can improve performance, but it does not provide redundancy or data protection. In a production environment, it's crucial to have proper backup and redundancy mechanisms in place. Always exercise caution when working with storage configurations, especially on production systems.

Friday, September 22, 2023

Linux NetworkManager : Nic configuration

 In NetworkManager, network configurations, including IP address assignments, are typically managed through connection profiles stored in the /etc/NetworkManager/system-connections/ directory for system-wide configurations or in the ~/.config/NetworkManager/system-connections/ directory for user-specific configurations.

Each connection profile is stored in a separate file in these directories. These files are typically named after the connection's name, and they are usually in a format like connection-name.nmconnection.

You can edit the connection profile for a specific network interface to configure its IP address settings. Here's a general outline of how to do this:

  1. List Your Network Connections: You can use the following command to list all network connections managed by NetworkManager:

    bash
    nmcli connection show

  2. Edit the Connection Profile: To edit a specific connection profile (e.g., for Ethernet interface eth0), you can use the nmcli command with the edit option and specify the connection name:

    bash
    nmcli connection edit connection-name

    Replace connection-name with the name of the connection profile you want to edit.

  3. Configure IP Address: Once you're in the editing interface, you can configure the IP address settings. For example, to set a static IP address, you can use commands like:

    bash
    nmcli> set ipv4.addresses 192.168.1.10/24 nmcli> set ipv4.gateway 192.168.1.1

    Adjust these commands according to your specific network configuration.

  4. Save Changes: After configuring the IP address settings, save the changes:

    bash
    nmcli> save persistent

    This saves the changes to the connection profile.

  5. Exit the Editing Interface: Finally, exit the editing interface:

    bash
    nmcli> quit

The changes you make to the connection profile will be stored in the appropriate .nmconnection file in the corresponding directory, and NetworkManager will apply these settings the next time the network connection is activated.

Please replace connection-name and the IP address details with the actual connection name and IP settings you want to configure. Also, make sure to adapt these instructions to your specific network requirements and the connection profile you are working with.