How to mount new partition on Linux

Posted on 2004-08-13
Last Modified: 2010-04-03
I have been away from Linux for several years now and have forgotten most everything. Don't even have my books anymore. Nevertheless, I am administering a Linux server (kind of shows you how hard that is!! :)

In any case, I need to mount a partition and am not getting anywhere. I would like something like Disk Druid, but I read that it is only available during installation. So I created the new partition using Partition Magic from NT.

The OS is RedHat 8. Here is the current configuration (hdb is the one of interest):

120 GB hda:
   Windows NT in first partition
   swap partition
   boot partition
   / partition

30 GB hdb:
   small NTFS partition
   newly formatted ext3 partition on most of the disk--this is the one I want to mount

What I need to know is what I need to do to mount this partition. I have tried

   mount -t ext3 /dev/hdX /var/local/Backup/mnt-hdb

where /dev/hdX refers to attempts at different numbers from 1 thru 3
and where /var/local/Backup/mnt-hdb is a newly created directory.

I always get an error message.

Eventually I would like to edit fstab so that this partition is auto-mounted. I am looking for the proper mount command and fstab entry.
Question by:jasimon9
  • 3
LVL 15

Assisted Solution

scampgb earned 40 total points
ID: 11799692
Assuming that the second disk is an IDE drive, and the OS sees it as hdb, it should be as simple as:

mount /dev/hdb1 /var/local/Backup/mnt-hdb

That also assumes that the partition is the first one on the disk.
BTW, You can look at this with fdisk /dev/hdb

LVL 22

Assisted Solution

pjedmond earned 85 total points
ID: 11800809
mount -t ext2 /dev/hd2 /var/local/Backup/mnt-hdb

Should work, however note the following:

1.    The type is ext2 (ext3 is ext2 with a journalling). I'm not sure what happens with journalling when an ext3 system is potentially mounted outside of the initialisation process. (Once it works with ext2, try switching to ext3).

2.    The dev is /dev/hda2  (The disc is hda, and the first partition is the NTFS partition(hda1), and the second is hda2...BUT....if hda2 is set up as an extended partition, then the one you want could be hda3). As suggested:

fdisk /dev/hdb

p then prints the partition table
q quite
m gives a menu

3.    The mount point MUST exist.

mkdir /var/local/Backup/mnt-hdb

if it doesn't already exist


Author Comment

ID: 11802679
1. So far both posts are helpful in answering my first question. It appears that I just did not go out far enough, only trying hdb0, hbd1, hdb2, and hdb3. It turned out the partition I wanted is hdb6, and for some reason only hdb1, hdb5 and hdb6 are listed on the fdisk listing.

2. Now I just need to make the proper changes so that this volume is automounted. Either the line that I need, or a tool to use that does it right.
LVL 22

Accepted Solution

pjedmond earned 85 total points
ID: 11803381
Add the following line to your /etc/fstab

/dev/hdb6               /var/local/Backup/mnt-hdb                    ext2    defaults        0 0

If it works try changing ext2 to ext3 to get the journalling. The 0 0 at the end relate to how often file checks should occur on the partition.
LVL 22

Expert Comment

ID: 11803386
The fact that you can only see hdb1, hdb5 and hdb6 is a historical issue in that DOS could only boot from partitions 1-4 and only one bootable partition was allowed on a hard drive. This is avoided by creating an extended partition, and sticking the linux partition in that.

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having issues meeting security compliance criteria because of those pesky USB drives? Then I can help you! This article will explain how to disable USB Mass Storage devices in Windows Server 2008 R2.
Is your phone running out of space to hold pictures?  This article will show you quick tips on how to solve this problem.
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question