Solved

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

Posted on 2001-08-23
11
747 Views
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. :)
0
Comment
Question by:shchong2
11 Comments
 
LVL 3

Expert Comment

by:iharding
Comment Utility
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.
0
 
LVL 2

Expert Comment

by:olidel
Comment Utility
Hi,

     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.

Bye.
0
 
LVL 5

Expert Comment

by:moonbeam012200
Comment Utility
After you have added a drive, you should boot messages
that give you clues that the drive was properly recognised.
eg:

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!
0
 

Author Comment

by:shchong2
Comment Utility
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 :
     /lost+found
     boot.b
     chain.b
     kernel.h
     module -info
     module -info-2.2.14-5.o
     os2 d.b
     system.map
     system.map-2.2.14-5.o
     vmlinux-2.2.14-5.o
     vmlinuz
     vmlinuz-2.2.14-5.o

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
:)
0
 

Author Comment

by:shchong2
Comment Utility
what are those files in the /batigol actually means

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

:)
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 5

Expert Comment

by:moonbeam012200
Comment Utility
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.
0
 

Author Comment

by:shchong2
Comment Utility
Actually
In hda, I have some mount points :-
   /
   /boot
   /usr
   /home
   /tmp
   /var
   <swap>

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)

:)
0
 
LVL 5

Expert Comment

by:moonbeam012200
Comment Utility
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?
0
 

Author Comment

by:shchong2
Comment Utility
sorry, sorry, my mistake
:)
actually
--> hdc1 is "Linux native"
--> hdc5 is "Win FAT32"

really sorry
:)
0
 
LVL 5

Accepted Solution

by:
moonbeam012200 earned 50 total points
Comment Utility
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)?
0
 

Author Comment

by:shchong2
Comment Utility
Really thank you very much, moonbeam.

You are really a Linux expert !!!

:)
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Configure QoS on Archer c9 running WR-DDT 2 42
linux date/time setting via python 6 36
Issue to mail 11 35
Sendmail STARTTLS error 37 38
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now