Improve company productivity with a Business Account.Sign Up


How to mount new partition on Linux

Posted on 2004-08-13
Medium Priority
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 160 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 340 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 340 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Each year, investment in cloud platforms grows more than 20% ( as an increasing number of companies begin to…
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …
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…

579 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