{"id":3792,"date":"2023-11-22T10:50:36","date_gmt":"2023-11-22T02:50:36","guid":{"rendered":"https:\/\/www.servergigabit.com\/guide\/?post_type=kb&#038;p=3792"},"modified":"2026-03-16T12:00:10","modified_gmt":"2026-03-16T04:00:10","slug":"mount-additional-hard-disk-linux","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/mount-additional-hard-disk-linux","title":{"rendered":"Comprehensive Guide: Mounting an Additional Hard Disk in Linux"},"content":{"rendered":"<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-3793\" src=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/v-300x169.jpeg\" alt=\"Hard Disk in Linux\" width=\"715\" height=\"403\" srcset=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/v-300x169.jpeg 300w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/v-1024x576.jpeg 1024w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/v-768x432.jpeg 768w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/v-1536x864.jpeg 1536w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/v-2048x1152.jpeg 2048w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/v-370x208.jpeg 370w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/v-1230x692.jpeg 1230w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/v-800x450.jpeg 800w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/v-390x219.jpeg 390w\" sizes=\"(max-width: 715px) 100vw, 715px\" \/><\/p>\n<div class=\"markdown markdown-main-panel\" dir=\"ltr\">\n<p data-sourcepos=\"3:1-3:94\">Mounting an additional hard disk in <a href=\"https:\/\/www.servergigabit.com\/linux-vps-hosting\/\">Linux<\/a> allows you to expand your storage capacity and utilize the additional space for various purposes, such as storing data, creating backups, or hosting virtual machines. This guide will walk you through the process of mounting an additional hard disk in Linux, including creating a partition, formatting the partition with a file system, mounting the partition in a directory, and automatically mounting the partition after a reboot.<\/p>\n<h2 data-sourcepos=\"5:1-5:17\"><strong>Prerequisites<\/strong><\/h2>\n<ul data-sourcepos=\"7:1-9:0\">\n<li data-sourcepos=\"7:1-7:55\">A Linux server with an additional hard disk installed<\/li>\n<li data-sourcepos=\"8:1-9:0\">Root or sudo privileges on the server<\/li>\n<\/ul>\n<h2 data-sourcepos=\"10:1-10:9\"><strong>Steps<\/strong><\/h2>\n<h4><strong>List the recognized disks:<\/strong><\/h4>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\">sudo fdisk -l\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"18:1-18:186\"><img decoding=\"async\" class=\"\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/05\/fdisk.png\" alt=\"fdisk\" width=\"666\" height=\"331\" \/><\/p>\n<p data-sourcepos=\"18:1-18:186\">This command will list all the disks recognized by your system. In our example, we have two disks: <code>\/dev\/sda<\/code>, our system disk, and <code>\/dev\/sdb<\/code>, the additional hard disk we want to mount.<\/p>\n<h4><strong>Create a partition table:<\/strong><\/h4>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\">sudo cfdisk \/dev\/sdb\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"26:1-26:232\"><img decoding=\"async\" class=\"\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/05\/dosgptneu.png\" width=\"668\" height=\"350\" \/><\/p>\n<p data-sourcepos=\"26:1-26:232\">This command will open the cfdisk graphical interface. If there is no existing partition table on the disk, a menu will pop up. Choose <code>dos<\/code> to write an MBR partition table to the disk. After that, the main menu of cfdisk will open.<\/p>\n<p data-sourcepos=\"26:1-26:232\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/05\/cfdisk2.png\" alt=\"cfdisk2\" width=\"665\" height=\"396\" \/><\/p>\n<h4><strong>Create a partition:<\/strong><\/h4>\n<p data-sourcepos=\"30:1-30:72\">Enter <code>50G<\/code> and confirm with the Enter key to create a 50 GiB partition.<\/p>\n<p data-sourcepos=\"30:1-30:72\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/05\/cfdisk3.png\" alt=\"cfdisk3\" width=\"668\" height=\"398\" \/><\/p>\n<h4><strong>Set the partition type:<\/strong><\/h4>\n<p data-sourcepos=\"34:1-34:47\">Choose <code>primary<\/code> to create a primary partition.<\/p>\n<p data-sourcepos=\"34:1-34:47\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/05\/cfdisk6.png\" width=\"665\" height=\"400\" \/><\/p>\n<h4><strong>Write the partition table:<\/strong><\/h4>\n<p data-sourcepos=\"38:1-38:72\">Confirm with <code>Write<\/code> and type in <code>yes<\/code> to finish creating the partition.<\/p>\n<h4><strong>Check if the partition was created properly:<\/strong><\/h4>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\">sudo fdisk -l\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"46:1-46:47\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/05\/fdisk2.png\" alt=\"fdisk2\" width=\"666\" height=\"443\" \/><\/p>\n<p data-sourcepos=\"46:1-46:47\">Our new partition is now listed as <code>\/dev\/sdb1<\/code>.<\/p>\n<h4><strong>Format the partition with a file system:<\/strong><\/h4>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\">sudo mkfs.ext4 \/dev\/sdb1\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"54:1-54:65\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/05\/mkfs.png\" alt=\"mkfs\" width=\"670\" height=\"225\" \/><\/p>\n<p data-sourcepos=\"54:1-54:65\">This command will format the partition with the ext4 file system.<\/p>\n<h4><strong>Create a mount point:<\/strong><\/h4>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\">sudo mkdir \/datastore\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"62:1-62:78\">This command will create a folder named <code>datastore<\/code> to mount the partition to.<\/p>\n<h4><strong>Mount the partition:<\/strong><\/h4>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\">sudo mount \/dev\/sdb1 \/datastore\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"70:1-70:65\">This command will mount the partition to the <code>\/datastore<\/code> folder.<\/p>\n<h4><strong>Automatically mount the partition after a reboot:<\/strong><\/h4>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\">sudo nano \/etc\/fstab\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"78:1-78:109\">This command will open the <code>\/etc\/fstab<\/code> file in a text editor. Add the following line to the end of the file:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\"><span class=\"citation-0\">UUID=d6ae62ff-c9b7-4a07-aea8-a36f55c5036d \/datastore ext4 defaults 0 0\r\n<\/span><\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"84:1-84:58\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2015\/06\/fstab3.png\" width=\"669\" height=\"157\" \/><\/p>\n<p data-sourcepos=\"84:1-84:58\"><span class=\"citation-0 citation-end-0\">Make sure to replace the UUID with your actual one.<\/span><\/p>\n<h4 data-sourcepos=\"86:5-86:50\"><strong>Save the changes to the <code>\/etc\/fstab<\/code> file.<\/strong><\/h4>\n<h4 data-sourcepos=\"88:5-88:27\"><strong>Reboot your server.<\/strong><\/h4>\n<p data-sourcepos=\"90:1-90:62\">The additional hard disk should now be mounted and accessible.<\/p>\n<h2 data-sourcepos=\"3:1-3:29\"><strong>Additional Considerations<\/strong><\/h2>\n<ul data-sourcepos=\"5:1-5:35\">\n<li data-sourcepos=\"5:1-5:35\">\n<p data-sourcepos=\"5:3-5:199\">Partition Size: When creating a partition, consider the amount of storage space you need. A larger partition will provide more storage capacity, but it may also take longer to format and mount.<\/p>\n<\/li>\n<li data-sourcepos=\"7:1-7:123\">\n<p data-sourcepos=\"7:3-7:123\">File System Choice: Ext4 is a commonly used file system, but other options are available, such as XFS and Btrfs. Each file system has its own strengths and weaknesses, so research the options to choose the best fit for your needs.<\/p>\n<\/li>\n<li data-sourcepos=\"9:1-9:35\">\n<p data-sourcepos=\"9:3-9:35\">Mount Options: The <code class=\"\">defaults<\/code> option in the <code class=\"\">\/etc\/fstab<\/code> entry ensures that the partition is mounted with standard options. You can also specify additional mount options, such as <code class=\"\">rw<\/code> for read-write access or <code class=\"\">ro<\/code> for read-only access.<\/p>\n<\/li>\n<li data-sourcepos=\"11:1-12:0\">\n<p data-sourcepos=\"11:3-11:205\">Permissions: Once the partition is mounted, you may need to adjust the permissions of the mount point directory to allow users or groups to access and modify files stored on the additional hard disk.<\/p>\n<\/li>\n<\/ul>\n<h2 data-sourcepos=\"13:1-13:19\"><strong>Troubleshooting<\/strong><\/h2>\n<p data-sourcepos=\"15:1-15:109\">If you encounter issues while mounting an additional hard disk, consider the following troubleshooting steps:<\/p>\n<ul data-sourcepos=\"17:1-17:92\">\n<li data-sourcepos=\"17:1-17:92\">\n<p data-sourcepos=\"17:3-17:157\">Verify Device Recognition: Check if the hard disk is properly recognized by the system using the <code class=\"\">fdisk -l<\/code> command. Ensure the device name is correct.<\/p>\n<\/li>\n<li data-sourcepos=\"19:1-20:0\">\n<p data-sourcepos=\"19:3-19:197\">Check Partition Table and Format: Use the <code class=\"\">fdisk<\/code> and <code class=\"\">mkfs.ext4<\/code> commands to verify that the partition table is properly created and the partition is formatted with a compatible file system.<\/p>\n<\/li>\n<li data-sourcepos=\"21:1-22:0\">\n<p data-sourcepos=\"21:3-21:115\">Validate Mount Point Existence: Ensure that the mount point directory exists and has appropriate permissions.<\/p>\n<\/li>\n<li data-sourcepos=\"23:1-24:0\">\n<p data-sourcepos=\"23:3-23:120\">Review fstab Entry: Double-check the<a href=\"https:\/\/www.techtarget.com\/searchapparchitecture\/definition\/UUID-Universal-Unique-Identifier\" target=\"_blank\" rel=\"noopener\"> UUID<\/a> and mount options specified in the <code class=\"\">\/etc\/fstab<\/code> entry for the partition.<\/p>\n<\/li>\n<li data-sourcepos=\"25:1-26:0\">\n<p data-sourcepos=\"25:3-25:113\">Check for System Logs: Consult system logs for any error messages related to disk mounting or partitioning.<\/p>\n<\/li>\n<li data-sourcepos=\"27:1-28:0\">\n<p data-sourcepos=\"27:3-27:156\">Seek Community Support: If the issue persists, consider seeking assistance from online forums or communities dedicated to Linux system administration.<\/p>\n<\/li>\n<\/ul>\n<h2 data-sourcepos=\"29:1-29:14\"><strong>Conclusion<\/strong><\/h2>\n<p data-sourcepos=\"31:1-31:370\">Mounting an additional hard disk in <a href=\"https:\/\/www.servergigabit.com\/linux-vps-hosting\/\">Linux<\/a> provides a straightforward way to expand storage capacity and enhance the capabilities of your server. By following the steps outlined in this guide, you can effectively integrate the additional hard disk into your system and utilize it for various purposes, including data storage, backup solutions, or virtual machine hosting.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Mounting an additional hard disk in Linux allows you to expand your storage capacity and utilize the additional space for various purposes, such as storing data, creating backups, or hosting virtual machines. This guide will walk you through the process of mounting an additional hard disk in Linux, including creating a partition, formatting the partition with a file system, mounting&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[1099],"kbtag":[1164,1166,1158],"class_list":["post-3792","kb","type-kb","status-publish","hentry","kbtopic-tutorials","kbtag-hard-disk","kbtag-hard-disk-in-linux","kbtag-linux"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3792","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=3792"}],"version-history":[{"count":6,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3792\/revisions"}],"predecessor-version":[{"id":4274,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3792\/revisions\/4274"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=3792"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=3792"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=3792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}