Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 804
  • Last Modified:

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

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
shchong2
Asked:
shchong2
1 Solution
 
ihardingCommented:
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
 
olidelCommented:
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
 
moonbeam012200Commented:
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
Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

 
shchong2Author Commented:
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
 
shchong2Author Commented:
what are those files in the /batigol actually means

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

:)
0
 
moonbeam012200Commented:
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
 
shchong2Author Commented:
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
 
moonbeam012200Commented:
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
 
shchong2Author Commented:
sorry, sorry, my mistake
:)
actually
--> hdc1 is "Linux native"
--> hdc5 is "Win FAT32"

really sorry
:)
0
 
moonbeam012200Commented:
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
 
shchong2Author Commented:
Really thank you very much, moonbeam.

You are really a Linux expert !!!

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

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

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