Jump to content

Search the Community

Showing results for tags 'fstab'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • General Discussion
    • Artificial Intelligence
    • DevOpsForum News
  • DevOps & SRE
    • DevOps & SRE General Discussion
    • Databases, Data Engineering & Data Science
    • Development & Programming
    • CI/CD, GitOps, Orchestration & Scheduling
    • Docker, Containers, Microservices, Serverless & Virtualization
    • Infrastructure-as-Code
    • Kubernetes & Container Orchestration
    • Linux
    • Logging, Monitoring & Observability
    • Security, Governance, Risk & Compliance
  • Cloud Providers
    • Amazon Web Services
    • Google Cloud Platform
    • Microsoft Azure

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


LinkedIn Profile URL


About Me


Cloud Platforms


Cloud Experience


Development Experience


Current Role


Skills


Certifications


Favourite Tools


Interests

Found 8 results

  1. Mounting is a process of accessing files or folders through the local file system and making modifications. Windows Share is a Windows built-in feature to share files or directories with others over a local area network (LAN). In this tutorial, I will be exploring Windows Share and how to mount it on a Linux file system using the mount.cifs utility. What is CIFS CIFS also known as Common Internet File System is a dialect of SMB protocol that is developed by Microsoft to access files or folders from users over the same network connection. However, the latest SMB protocols have replaced this widely used network file-sharing protocol for mounting Windows Share on Linux. There is a specific utility called mount.cifs which is used to mount Windows Share on Linux. In the next section, I will discuss the process of installing it on Linux. How to Install CIFS-Utils on Linux To mount Windows Share on Linux mount.cifs utility is needed which is a part of the CIFS-Utils package. To install cifs-utils on Ubuntu, Debian, and distributions based on them, use the default package manager. sudo apt install cifs-utils Use the dnf package manager to install cifs-utils on CentOS and Fedora distributions, sudo dnf install cifs-utils For Red Hat (RHEL) and Red Hat-based distributions use the yum package manager. sudo yum install cifs-utils Note: For the instructions implemented in this guide, I am using Ubuntu 22.04. The process is similar and can be performed without any issue on any Linux distribution. How to Mount Windows Share on Linux We need a mount point, a directory created anywhere on the Linux system, to mount the Windows share. I am creating a /media/WinShare directory on root using mkdir command with sudo privileges. sudo mkdir /media/WinShare We will follow the below-given syntax of the mount command to mount the Windows Share on Linux. sudo mount -t cifs //[IP-ADDRESS]/[SHARE-NAME] /[MOUNT] -o username=[USERNAME] In the above syntax: [IP-ADDRESS]: It is the IP address of the remote machine, which is Windows in this case; to access the IP address, open the command prompt and run the ipconfig command. Note the IPV 4 address. [SHARE-NAME]: It is the Windows Share name or the folder name that is shared for the network. [MOUNT]: It is the mount point directory set up on the client’s machine, which is Linux. -o: This is a flag used to define cifs-utils options, to read more about the cifs utils options run man mount.cifs command. The table below lists some options that users often use. username To provide the username of the remote machine password To provide password explicitly [Not recommended] credentials To set the file containing credentials [Recommended] vers To set the protocol version explicitly 1.0, 2.0, or 3.0 Now, I have created a Windows Share with the name MyFolder, to mount it on Linux using /media/WinShare as a mount point I will use the following command. sudo mount -t cifs //192.168.18.14/MyFolder /media/WinShare -o username=shahr After executing the command you will be asked to enter the password of the remote machine. On successfully mounting the Windows Share, you will not get any alert. To verify the successful mount use the df -h command; which is essentially used to get disk space of the file system. df -h In many instances, it may be necessary to state the user domain. Find the system domain of the Windows system using the wmic (Windows Management Instrumentation Command Line) command in the command prompt. wmic computersystem get domain After knowing the domain which is WORKGROUP in my case, simply insert it in the above command using the domain option. sudo mount -t cifs //192.168.18.14/MyFolder /media/WinShare/ -o username=shahr,domain=WORKGROUP However, this is not a secure way to mount the shared folder. To make it more secure, the mount.cifs utility has an option called credentials. The credentials option allows you to set a path of a plain text file containing the credentials of the remote machine instead of explicitly mentioning the username or password. Let’s create a text file that contains the credentials of the machine to be accessed; in this case, it is the Windows machine. sudo nano ~/.credentials-cifs Type the following information in the file. username=[USERNAME] password=[PASSWORD] domain=[DOMAIN] After adding this information to the file, save the file by pressing ctrl+x and then y. To mount the Windows Share with credentials option use the following command. sudo mount -t cifs //192.168.18.14/MyFolder /media/WinShare/ -o credentials=~/.credentials-cifs Note: I will advise giving the absolute path to the credentials file instead of using ~/. How to Make the Windows Share Mount Permanent Before attempting the following section, note key important points. If the permanent mount is not properly set up, then Linux will not boot. Ensure everything is correct before reboot. I will suggest using the mount -a command to check for errors. The IP of the remote machine must be static, otherwise, the mounting will fail, and eventually the system boot. To make the Windows Share mount permanent, we need to modify the fstab (File System Table) file. The fstab file manages the file system and also allows you to mount the external file system manually. Let’s open the fstab file located in the /etc directory using the nano editor. sudo nano /etc/fstab To make Windows Share permanent on Linux, follow the syntax given below. //[IP-ADDRESS]/[SHARE-NAME] /[MOUNT] cifs credentials=[CREDENTIALS-FILE-PATH] [DUMP] [PASS] Note: Use tab instead of space to separate the fields in the fstab file. Let’s replace the [IP-ADDRESS], [SHARE-NAME], [MOUNT], and [CREDENTIALS-FILE-PATH] with actual information. The [DUMP] and the [PASS] options are used to enable backup of the mounted file system and fsck check on boot, respectively. Set 0 and 0 for both options to keep them disabled. //192.168.18.14/MyFolder /media/WinShare cifs credentials=/home/user/.credentials-cifs 0 0 Note: Provide the absolute path of the credentials file. After modifying the fstab file, save and exit the editor using ctrl+x and then y. The subsequent step involves mounting the Windows Share by means of the mount command. sudo mount /media/WinShare If there are no errors, then the mount is successful and will remain permanent even on boot. How to Unmount the Windows Share To unmount the Windows Share, use the umount command with the mount point. sudo umount /[MOUNT] In our example, the [MOUNT] is /media/WinShare directory. sudo umount /media/WinShare If the above command fails to unmount the Windows Share, then try force unmounting using the -f flag. sudo umount -f /media/WinShare Or use the -l flag, which detaches the file system if the above command also fails. sudo umount -l /media/WinShare To read more about these options, run the man mount command. How to Create Windows Share Windows Share is a directory that is set to share on a local area network. Before accessing Windows Share on Linux, it has to be set up on Windows. First, ensure that Windows is enabled for CIFS communication. For that, open the Turn Windows feature on and off on Windows. Find SMB 1.0/CIFS File Sharing Support in the list and check it. After a few moments, you will be asked to restart the system. To enable network discovery on Windows, navigate to the Advanced sharing settings; once there, you should find the option for Network discovery and ensure that this option is enabled by selecting the Turn on network discovery option. Next, we need to create a Windows Share folder that will be mounted on Linux using mount.cifs utility. Create a folder anywhere on Windows and right-click on it, and then from the context menu click on Properties. Navigate to the Sharing tab on the opened window and click on the Share button to proceed with the folder-sharing settings. Now, click on the drop-down icon, select Everyone from the list, and then click on the Add button. Select the Permission Level, set it to Read/Write to this folder, and then click on Share. Now, the Windows Share is ready to share. Conclusion If you have recently moved to Linux, then you will definitely need to access data on your Windows system. Any sort of data can be shared on Linux from Windows using the Windows Share option. To access Windows Share on Linux, the IP address and password of the Windows machine are required. Mounting the Windows Share on Linux using mount.cifs utility requires two steps. First, set the mount point on Linux and then use the mount command with the -t cifs option to mount the Windows Share on Linux. View the full article
  2. OCFS2 stands for Oracle Cluster File System version 2, which is an open-source, POSIX-compliant disk-based file system developed by Oracle Corporation. It was designed to be used with Linux-based systems. The key feature of OCFS2 is its ability to be accessed concurrently from multiple nodes in a cluster, making it particularly useful for shared-disk, high-availability applications, and for use with Oracle RAC (Real Application Clusters). OCFS2 supports features such as: Journaling: This helps ensure the integrity of the file system data, allowing quick recovery after a crash or power failure.Direct IO: For efficient access to disk, bypassing caching layers for certain types of applications.Sparse Files: These are files that can allocate storage space non-contiguously to save space, useful for databases.Extended Attributes: Allows files and directories to have additional metadata beyond standard filesystem attributes.POSIX Access Control Lists (ACLs): This provides a flexible permission mechanism.Cluster-wide Locking: Ensures data consistency when multiple nodes access the file system simultaneously.OCFS2 is designed to work in high-availability environments, where system continuity and data integrity are crucial. It’s often used in scenarios where a cluster of computers needs to access a common set of data on shared storage, such as SAN (Storage Area Network) environments. Oracle has integrated OCFS2 into its product ecosystem, ensuring that it works seamlessly with their other products, especially for database solutions that require high availability and scalability. OCFS2 Troubleshooting Guide Troubleshooting issues with OCFS2 can involve various steps depending on the specific problem you’re encountering. Here’s a structured approach to help you identify and address common issues: 1. Gather information: Distribution and version: Knowing your operating system (e.g., RHEL, SUSE) and version helps identify appropriate troubleshooting steps and potential distribution-specific quirks. Cluster setup: Is this a single-node or clustered setup? Clustered setups involve additional configuration checks. Error messages: Any relevant error messages from system logs (/var/log/messages and /var/log/dmesg) can provide valuable clues about the issue. Specific problem: Describe the exact behavior you’re observing (e.g., not mounting after reboot, I/O errors). 2. Initial checks: Network connectivity (if applicable): If the OCFS2 volume resides on shared storage, verify network connectivity between nodes and ensure firewalls aren’t blocking necessary ports. o2cb service (if applicable): In some setups, the o2cb service manages the OCFS2 cluster. Check if it’s running and enabled using commands like systemctl status o2cb and systemctl enable o2cb. 3. fstab entry: Ensure the fstab entry for the OCFS2 filesystem is correct. It should include: Device name (e.g., /dev/sdb) Mount point (e.g., /var/www) Filesystem type (ocfs2) Appropriate options: _netdev: Used for network-based mounts, ensures the network is up before attempting to mount. 4. Common troubleshooting steps: Manually mount the filesystem: Try mounting the filesystem manually using the mount.ocfs2 command. This can help identify permission or configuration issues preventing automatic mounting. Check permissions: Verify that the user or group mounting the filesystem has the necessary permissions to access the mount point directory. Verify disk space: Ensure sufficient free space is available on the OCFS2 volume. Review logs: System logs (/var/log/messages and /var/log/dmesg) might provide additional clues about the issue. Look for errors related to OCFS2 or the specific device. 5. Advanced troubleshooting (if necessary): Use fsck.ocfs2: This utility can check and potentially repair file system errors, but use it with caution and back up your data beforehand (refer to the documentation for specific options and usage). Cluster configuration (if applicable): In clustered setups, review configuration files (e.g., /etc/ocfs2/cluster.conf) and ensure consistency across all nodes. Consult distribution documentation or community forums: Refer to your specific OS and OCFS2 version documentation for detailed troubleshooting steps and known issues. Additionally, community forums can provide insights from other users who might have encountered similar problems. List of all commands to work with OCFS2 Here’s a list of some common commands used to work with OCFS2: Basic management: mkfs.ocfs2: Formats a partition or device for use with OCFS2. mount.ocfs2: Mounts an OCFS2 filesystem. umount.ocfs2: Unmounts an OCFS2 filesystem. fsck.ocfs2: Checks and potentially repairs an OCFS2 filesystem. Advanced management: tunefs.ocfs2: Changes various options and parameters of an OCFS2 filesystem. ocfs2_info: Displays information about an OCFS2 filesystem. ocfs2_clrchk: Checks and clears cluster configuration information. o2cb (cluster only): Manages the OCFS2 cluster communication layer. Informational: ocfs2_lsclusters (cluster only): Lists available OCFS2 clusters. ocfs2_showconfig (cluster only): Displays the current OCFS2 cluster configuration. ocfs2_controldump (cluster only): Dumps information from the OCFS2 cluster control daemon. Debugging: debugfs.ocfs2: A debugging tool for examining internal OCFS2 data structures. 1. o2cb Service Management: Manages the O2CB cluster service, which is crucial for OCFS2 operation. Start the service: service o2cb start Stop the service: service o2cb stop Check the status: service o2cb status Enable on boot: chkconfig o2cb on (SysVinit) or systemctl enable o2cb.service (systemd) 2. tunefs.ocfs2 Tune File System Parameters: Used to adjust various file system parameters on OCFS2 volumes. Example: tunefs.ocfs2 -L "NewLabel" /dev/sdb1 changes the volume label. 3. mkfs.ocfs2 Create File System: Used to format a disk partition as an OCFS2 file system. Example: mkfs.ocfs2 -L "VolumeLabel" /dev/sdb1 4. fsck.ocfs2 File System Check: Checks and optionally repairs an OCFS2 file system. Example: fsck.ocfs2 -fy /dev/sdb1 5. mounted.ocfs2 List Mounted Volumes: Lists all OCFS2 volumes currently mounted on the system. Example: mounted.ocfs2 6. o2info Cluster Information: Displays information about the cluster configuration and status. Example: o2info --status 7. mount and umount Mounting/Unmounting File Systems: Standard Linux commands used to mount and unmount OCFS2 file systems, with options specific to cluster file systems. Mount: mount -t ocfs2 /dev/sdb1 /mnt/point Unmount: umount /mnt/point 8. debugfs.ocfs2 Debugging Tool: Provides a means to examine and debug an OCFS2 file system. Example: debugfs.ocfs2 /dev/sdb1 Additional Tools and Files: /etc/ocfs2/cluster.conf: The main configuration file for OCFS2 clusters. This file defines nodes, cluster name, and other important settings. /etc/init.d/o2cb: The init script for managing the O2CB cluster stack on systems using SysVinit. systemctl [start|stop|status] o2cb: Commands to manage the O2CB service on systems using systemd. Notes: OCFS2 Console (ocfs2console): In some distributions, an OCFS2 management GUI called ocfs2console is available. This tool provides a graphical interface to configure and manage OCFS2 clusters, but it may not be included in all Linux distributions. Cluster Management: Managing an OCFS2 cluster often involves more than just handling the file system. It might require managing network configurations, coordinating with cluster management tools (like Pacemaker or Corosync), and ensuring that all nodes maintain consistent configurations and time synchronization. The post What is OCFS2 Oracle Cluster File System? appeared first on DevOpsSchool.com. View the full article
  3. The latest version of NextCloud comes with NextCloud Hub 7. It comes with a lot of new features. The latest version of NextCloud does not work without a valid SSL certificate and a domain name. Older versions of NextCloud did not have such requirements. So, setting up the latest version of NextCloud is a bit challenging for new users. To set up NextCloud a little bit easier, NextCloud offers the NextCloud AIO (All-in-One) docker image. You can use it to easily install, update, backup/restore NextCloud without losing your data. In this article, we will show you how to easily install the latest version of NextCloud AIO (All-in-One) on Ubuntu, Debian, Fedora, RHEL, AlmaLinux, Rocky Linux, CentOS Stream, and other popular Linux distributions. Since the latest version of NextCloud requires a valid SSL certificate to work, we will use a Let’s Encrypt SSL certificate that we generated on our computer/server and link it to the NextCloud Docker containers so that NextCloud can access and use them. Topic of Contents: Installing CURL Installing Docker CE and Docker Compose Setting a Static IP Address on Your Computer/Server Setting a DNS Record for Your NextCloud AIO Server Generating a Let’s Encrypt SSL Certificate for NextCloud AIO Preparing a Project Directory for NextCloud AIO Configuring the Storage for NextCloud AIO Installing the NextCloud AIO Master Container Configuring the NextCloud Installation Using the NextCloud AIO Web Interface Installing NextCloud from the NextCloud AIO Web Interface Accessing NextCloud Conclusion References Installing CURL To install the Docker CE on your computer/server easily, you need CURL. You can install CURL on your favorite Linux distribution very easily as it is available in the official package repository of every Linux distribution. On Ubuntu, Debian, Linux Mint, Kali Linux, and other Ubuntu/Debian-based Linux distributions, you can install CURL with the following commands: $ sudo apt update $ sudo apt install curl -y On Fedora, RHEL, AlmaLinux, Rocky Linux, CentOS Stream, and other RHEL-based Linux distributions, you can install CURL with the following commands: $ sudo dnf makecache $ sudo dnf install curl -y Once CURL is installed, you can check if CURL is accessible with the following command. If CURL is accessible, the command will print the version of CURL that you installed on your computer/server. $ curl --version Installing Docker CE and Docker Compose To install the latest version of Docker CE and Docker Compose on Ubuntu, Debian, Fedora, RHEL, AlmaLinux, Rocky Linux, CentOS Stream, and other popular Linux distributions, run the following command: $ curl -fsSL https://get.docker.com | sudo sh The latest version of Docker CE and Docker Compose are being installed. It takes a while to complete. At this point, the latest version of Docker CE and Docker Compose should be installed on your computer/server. Add your login user to the docker group so that you can run the Docker commands without root/superuser privileges if needed. $ sudo usermod -aG docker $(whoami) For the changes to take effect, reboot your computer/server as follows: $ sudo reboot Once your computer/server boots, you can check if the Docker commands are accessible with the following commands. If the Docker commands are accessible, the version of Docker and Docker Compose that you installed on your computer/server should be printed. $ docker version $ docker compose version Setting a Static IP Address on Your Computer/Server For NextCloud to work correctly, you must set up a static IP address on your computer/server. LinuxHint has many articles on that topic. Please search on linuxhint.com for a detailed information on setting up a static IP address for your Linux distribution. Setting a DNS Record for Your NextCloud AIO Server For NextCloud to work properly, you must also have a domain name that points to the IP address of your computer/server. To do that, you must add an A record (for IPv4) on the DNS server of your domain that points to the IP address of your computer/server where you want to install NextCloud. Generating a Let’s Encrypt SSL Certificate for NextCloud AIO Once you set a static/fixed IP address and add a DNS record for NextCloud on your DNS server, you will generate a valid SSL certificate using Let’s Encrypt or buy a valid SSL certificate from an authorized certificate authority (CA). If you want to get a free Let’s Encrypt SSL certificate for your domain name using CloudFlare DNS-01 validation, we have an article on that. Feel free to read it for more information. Preparing a Project Directory for NextCloud AIO Since NextCloud AIO runs NextCloud in Docker containers, you need to create a few files to configure your NextCloud installation. Better to keep them all organized in a single folder. You can create a project directory for NextCloud AIO which is “/opt/nextcloud-aio” (let’s say) as follows: $ sudo mkdir /opt/nextcloud-aio Now, navigate to the “/opt/nextcloud-aio” directory as follows: $ cd /opt/nextcloud-aio Create a Docker Compose file which is “compose.yaml” in the “/opt/nextcloud-aio” directory and open it with the nano text editor as follows: $ sudo nano compose.yaml Copy and paste the following lines in the “compose.yaml” file: version: "3" volumes: nextcloud_aio_mastercontainer: name: nextcloud_aio_mastercontainer services: nextcloud: image: nextcloud/all-in-one:latest restart: always container_name: nextcloud-aio-mastercontainer volumes: - nextcloud_aio_mastercontainer:/mnt/docker-aio-config - /var/run/docker.sock:/var/run/docker.sock:ro ports: - 8080:8080 environment: - SKIP_DOMAIN_VALIDATION=true - APACHE_PORT=11000 - APACHE_IP_BINDING=127.0.0.1 - NEXTCLOUD_DATADIR=/mnt/nextcloud-data # - NEXTCLOUD_ENABLE_DRI_DEVICE=true caddy: image: caddy:alpine restart: always ports: - 443:443 volumes: - ./Caddyfile:/etc/caddy/Caddyfile - /etc/letsencrypt/live/nodekite.com/fullchain.pem:/certs/fullchain.pem - /etc/letsencrypt/live/nodekite.com/privkey.pem:/certs/privkey.pem network_mode: "host" Create a Caddyfile file in the “/opt/nextcloud-aio” directory and open it with the nano text editor as follows: $ sudo nano Caddyfile Copy and paste the following lines in the Caddyfile file: https://nextcloud.nodekite.com:443 { tls /etc/caddy/fullchain.pem /etc/caddy/privkey.pem reverse_proxy localhost:11000 } Here, in the “compose.yaml” file, “/etc/letsencrypt/live/nodekite.com/fullchain.pem” and “/etc/letsencrypt/live/nodekite.com/privkey.pem” are the full path of our Let’s Encrypt SSL certificates. These are linked to the nextcloud-aio-mastercontainer and caddy (reverse-proxy) containers. The “fullchain.pem” and “privkey.pem” certificate files are bind mounted in the “/etc/apache2/certs/ssl.crt” and “/etc/apache2/certs/ssl.key” paths, respectively, in the “nextcloud_aio_mastercontainer” Docker container[1]. If you don’t pass the SSL certificates in the “nextcloud_aio_mastercontainer” Docker container, sooner or later, you will get the MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT error (on Mozilla Firefox) and/or other SSL errors (on other web browsers) while attempting to access the NextCloud AIO management interface. The “fullchain.pem” and “privkey.pem” certificate files are bind mounted in the “/certs/fullchain.pem” and “/certs/privkey.pem” paths, respectively, in the caddy Docker container[2]. The caddy container will be used as the reverse proxy server for NextCloud. Another important configuration option for NextCloud is the NEXTCLOUD_DATADIR and NEXTCLOUD_ENABLE_DRI_DEVICE environment variables. NEXTCLOUD_DATADIR is the directory on your computer/server (where Docker/NextCloud is installed) where NextCloud stores all the user files. Here, we will mount a dedicated storage device to the “/mnt/nextcloud-data” path and use it for storing the NextCloud user files[1]. If NEXTCLOUD_ENABLE_DRI_DEVICE option is enabled, NextCloud will use your GPU to transcode the media files (i.e. videos). So, if you want to use your GPU to transcode the media files, remove the “#” from the line to enable the NEXTCLOUD_ENABLE_DRI_DEVICE environment variable[2]. Configuring the Storage for NextCloud AIO In this section, we will show you the basics of mounting a storage device on your Linux system so that you can use it for storing the NextCloud user files. We have a EXT4 formatted storage device “/dev/sdb1” with the UUID dda44238-4527-42b8-969e-bd81cb03c6c8 (note this as you need it to mount the filesystem). We mount it on the “/mnt/nextcloud-data” directory (where we configured NextCloud to store the user files) for the demonstration. $ sudo blkid /dev/sdb1 First, open the “/etc/fstab” file with the nano text editor as follows: $ sudo nano /etc/fstab Type in the following line at the end of the “/etc/fstab” file to mount the “/dev/sdb1” storage device using it’s UUID on the “/mnt/nextcloud-data” directory. Once you’re done, press <Ctrl> + X followed by “Y” and <Enter> to save the “/etc/fstab” file. UUID=<storage-device-UUID> /mnt/nextcloud-data ext4 defaults 0 0 Create the “/mnt/nextcloud-data” mount path as follows: $ sudo mkdir /mnt/nextcloud-data [/c]c Mount the configured storage device to the “/mnt/nextcloud-data” directory as follows: [cc lang="bash" width="100%" height="100%" escaped="true" theme="blackboard" nowrap="0"] $ sudo mount /mnt/nextcloud-data/ As you can see, the “/dev/sdb1”[1] storage device is mounted in the “/mnt/nextcloud-data”[2] path. Installing the NextCloud AIO Master Container In the “/opt/nextcloud-aio” NextCloud project directory, you should have a “compose.yaml” file and a Caddyfile. $ ls To start the NextCloud AIO container, run the following command: $ sudo docker compose up The NextCloud AIO container should be started. Now, visit https://your-nextcloud-domain.com:8080 from your favorite web browser to access NextCloud AIO. You will see the log in password for NextCloud AIO the first time you access NextCloud AIO from a web browser[1]. You need to note it down. It’s very important. If you lose this password, you have to reset the NextCloud AIO master container and start over. Once you noted down the NextCloud AIO log in password, click on “Open NextCloud AIO login”[2]. Once the NextCloud AIO login page is displayed, type in the NextCloud AIO password[1] and click on “Log in”[2]. You should be logged in to the NextCloud AIO management interface. Configuring the NextCloud Installation Using the NextCloud AIO Web Interface First, type in the domain name that you want to use for NextCloud and click on “Submit domain”. NOTE: You must use the same domain name that you generated the SSL certificates for. Once you configure a domain name for NextCloud, NextCloud AIO will ask you to configure your NextCloud installation. Scroll down to the “Timezone change” section, type in your timezone in TZ identifier format and click on “Submit timezone”[1]. If you don’t know the TZ identifier format of your timezone, click on the link as marked in the following screenshot[2] and you will find a list of TZ identifiers for all the timezones worldwide: Click on “OK” to confirm the timezone. Your desired timezone should be set. Scroll to the “Optional containers” section. By default, only the containers that are required for a fully functional NextCloud server are selected. You can select the other containers from the list to add more functionality to NextCloud. ClamAV: If you want to scan the NextCloud user files for viruses, you can enable this container. Fulltextsearch: If you want to use the full text search functionality of NextCloud to find the files, select this container. Nextcloud Talk Recording-server: If you want to record your NextCloud Talk calls, select this container. Docker Socket Proxy: If you want to use the NextCloud API, select this container. Installing NextCloud from the NextCloud AIO Web Interface To install the latest version of NextCloud (NextCloud Hub 7), tick “Install Nextcloud 28”[1] and click on “Download and start containers”[2]. NextCloud AIO should start downloading all the required Docker containers and start them. It takes a while to complete. You can refresh the NextCloud AIO page to see the progress of the NextCloud installation. The containers that are downloaded and started correctly should be marked in green. The containers that are being downloaded or configured are marked in yellow. Once NextCloud is installed, NextCloud AIO will show you the admin password of your NextCloud installation. Accessing NextCloud To access NextCloud, visit https://your-nextcloud-domain.com from a web browser and you should see the NextCloud log in page. Type in “admin” as the username[1] and the admin password (that you’ve seen in the NextCloud AIO page)[2] and click on “Log in”[3]. You should be logged in to NextCloud as the admin user. As an admin user, you can create new NextCloud users, configure the quotas for the NextCloud users, and do other administrative tasks. The following is the NextCloud Hub 7 file management interface: Viewing a Word document in NextCloud Hub 7: Conclusion In this article, we showed you how to install the latest version of NextCloud AIO (All-in-One) on Ubuntu, Debian, Fedora, RHEL, AlmaLinux, Rocky Linux, CentOS Stream, and other popular Linux distributions based on Ubuntu/Debian or RHEL. Since the latest version of NextCloud requires a valid domain name and a valid SSL certificate, it makes the installation a bit difficult for most people. We simplified the process of installing the latest version of NextCloud on your favorite Linux distribution using a valid Let’s Encrypt SSL certificate and a domain name. References: nextcloud/all-in-one: The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance. all-in-one/compose.yaml at main · nextcloud/all-in-one all-in-one/reverse-proxy.md at main · nextcloud/all-in-one abelncm/nextcloud-aio-local-docker-compose: Run Nextcloud AIO in your localhost View the full article
  4. File management in Linux has always been the most essential part of a user’s workflow. Fortunately, it has a great file system and offers various features for efficient file management. It has commands for creating or deleting the directories, listing them, displaying their content, limiting the access, and many more. It lets you view the mounted drives and is handy for system monitoring, storage management, troubleshooting disk issues, remote system management, etc. However, learning how to show the mounts is essential for every Linux user. So, in this quick blog, we will explain the different commands to show the mounts in Linux. How to Show the Mounts in Linux To display the mounted drives, you merely need to enter a few commands. Here, we included multiple commands to show the mounts easily. 1. The Mount Command The “mount” command displays a comprehensive list of the mounts including their mount point, file system type, and mount options. mount 2. The Df Command If you want to have a detailed insight into the mounted file systems and disk space that are used by them, use the “df” command. df -h The “-h” option instructs the system to display it in a human-readable format. 3. Read /etc/fstab File You can view the disk drives and their partitioning information by reading the “/etc/fstab” file. Cat /etc/fstab This command, upon execution, presents everything on the command line itself. 4. The Findmnt Command The “findmnt” command is an advanced version of the mount command as it provides a more detailed output. Further, it also shows the mounts in a tree-like structure with their file type and mount options. Conclusion Linux has a sturdy file management system, and listing the mounts is fundamental for most users. You can accomplish it using different commands according to the use cases. Thus, this blog includes four methods of showing the mounts in Linux: the mount, df, and findmnt commands, and the “/etc/fstab” file. View the full article
  5. In Linux, the file systems set the files in the form of a tree. This file system initiates from the root directory and all the child branches come out of this root directory. When we want to add a new child (file system) to this tree, the Linux mount command comes into practice. It allows us to attach a file to a specified mount point in the current file system. The command tells the kernel about the directory and the type of file system to mount and also the device name where the file system is present. This article demonstrates the use of the Linux mount command using several examples. Syntax: The syntax for using the mount command is as follows: mount -t [type] [dev] [directory] Here, mount is the keyword for the mount command. The “-t[type]” refers to the type of file system; it is an optional parameter. We need to provide the “dev” device on which the provided file system is mounted. Lastly, the destination directory name has to be mentioned at which the file system is mounted. Mount Options Different options can be indicated to mount a file system. Here is a list of some of these possibilities: -a It is employed to attach all of the file systems that are listed in etc/fstab. -l It is utilized to list all the file systems that are mounted and adds the labels. -h All the options for commands could be generated from it. -V It displays the version information. -t It tells the type of the file system. -T It is used to describe the substitutes etc/fstab file. -r It enables the read-only mounting of the file system. Utilizing the Linux Mount Command to Mount All the Files We can display the list of all the file systems that are currently mounted by simply writing the mount command on the terminal. Launch the terminal first. Additionally, type the subsequent command: omar@omar-VirtualBox:~$ mount Hit “enter” and you get the currently mounted file systems list: sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) udev on /dev type devtmpfs (rw,nosuid,relatime,size=1946576k,nr_inodes=486644,mode=755,inode64) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=401848k,mode=755,inode64) /dev/sda3 on / type ext4 (rw,relatime,errors=remount-ro) securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64) tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64) cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot) pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime) bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700) systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=18327) tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime) debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime) hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M) mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime) configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime) fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime) none on /run/credentials/systemd-sysusers.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700) /dev/sda2 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro) tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=401844k,nr_inodes=100461,mode=700,uid=1000,gid=1000,inode64) gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000) Also, using the “-l” mount option, you can obtain the list of the mounted file. omar@omar-VirtualBox:~$ sudo mount -l After entering the sudo password, it displays the file systems here: sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) udev on /dev type devtmpfs (rw,nosuid,relatime,size=1946576k,nr_inodes=486644,mode=755,inode64) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=401848k,mode=755,inode64) /dev/sda3 on / type ext4 (rw,relatime,errors=remount-ro) securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64) tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64) cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot) pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime) bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700) systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=18327) tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime) debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime) hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M) mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime) configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime) fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime) none on /run/credentials/systemd-sysusers.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700) /dev/sda2 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro) tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=401844k,nr_inodes=100461,mode=700,uid=1000,gid=1000,inode64) gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000) Checking the Mount Version The version of the mount can be obtained using the following command: omar@omar-VirtualBox:~$ sudo mount –V This shows us the version information of the mount. mount from util-linux 2.37.2 (libmount 2.37.2: selinux, smack, btrfs, verity, namespaces, assert, debug) Listing the Particular File System with the Mount Command Using the mount command, we can find out the mounts that are used by a particular file system. For instance, if we want to find the mounts that the “ext4” file system is using, we need to write the command in the proceeding syntax: omar@omar-VirtualBox:~$ -t <filesystem-type> To get the list of all the ext4 file systems, run this command: omar@omar-VirtualBox:~$ sudo mount -t ext4 /dev/sda3 on / type ext4 (rw,relatime,errors=remount-ro) Utilizing the /Etc/Fstab The /etc/fstab is used to find the mount location of the devices and has all the information about the system devices. It also tells us about the mount options that these system devices employ. To check if a particular file system is present in the /etc/fstab configuration file after reading its content, you need to provide one of the two parameters which are [device] or [directory] with the mount command. To find the structure of /etc/fstab, run this command: omar@omar-VirtualBox:~$ cat /etc/fstab Here, you will see the structure that it follows: # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda3 during installation UUID=3333d4f7-af61-4a62-9b78-46de26682e91 / ext4 errors=remount-ro 0 1 # /boot/efi was on /dev/sda2 during installation UUID=6DAB-1E13 /boot/efi vfat umask=0077 0 1 /swapfile none swap sw 0 0 From this, we understand that the file system that is currently mounted is —————-. The mounting point for it is the root “/”. Next, the type of the file system is mentioned as “ext4”. The mount option that is used here is “defaults,noatime”. Lastly, the value for “dump” is “0” and the value for “pass” is mentioned as “1”. If we want to mount a file system that is present in the /etc/fstab configuration file, you can either use the “mount [option] [directory]” command which tells you about the mounting point or “mount [option] [device]” which provides the mounting device. Mounting a USB We can mount a USB drive manually if the automated mounting fails to mount. To manually mount a USB, we first create a directory. Write the following mkdir command and make sure to write it with sudo privileges as we create a new directory which requires the admin rights. omar@omar-VirtualBox:~$ sudo mkdir /media/usb-drive [sudo] password for omar: Now, the mounting point for the USB drive is created. To locate the USB drive and the file system, we have to write the command on the terminal: omar@omar-VirtualBox:~$ sudo fdisk –l Here, we get the list of all the USB drives and files: Disk /dev/sda: 17.95 GiB, 19273465856 bytes, 37643488 sectors Disk model: VBOX HARDDISK Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: B1802B5F-BC14-4293-888D-BACCD438E53C Device Start End Sectors Size Type /dev/sda1 2048 4095 2048 1M BIOS boot /dev/sda2 4096 1054719 1050624 513M EFI System /dev/sda3 1054720 37642239 36587520 17.4G Linux filesystem Mount any specific USB drive through the device identifier from the output of the fdisk output. From the previous output, we have three drives. We choose the /dev/sda3. We write the command as follows: omar@omar-VirtualBox:~$ sudo mount /dev/sda /media/usb-drive If the drive is not already mounted, it will be mounted. mount: /media/usb-drive: /dev/sda already mounted or mount point busy. As shown in our output, it says that the USB drive is already mounted. Mounting the ISO Files and CD-ROM with the Mount Command The ISO (identical storage image of optical media) files as well as the CD-ROMs can also be mounted using the mount command in Linux. As for the CD-ROMs, they are removable devices. So, Linux attaches them automatically when removed after insertion. But if it does not mount the CD-ROMs, you can mount it yourself. First, we run a command to attach a CD-ROM. Then, we go for ISO files. To manually mount the CD-ROM, carry out the following command: omar@omar-VirtualBox:~$ sudo mount -t iso9660 -o ro /dev/cdrom /mnt Here, the iso9660 is the standardized file system for CD-ROMs. Whereas to mount an ISO file, the –o loop mount option is used because an ISO file must have its data mapped to a loop device before it can be mounted. Detaching a Mounted File System Using the umount command, we can unmount an attached file system. Detachment can be done by either providing the device identifier or the point of mount for that specific file system. For instance, to unmount a USB drive, the command is as follows: omar@omar-VirtualBox:~$ sudo umount /media/usb-drive Conclusion The Linux mount command is explained in detail in this guide. We demonstrated the syntax and the mount options for this command in the initial section of this article. With the utilization of these options, you can obtain the required output. Either all of the file systems that are currently mounted or a single specified system can be found with the mount command options. The use of the mount command with different examples to mount a file system, USB drive, or ISO file is explained with practical implementation in Linux Mint 21. View the full article
  6. The OS(operating system) employs the file system which is known as the file system in a computer language that is commonly abbreviated to “fs”. The “fs” is a technique that regulates how well the piece of information is protected and accessed. Without a file system, the content of the file in a memory device would not distinguish between one type of information. The information can be easily extracted and recognized by making the groups and assigning each group a name. Each group of information is referred to as a “file,” which is a terminology derived from a paper-based data management system. A “file system” is the term referring to both the organizational framework and logical principles that are used to handle the names and groupings of information. Different Techniques of Checking the Filesystem Mounted Type in Linux There are many different file system varieties in Linux that will provide several terminal commands and techniques to check the filesystem mounted type in Linux. Let us just start delving and fully understanding how well the filesystem functions in terms of understanding the various filesystem varieties in Linux and how we are going to execute each method one at a time. Prerequisite: Installing util-linux To use the root privileges of accessing the different types of file systems in Linux, we will first write the “sudo” keyword in the Linux terminal. Then, we will write the “apt” which will upgrade the deb packages. To access the mounted files system in the Linux, we use different steps to install the “util-linux” as seen below: linux@linux-VirtualBox:~ sudo apt install util-linux After writing the “sudo” command, we first have to enter the password of the Linux then it will show further details. [sudo] password for linux: Reading package lists... Done Building dependency tree Reading state information... Done util-linux is already the newest version (2.34-0.1ubuntu9.3). 0 upgraded, 0 newly installed, 0 to remove and 31 not upgraded. After installing the “util-linux”, now we can easily apply the different techniques to check the filesystem mounted type. Technique 01: The “fsck” Command The Linux command fsck stands for File System Consistency Check which analyzes filesystems for faults or unresolved problems. Step: 01 The instruction employed to produce statistics and correct potential problems is written below: linux@linux-VirtualBox:~$ sudo fsck -N fsck from util-linux 2.34 [/usr/sbin/fsck.ext4 (1) -- /] fsck.ext4 /dev/sda5 [/usr/sbin/fsck.vfat (1) -- /boot/efi] fsck.vfat /dev/sda1 To get the certain filesystem, we will write the path of the filesystem which we want to get: linux@linux-VirtualBox:~$ sudo fsck –N /dev/sda5 fsck from util-linux 2.34 [/usr/sbin/fsck.ext4 (1) -- /] fsck.ext4 /dev/sda5 Step: 02 To get additional information on the “fsck” statement, use the “man fsck” statement. Following is the full command: linux@linux-VirtualBox:~$ man fsck Technique 02: The “mount” Command The “mount” statement will provide all the mounted devices along with the filesystem format and mounted location in Linux. Step 01: To get the mounted filesystem’s type, we will write first the “mount” keyword along with “grep” so that we can only get those mounted files that we want to display. This is why we have provided the “^/dev” path. linux@linux-VirtualBox:~$ mount | grep “^/dev” /dev/sda5 on / type ext4 (rw,relatime,errors remount-ro) /dev/sda1 on /boot/efi type vfat (rw, relatime, fmask=0077, dmask=0077,codepage=43 7,iocharset=iso8859-1, shortname-mixed, errors=remount-ro) Step: 02 To understand more clearly about the “mount” command, write the below INSTRUCTION: linux@linux-VirtualBox:~$ man mount Technique 03: The “findmnt” Command Now, we are going to implement another technique to check the filesystem type which is “findmnt” statements in Linux. In the findmnt statement, it will show all the mounted filesystems in the device. Step: 01 The “findmnt” statement returns the target, source, and fstype which means file system type and the options which contain whether the file is read/write or read-only. At the top of the tree of the filesystem, it will be the root directory and here it is “ext4”. linux@linux-VirtualBox:~$ findmnt TARGET SOURCE FSTYPE OPTIONS / /dev/sda5 ext4 rw,relatime,errors=rem ├─/sys sysfs sysfs rw,nosuid,nodev,noexec │ ├─/sys/kernel/security securityfs securi rw,nosuid,nodev,noexec │ ├─/sys/fs/cgroup tmpfs tmpfs ro,nosuid,nodev,noexec │ │ ├─/sys/fs/cgroup/unified cgroup2 cgroup rw,nosuid,nodev,noexec │ │ ├─/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec │ │ ├─/sys/fs/cgroup/rdma cgroup cgroup rw,nosuid,nodev,noexec │ │ ├─/sys/fs/cgroup/cpu,cpuacct cgroup cgroup rw,nosuid,nodev,noexec │ │ ├─/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec │ │ ├─/sys/fs/cgroup/net_cls,net_prio cgroup cgroup rw,nosuid,nodev,noexec │ │ ├─/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec │ │ ├─/sys/fs/cgroup/misc cgroup cgroup rw,nosuid,nodev,noexec │ │ ├─/sys/fs/cgroup/perf_event cgroup cgroup rw,nosuid,nodev,noexec │ │ ├─/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec │ │ ├─/sys/fs/cgroup/pids cgroup cgroup rw,nosuid,nodev,noexec │ │ ├─/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec │ │ ├─/sys/fs/cgroup/hugetlb cgroup cgroup rw,nosuid,nodev,noexec │ │ └─/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec │ ├─/sys/fs/pstore pstore pstore rw,nosuid,nodev,noexec │ ├─/sys/fs/bpf bpf bpf rw,nosuid,nodev,noexec │ ├─/sys/kernel/debug debugfs debugf rw,nosuid,nodev,noexec │ ├─/sys/kernel/tracing tracefs tracef rw,nosuid,nodev,noexec │ ├─/sys/fs/fuse/connections fusectl fusect rw,nosuid,nodev,noexec │ └─/sys/kernel/config configfs config rw,nosuid,nodev,noexec ├─/proc proc proc rw,nosuid,nodev,noexec │ └─/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=28,pgrp │ └─/proc/sys/fs/binfmt_misc binfmt_misc binfmt rw,nosuid,nodev,noexec ├─/dev udev devtmp rw,nosuid,noexec,relat │ ├─/dev/pts devpts devpts rw,nosuid,noexec,relat │ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev,inode6 │ ├─/dev/mqueue mqueue mqueue rw,nosuid,nodev,noexec │ └─/dev/hugepages hugetlbfs hugetl rw,relatime,pagesize=2 ├─/run tmpfs tmpfs rw,nosuid,nodev,noexec │ ├─/run/lock tmpfs tmpfs rw,nosuid,nodev,noexec │ └─/run/user/1000 tmpfs tmpfs rw,nosuid,nodev,relati │ └─/run/user/1000/gvfs gvfsd-fuse fuse.g rw,nosuid,nodev,relati ├─/snap/bare/5 /dev/loop0 squash ro,nodev,relatime,erro ├─/snap/glances/1243 /dev/loop1 squash ro,nodev,relatime,erro ├─/snap/core20/1778 /dev/loop2 squash ro,nodev,relatime,erro ├─/snap/core20/1738 /dev/loop3 squash ro,nodev,relatime,erro ├─/snap/glances/1168 /dev/loop4 squash ro,nodev,relatime,erro ├─/snap/gnome-3-38-2004/115 /dev/loop5 squash ro,nodev,relatime,erro ├─/snap/gnome-3-38-2004/119 /dev/loop6 squash ro,nodev,relatime,erro ├─/snap/gtk-common-themes/1535 /dev/loop7 squash ro,nodev,relatime,erro ├─/snap/snap-store/558 /dev/loop8 squash ro,nodev,relatime,erro ├─/snap/snap-store/638 /dev/loop9 squash ro,nodev,relatime,erro ├─/snap/snapd/17883 /dev/loop10 squash ro,nodev,relatime,erro └─/boot/efi /dev/sda1 vfat rw,relatime,fmask=0077 Step: 02 If you want to dig deeper into the understanding of the “findmnt” command: linux@linux-VirtualBox:~$ man findmnt Here is the detailed information about the “findmnt” command which was open on another Linux man terminal page. If you want to go back to the man terminal page, you have to press “q” to exit the “man findmnt” terminal. Technique 04: The “file” Command The “file” statement, which is employed to verify the kind of a certain file, is a further technique we will employ in the filesystems in Linux. Step: 01 Below is a different example where we are checking the different filesystems while giving the different filesystems paths. linux@linux-VirtualBox:~$ sudo file –sL /dev/sda1 /dev/sda1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "mkfs.fat", sectors/ cluster 8, Media descriptor 0xf8, sectors/track 63, heads 255, hidden sectors 2048, sectors 1048576 (volumes > 32 MB), FAT (32 bit), sectors/FAT 1024, reserve d 0x1, serial number 0x58c97606, unlabeled linux@linux-VirtualBox:~$ sudo file –sL /dev/sda5 /dev/sda5: Linux rev 1.0 ext4 filesysten data, UUID=6e3d13f8-16f7-4e12-bff8-8ca 1bbb6d0bd (needs journal recovery) (extents) (64bit) (large files) (huge files) Step: 02 Write the following command on the terminal and hit enter if you want further information: linux@linux-VirtualBox:~$ man file Technique 05: The “blkid” Command The “blkid” statement is another technique of the filesystem in Linux which is used to find and print the block device’s information. Step: 01 To access the information of blocked devices, we will simply write the blkid command in the terminal. linux@linux-VirtualBox:~$ sudo blkid As shown in the terminal, we have gotten the information along with the type of the filesystem. /dev/sda5: UUID="6e3d13f8-16f7-4e12-bff8-8ca1bbb6d0bd" TYPE="ext4" PARTUUID="e8ce01c9-05" /dev/loop0: TYPE="squashfs" /dev/loop1: TYPE="squashfs" /dev/loop2: TYPE="squashfs" /dev/loop3: TYPE="squashfs" /dev/loop4: TYPE="squashfs" /dev/loop5: TYPE="squashfs" /dev/loop6: TYPE="squashfs" /dev/loop7: TYPE="squashfs" /dev/sda1: UUID="58C9-7606" TYPE="vfat" PARTUUID="e8ce01c9-01" /dev/loop8: TYPE="squashfs" /dev/loop9: TYPE="squashfs" /dev/loop10: TYPE="squashfs" In the “blkid” command, if we want to display the information of the specific device, then we will write the path of the device which we want to get after writing the “sudo blkid” in the terminal. linux@linux-VirtualBox:~$ sudo blkid /dev/sda1 /dev/sda1: UUID="58C9-7606" TYPE="vfat" PARTUUID="e8ce01c9-01" Step: 02 We can access the “man” page of the “blkid” phrase in Linux and view additional details about it by typing the command below. linux@linux-VirtualBox:~$ man blkid Technique 06: The “df” Command Here is another technique to figure out the overall disc space and free space on a Linux filesystem, by utilizing the “df” command in the terminal. Step: 01 Let us just learn how to examine the quantity of free space still available in the Linux filesystem using the “df” statement. As you see below, we have got the filesystem which is the name of the mounted filesystem and it will also display the type. The “1k-blocks” is the size that is represented in one-kilo blocks and the free and used storage of the mounted filesystem. linux@linux-VirtualBox:~$ sudo df -T Filesystem Type 1K-blocks Used Available Use% Mounted on udev devtmpfs 1970752 0 1970752 0% /dev tmpfs tmpfs 401852 1360 400492 1% /run /dev/sda5 ext4 25107716 9980164 13826816 42% / tmpfs tmpfs 2009244 0 2009244 0% /dev/shm tmpfs tmpfs 5120 4 5116 1% /run/lock tmpfs tmpfs 2009244 0 2009244 0% /sys/fs/cgroup /dev/loop0 squashfs 128 128 0 100% /snap/bare/5 /dev/loop1 squashfs 10112 10112 0 100% /snap/glances/1243 /dev/loop2 squashfs 64896 64896 0 100% /snap/core20/1778 /dev/loop3 squashfs 64768 64768 0 100% /snap/core20/1738 /dev/loop4 squashfs 10240 10240 0 100% /snap/glances/1168 /dev/loop5 squashfs 354688 354688 0 100% /snap/gnome-3-38-2004/115 /dev/loop6 squashfs 354688 354688 0 100% /snap/gnome-3-38-2004/119 /dev/loop7 squashfs 93952 93952 0 100% /snap/gtk-common-themes/1535 /dev/loop8 squashfs 55552 55552 0 100% /snap/snap-store/558 /dev/loop9 squashfs 47104 47104 0 100% /snap/snap-store/638 /dev/loop10 squashfs 50816 50816 0 100% /snap/snapd/17883 /dev/sda1 vfat 523248 4 523244 1% /boot/efi tmpfs tmpfs 401848 28 401820 1% /run/user/1000 Step: 02 We shall type the man df statement on the terminal to obtain extra knowledge about the “df” statement: linux@linux-VirtualBox:~$ man df Technique 07: The “fstab” Command This technique will hold the static information of the filesystem in Linux. Step: 01 We first write the “cat” command so that we can access the filesystem information and then we write the path /etc/fstab. linux@linux-VirtualBox:~$ cat /etc/fstab # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda5 during installation UUID=6e3d13f8-16f7-4e12-bff8-8ca1bbb6d0bd / ext4 errors=remount-ro 0 1 # /boot/efi was on /dev/sda1 during installation UUID=58C9-7606 /boot/efi vfat umask=0077 0 1 /swapfile none swap sw 0 0 Step: 02 The following command can be used to dig deeply into the “fstab” statement: linux@linux-VirtualBox:~$ man fstab Technique 08: The “lsblk” Command The “lsblk” technique is utilized to show data on block devices, which except for RAM discs, are essentially files that indicate linked devices. Step: 01 We have used “-f” in the command so that we can represent the arguments of the files. linux@linux-VirtualBox:~$ lsblk -f NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT loop0 squash 0 100% /snap/bare loop1 squash 0 100% /snap/glan loop2 squash 0 100% /snap/core loop3 squash 0 100% /snap/core loop4 squash 0 100% /snap/glan loop5 squash 0 100% /snap/gnom loop6 squash 0 100% /snap/gnom loop7 squash 0 100% /snap/gtk- loop8 squash 0 100% /snap/snap loop9 squash 0 100% /snap/snap loop10 squash 0 100% /snap/snap sda ├─sda1 │ vfat 58C9-7606 511M 0% /boot/efi ├─sda2 │ └─sda5 ext4 6e3d13f8-16f7-4e12-bff8-8ca1bbb6d0bd 13.2G 40% / sr0 Step: 02 Use the command below to see the additional information on the “lsblk” statement: linux@linux-VirtualBox:~$ man lsblk” Technique 09: The “udevadm” Command The udevadm command is one of the techniques which we are going to use to check the filesystem type. The udev library is queried for device information using the udevadm command. But it also contains information about the filesystem type in Linux. Step 01: To check the file system type, the very first command we are going to use is the “udevadm” command in the Linux terminal. Write the following command in the Linux terminal: linux@linux-VirtualBox:~$ udevadm info –query=property /dev/sda1 | egrep “DEVNAME|ID_FS_TYPE” We have used the above command to query the database for the desired file type of device data with the “—query” statement. If we simply write the “udevadm –query”, the terminal will show us a lengthy output. This is why we have to use the “grep” statement that will show the necessary information to determine the file system type by further writing the “/dev/sda1” path. DEVNAME=/dev/sda1 ID_FS_TYPE=vfat Step 02: To get further details about the “udevadm” command in the Linux, we will use the “man” command in the Linux terminal: linux@linux-VirtualBox:~$ man udevadm The udevadm command will be opened into a new terminal of the Linux as shown below in the snapshot: Conclusion We have learned what is filesystem and how to check the type of mounted filesystem in Linux. We have discussed the different techniques of the mounted filesystem by writing every command of the filesystem type in the Linux terminal. View the full article
  7. In Linux, there are multiple system configuration files that regulate system behavior. The fstab file is such a configuration file that stores all the information about various partitions and storage devices on the computer. At the time of boot, the fstab file describes how each partition and device will mount. Let’s dive deep into the “/etc/fstab” file. The fstab file As described earlier, it’s a configuration file holding information about partitions, devices, and mount configurations. It’s located at the following location. $ ls -lh /etc/fstab It’s a plain text file, so we can use any text editor of our choice to work with it. However, it requires root permission to write changes to it. Basics First, have a look at the fstab file in your system. Note that each system will have different entries because of the partition and hardware differences. However, all fstab files will share the same fundamental structure. $ cat /etc/fstab Each line of the file is dedicated to a unique device/partition. It’s divided into six columns. Here’s a brief description of each of the columns. Column 1: Device name. Column 2: Default mount point. Column 3: Filesystem type. Column 4: Mount options. Column 5: Dump options. Column 6: Filesystem check options. Device name It’s the label of the particular device/partition. Each device and partition gets its unique device name. The device name is essential for mounting devices, partitions, and filesystems. We can use the lsblk command to get a report on all the block devices. It practically reports all the gadgets and partitions with their device names. $ lsblk -a Default mount point In Linux, a device, partition, or filesystem must be mounted on a location before the system can use it. Mounting makes the filesystem accessible through the computer’s filesystem. The mount point is the directory access to the device, partition, or filesystem. We can get a list of all the mounted partitions on the system. $ mount In the context of the fstab file, the mount point described for the specific device name will be used as the default mount point. When the computer boots, the system will mount all the devices to the mount points described in this file. Filesystem type A filesystem can be described as an index of the database with all the physical location of data on the storage. There are numerous filesystems used widely. Linux supports several filesystems by default. Here’s a shortlist of the popular filesystems. ext4 xfs btrfs vfat ntfs tmpfs nfs squashfs sysfs Another option is “auto,” which lets the system auto-detect the filesystem type of the device or partition. Use this option if you’re not confident about the specific filesystem. Mount options The mount options determine the mounting behavior of the device/partition. It’s considered the most confusing part of the fstab file. Here’s a shortlist of some of the common mount options you’ll come across when working with the fstab file. auto and noauto: This option determines if the system will mount the filesystem during boot. By default, the value is “auto,” meaning it’ll be mounted during boot. However, in specific scenarios, the “noauto” option may be applicable. user and nouser: It describes which user can mount the filesystem. If the value is “user,” then normal users can mount the filesystem. If the value is “nouser,” then only the root can mount it. By default, the value is “user.” For specific and critical filesystems, “nouser” can be helpful. exec and noexec: It describes whether binaries can be executed from the filesystem. The value “exec” allows binary execution, whereas “noexec” does not. The default value is “exec” for all partitions. sync and async: It determines how the input and output to the device/partition will be performed. If the value is “sync,” then input and output are done synchronously. If the value is “async,” then it’s done asynchronously. It affects how data is read and written. ro: It describes that the partition is to be treated as read-only. Data on the filesystem can’t be changed. rw: It describes that the partition is available for reading and writing data. Dump It describes whether the filesystem is to be backed up. If the value is 0, then the dump will ignore the filesystem. In most cases, it’s assigned 0. For backup, it’s more convenient to use various third-party tools. Fsck options The fsck tool checks the filesystem. The value assigned in this column determines in which order fsck will check the listed filesystems. Editing fstab file Before editing the fstab file, it’s always recommended to have a backup. Before making any changes to the fstab file, it’s recommended to make a backup first. It contains critical configuration details, so wrong entries may cause unwanted results. $ sudo cp -v /etc/fstab /etc/fstab.backup To edit the fstab file, launch your text editor of choice with sudo. $ sudo nano /etc/fstab To write a comment, use “#” at the start. $ # This is a comment Note that some entries may use the device UUID instead of a device name. To get the UUID of a device, use blkid. $ blkid <device_label> After all the changes are made, save the file and close the editor. These changes won’t be effective unless the system restarts. Final thoughts The fstab file is a simple yet powerful solution to many situations. It can also automate mounting remote filesystems. It just requires understanding the code structure and supported options to take the full benefit of it. For more in-depth info, check the man page. $ man fstab Happy computing! View the full article
  8. Fstab stands for File System Table, which is a system configuration file. This file is known as one of the most critical files in any Linux distribution because it handles the mounting and unmounting of file systems to the hardware. When you attach a new Hard Drive or SSD, you need to edit the fstab file to mount it and integrate it into the file system. So, when making an entry in fstab in Linux, we first need to understand the structure of the fstab file. Fstab File Format Fstab file is placed in /etc directory, which contains an entry for each file system, and each entry consists of six columns or fields. Since the entries are shown in the tabular form, it is known as File System Table. To open up the fstab file in any Linux distribution, you can use any text editor to make an entry in the fstab file. We will use a nano editor for opening the fstab file. The command for opening and editing the fstab file in the /etc directory is: $ sudo nano /etc/fstab Each column in the entry represents some specific information about the file system. Let’s have a look at an entry and have a brief discussion on each column. The first field represents the file system. The second field represents the mount point. The third field represents the type of file system. The fourth field represents the mount options. The fifth field represents the dump. The sixth field represents the pass. Now let’s see what they mean and how to make an entry in the fstab file. File System It usually contains the UUID or the name of the mounted block device. To make a new entry, we first need to provide the Universe Unique Identifier(UUID) or label of the block device. To know the UUID or label of the disk that you want to add as an entry in the fstab file, type the command given below: $ lsblk -fs To add any disk, get the UUID or label of that disk and paste it as the first field of an entry in the fstab file. Mount Point The second field is to provide the path of the directory used by the system to access it. It is also mentioned in the details provided by the command: $ lsblk -fs Type In the third field, we need to provide the type of file system like ext4, swap, NTFS, etc. The file type of the disk is also available in the ‘lsblk’, and it can be accessed from there: $ lsblk -fs Options In the fourth field, you need to provide the list of mount options that you want to give when mounting the file system. To know what mount options are available and what to give, you can get all the list of mount option from the man page of mount using the command given below: $ man mount Suppose you want to set the default options like read-write(RW), suid, dev, exec, auto, nouser, and async. You can simply write defaults in the fourth field. However, if you are going to provide multiple mount options, separate them using commas. Dump The fifth field is for the backup option. Here we mention whether the file system should be dumped or not using the binary values 0 and 1, where 0 = No backup and 1 = backup. It is an outdated method now, so you can provide 0 and move ahead. Pass In the last field, we need to write the file system check order, also known as the fsck order. This field takes only three values 0, 1, and 2. The value 0 is for not checking the file system and pass, 1 should be set for the root filesystem, and all other partitions should be set to 2. If you do not provide any value, 0 will be selected by default. Alright, after knowing all the information about a single entry and its fields, now you are fully able to make an entry in the fstab file. Conclusion This post provides brief and profound knowledge about the fstab file and explains how to make an entry in fstab in Linux. After reading this post, you can add and mount a hard drive or SSD by making an entry in the fstab file. View the full article
  • Forum Statistics

    43.9k
    Total Topics
    43.4k
    Total Posts
×
×
  • Create New...