LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mounting New Hard Drive (https://www.linuxquestions.org/questions/linux-newbie-8/mounting-new-hard-drive-659638/)

MONKEYJUDO 07-31-2008 10:52 PM

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.

yancek 07-31-2008 11:10 PM

You don't mount drives you mount filesystems so what do you have on the second drive, another partition, another OS?

onebuck 07-31-2008 11:34 PM

Hi,
Quote:

Originally Posted by MONKEYJUDO (Post 3232759)
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!

MONKEYJUDO 07-31-2008 11:35 PM

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?

onebuck 07-31-2008 11:51 PM

Hi,
Quote:

Originally Posted by MONKEYJUDO (Post 3232792)
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!

jay73 07-31-2008 11:56 PM

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).

MONKEYJUDO 07-31-2008 11:59 PM

Ok I think I got it. Thanks guys.

onebuck 08-01-2008 12:17 AM

Hi,
Quote:

Originally Posted by jay73 (Post 3232808)
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.

jay73 08-01-2008 12:52 AM

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.

onebuck 08-01-2008 01:26 AM

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! :rolleyes: GUI's have cost companies more $$ than they have saved.


All times are GMT -5. The time now is 06:28 PM.