Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


How to add a hardisk and make it accessible in Linux ?

Posted on 2001-08-23
Medium Priority
Last Modified: 2008-02-01
I'm currently running Linux Redhat 7.1 and have 2 hardisks (hda & hdb).
I tried to add another hardisk (hdc). However, it is not accessible because its not mounted. It was not allowed to mount because fs not supported.

How should I do it, as in windows, just add a new hardisk, and you will see it, and can use it as any other current drive.

(I'd need to copy something from hda to hdc, and use hdc to transfer to another pc somewhere else.)

Can someone pls tell me what should I do (b'cos I'm very new to Linux).

Thankx. :)
Question by:shchong2
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 6419346
You should be able to get this to work.  If the other machine is a linux box do the following:

1 - Put in drive.
2 - Boot up
3 - "fdisk /dev/hdc"
4 - If thier are nore partitions, add one.  If there are partitions, note thier type and number.
5 - Exit fdisk.
6 - "mkdir /newdrive"
7 - mount -t 'fstype' /dev/hdc? /newdrive"  If you created your own partition, type  "mount -t ext2 /dev/hdc1 /newdrive".  If thier was already a FAT partition there type "mount -t msdos /dev/hdc1 /newdrive"

Good luck and please post any issues that need clarification.

Expert Comment

ID: 6419839

     If you add a brand new hard disk under a windows (3.11, 95, 98, NT) system, you cannot see it either, you have to do at least a fdisk to see it and create a file system with the format command or equivalent.


Expert Comment

ID: 6425880
After you have added a drive, you should boot messages
that give you clues that the drive was properly recognised.

ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: 40088160 sectors (20525 MB) w/1961KiB Cache, CHS=2651/240/63, UDMA(33)
hdd: ATAPI 50X CD-ROM drive, 128kB Cache

Note, it is quite likely that you have added this third drive to the secondary ide controller. Depending on whether it was configured as a primary or a slave, it may be seen as 'hdd' (like my cdrom above) instead of 'hdc'.

If the boot messages zoom past too fast (gee I wish I had that problem!), you can see them at the command prompt with the 'dmesg' command.

Next, you need to create partitions on the drive. On drives that are to contain just data (no os), I usually first create one single 'extended' primary partition to cover the whole disk, and then carve out partitions I need from this extended partition. This gets around the 4 primary partition limitation.

Of course, the next step is to format you partiton. Something like: 'mke2fs /dev/hdc6' (formats the first partition inside the extended partition).

The mount point must exist. Simply make a directory where you want the partition mounted. Finally: 'mount /dev/hdc6 /www'. Note - ext2 is automatically recognosed by mount, so there is no need to use the '-t' parameter, unless the filesystem was built as something other than ext2.

Finally, you might want to add an entry to you /etc/fstab to automatically mount this filesystem at boot. add a line like....

/dev/hdc6      /www         ext2        defaults   1   1

Hope this helps!
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 6426057
Hi, just wanna clarify something :-

I've 3 HARDISK i.e. hda, hdb and hdc
hda is installed with Linux Redhat 7.1 and Windows 2000 with dual-boot
hdb with 3 partition but all Win FAT32
hdc is 2GB with 1GB (hdc1) of Linux ext2 fs and 1GB (hdc5) of Win FAT32

1. when I type "mkdir /batigol" , then "mount -t ext2 /dev/hdc1 /batigol", it works
   but for "mkdir /owen", then "mount -t msdos /dev/hdc5 /owen", it can't recognise it ?

2. After mounting hdc1, I see the directry /batigol , but there are some files in there :
     module -info
     module -info-2.2.14-5.o
     os2 d.b

Sorry I don't mean to be long-winded.
Just want to clear some doubts.
Thankx for the help of experts
thankx for teaching me so many new stuff and make my learning of linux an enjoyable one

Author Comment

ID: 6426064
what are those files in the /batigol actually means

are they system files ?
Can I do anything to them ?


Expert Comment

ID: 6427131
The files listed on /batigol is the contents of a /boot partition. Did you run the redhat install on the hdc partition? Anyway, to get a list of what partitions are on that drive you should run 'fdisk /dev/hdc' and enter 'p' to print the partition table. Post that, and I can probably be more help.

As far as 'mount -t msdos ....', in order to mount an msdos partition you need to have msdos filesystem support in your kernel. Try... 'modprobe msdos', or 'modprobe vfat' before you run the mount command.

Author Comment

ID: 6428690
In hda, I have some mount points :-

In hdb, no "linux partition", all are "Win FAT32"

In hdc,
--> hdc1 is "Win FAT32" (1 GB)
--> hdc5 is "Linux native" (1GB)

(hdc is totally empty initially. It contains no OS nor data)


Expert Comment

ID: 6429740
Well, now you got me confused. You say that "mount -t ext2 /dev/hdc1 /batigol" works. But above you say it is formatted as fat32?? I Assume you ment to say that hdc5 is a fat32. How did you format this partition? Did you use mkfs or was it formatted with windows?

Author Comment

ID: 6430097
sorry, sorry, my mistake
--> hdc1 is "Linux native"
--> hdc5 is "Win FAT32"

really sorry

Accepted Solution

moonbeam012200 earned 200 total points
ID: 6430187
So, the only issue left is that you can't mount your windows partition on /dev/hdc5 (?). So...

1. how was this partition formatted? (mkfs, mkdosfs, windows) I would suggest mkdosfs.
2. do you have msdos and vfat support in your kernel?
3. if the support is not built into the kernel, do you
   have the kernel module loaded (/sbin/lsmod)?

Author Comment

ID: 6457839
Really thank you very much, moonbeam.

You are really a Linux expert !!!


Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

618 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