LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-31-2008, 10:52 PM   #1
MONKEYJUDO
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Rep: Reputation: 0
Mounting New Hard Drive


Can someone let me know how I would go about mounting a new secondary hard drive in a Centos 5 box? I have a primary already in the box and I think I need to create a new /dir and mount it to that but not sure. I know this is a noobie question.
 
Old 07-31-2008, 11:10 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,026

Rep: Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309
You don't mount drives you mount filesystems so what do you have on the second drive, another partition, another OS?
 
Old 07-31-2008, 11:34 PM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,615
Blog Entries: 26

Rep: Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986
Hi,
Quote:
Originally Posted by MONKEYJUDO View Post
Can someone let me know how I would go about mounting a new secondary hard drive in a Centos 5 box? I have a primary already in the box and I think I need to create a new /dir and mount it to that but not sure. I know this is a noobie question.
First you would need a mount point, do this from the cli by;
Code:
~#mkdir /mnt/my_mount_point  #create a dir within /mnt
Then you can mount the system;

Code:
~#mount -t ext3 /dev/sda1 /mnt/my_mount_point
The first command creates a directory within '/mnt' called 'my_mount_point'. The second mounts the ext3 filesystem on the /mnt/my_mount_point'. You can then perform with permission on the mounted filesystem. I have assumed that you are root to perform the above actions.

You could just as easily create '/home/username/mount_point' within your structure.

'man' is your friend and I suggest that you do use it. You could look online at 'LINUX MAN PAGES ONLINE'.

I would suggest that you look at 'Linux Newbie Admin Guide'.

These links and others are available from 'Slackware-Links'. More than just SlackwareŽ links!
 
Old 07-31-2008, 11:35 PM   #4
MONKEYJUDO
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Original Poster
Rep: Reputation: 0
No its just a secondary with nothing on it. I will have to migrate the stuff on the old secondary to it. I was curious if I needed to mount it?
 
Old 07-31-2008, 11:51 PM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,615
Blog Entries: 26

Rep: Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986
Hi,
Quote:
Originally Posted by MONKEYJUDO View Post
No its just a secondary with nothing on it. I will have to migrate the stuff on the old secondary to it. I was curious if I needed to mount it?
How do you plan on migrating the data to the new drive?

You could do a 'dd' to copy the whole thing. Look at 'Learn The DD Command Revised' to get the whole scope.

This link and others are available from 'Slackware-Links'. More than just SlackwareŽ links!
 
Old 07-31-2008, 11:56 PM   #6
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
I should think that there is little point in dd if you are not copying system files. Just copying stuff using cp (-R) will have the advantage that your stuff gets defragmented in the process while dd basically makes a clone of the original.

Of course, before you can mount your drive, you'll need to format. This can be done either from the command line using fdisk and then mkfs.ext3 or graphically using gparted (available on most distros, including CentOS).
 
Old 07-31-2008, 11:59 PM   #7
MONKEYJUDO
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Original Poster
Rep: Reputation: 0
Ok I think I got it. Thanks guys.
 
Old 08-01-2008, 12:17 AM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,615
Blog Entries: 26

Rep: Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986
Hi,
Quote:
Originally Posted by jay73 View Post
I should think that there is little point in dd if you are not copying system files. Just copying stuff using cp (-R) will have the advantage that your stuff gets defragmented in the process while dd basically makes a clone of the original.

Of course, before you can mount your drive, you'll need to format. This can be done either from the command line using fdisk and then mkfs.ext3 or graphically using gparted (available on most distros, including CentOS).
I thought that's what the OP wanted. A clone or migration of data!

The cp -R does not defrag the stuff. Where do you get the file(s) is fragged to begin with? If it was a M$ filesystem then the possibilities do exist that things could be fragmented. If a existing Linux filesystem then fragmentation is not going to be a problem or issue. The (-R) is just a recursive copy option for the 'cp' command.

Yes, 'dd' will copy and convert depending on the options the user supplies. I would feel better using dd to clone a copy of a system than a 'cp -R' of the same. Sure you need to know what your doing with 'dd' but the same goes with any command.
 
Old 08-01-2008, 12:52 AM   #9
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Quote:
The cp -R does not defrag the stuff. Where do you get the file(s) is fragged to begin with? If it was a M$ filesystem then the possibilities do exist that things could be fragmented. If a existing Linux filesystem then fragmentation is not going to be a problem or issue. The (-R) is just a recursive copy option for the 'cp' command.
I should pick my words more carefully. I was actually thinking more on a macro level. Individual files won't get fragmented until the filesystem gets rather full but groups of related files will be dispersed all over the drive. This can results in more seeks (so more wear) and slower access. I think that this is what most non-techies mean nowadays when they talk about fragmentation. All the NTFS "defragging" is often nothing more than regrouping sets of files.
 
Old 08-01-2008, 01:26 AM   #10
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,615
Blog Entries: 26

Rep: Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986Reputation: 1986
Hi

Agree!

Terminology can be a hassle at times. I just read that the '-R' as you stated would defrag as a copy. Actually the cp would copy, but the actual structure of the copy will be dependent on the target not the source (other than having valid data as source). The flow of the information would be source dependent but the final copy would be target dependent for the final copy by default in the way the file(s) are allocated storage. That's another reason to utilize the 'dd' to make a migration of bulk information.

Just my way! Sure if I just have a few MB to copy of a fileset then a cp would be the way. But large amounts of data do warrant a controlled and verifiable copy of information.

I see people drag & drop all the time and then when they have a corrupt copy of the information that is a must have set complain when the data is not valid.

I've seen people copy information to a file then move the same to a cd for term storage. They then take the cd out with the assumption the data is valid. The burn software checked it right! GUI's have cost companies more $$ than they have saved.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help on mounting Hard Disk Drive and CD-ROM drive in Dapper. ussr_1991 Ubuntu 2 08-18-2007 11:33 PM
mounting other hard drive? lilili Linux - General 4 01-06-2006 02:47 PM
Need help mounting a hard drive cevilgenius Linux - Newbie 15 04-12-2005 02:35 PM
Mounting a Hard Drive Bill413 Linux - Newbie 6 11-15-2004 05:19 PM
Mounting a Hard Drive Garoth Linux - Software 9 11-11-2004 08:47 PM


All times are GMT -5. The time now is 10:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration