• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 377
  • Last Modified:

How to mount new partition on Linux

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.
  • 3
3 Solutions
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

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

jasimon9Author Commented:
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.
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.
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now