LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mounting (https://www.linuxquestions.org/questions/linux-newbie-8/mounting-618299/)

fedoraman 02-03-2008 01:47 AM

Mounting
 
Hi,

I want to connect sata harddrive means 2nd hard drive in my fedora box already having the 1 sata hard drive please tell me about the procedure from scratch.

Thanks
Abhiz

b0uncer 02-03-2008 04:39 AM

Shut down your machine, take power cords off, ground the machine (there are some fancy ways of doing that, but it should do if you touch the ground yourself and touch the metal cage of the computer) and don't wear clothes that could cause static electicity shocks. Shortly said, open your machine in a "safe" way so that you don't get lightning. Then install the harddisk to the cage, with all the screws that hold it in place, connect the cables and put back the cover of the machine.

Once the harddisk is physically connected, boot the machine. Fedora should pick it up all by itself. Then you can use (install trough package management, if needed) GParted to partition and format the disk - create one or more partitions on it if there are not already, and format it (ext3 is a good filesystem if you only intend to use it with Linux). After that it should be at your use.

The command-line way is to (as root - first command 'su -' to become root) use cfdisk (or fdisk, if you feel so, but cfdisk might be easier) to make some partitions on the device:
Code:

cfdisk /dev/sdb
Then you could use mkfs.ext3 program to make ext3 partitions (if you want them) onto the partitions you created. Something like
Code:

mkfs.ext3 /dev/sdb1
for the 1st partition of sdb, your secondary harddisk. sdb2 for the second partition, and so on. Read
Code:

man mkfs.ext3
for more options of that program.

Once it's partitioned and formatted, you can mount it with 'mount': first make a directory where you mount the harddisk's contents (where ever you like; here I show how to make it to /media/):
Code:

mkdir /media/my_new_harddisk
Then mount it:
Code:

mount /dev/sdb1 /media/my_new_harddisk
And there you go. Again sdb1 is for the first partition...

Umounting:
Code:

umount /media/my_new_partition
If you want to automate mounting it, add a new line to /etc/fstab - for example
Code:

/dev/sdb1  /media/my_new_partition  auto  defaults,auto  0  0
again read more about fstab to know the options.

xiao_haozi 02-03-2008 09:36 AM

Quick guide
 
Hi, the above post is right on. Don't have too much more to add but if you wish to get some information on FSTAB so you can have your drive mounted on reboot automatically, you can check out a guide we have up on adding a new hard drive. The guide is for Slackware Linux, but is essentially the same process. You can view it here at Mutaku. Hope that helps you out!


All times are GMT -5. The time now is 04:13 PM.