Help with mounting of second hard drive
Hi, I'm looking for some advice with regards using a second hard disk with SUSE Linux Professional 9.1. So far I have carried out the following. Logged in as root user and partitioned my new hard disk with fdisk, using the command fdisk /dev/hdb1. I then formatted the partition with the following command, mke2fs /dev/hdb1. What I want to know now, is how I go about mounting the drive? I want the second hard drive to act as extra space for my own documents, such as mp3's, photos, movie files etc. Any advice, most appreciated. -- David .~. / ^ \ /| |\ simply change .\ /. .^.
On Tuesday 09 November 2004 21:58, David James Pettifor wrote:
Hi,
I'm looking for some advice with regards using a second hard disk with SUSE Linux Professional 9.1. So far I have carried out the following. Logged in as root user and partitioned my new hard disk with fdisk, using the command fdisk /dev/hdb1. I then formatted the partition with the following command, mke2fs /dev/hdb1.
Why do you use ext2 as a file system. Why not at least ext3, or xfs, or reiserfs? (format with mkfs.ext3, mkfs.xfs or mkfs.reiserfs respectively)
What I want to know now, is how I go about mounting the drive? I want the second hard drive to act as extra space for my own documents, such as mp3's, photos, movie files etc.
Decide where you want your new drive to be accessed. For example /data or /usr/local/data or /mnt/data, or whatever. When you've decided, create the directory with "mkdir /data" (or whatever you decide on), then mount it with "mount /dev/hdb1 /data". to make it mount automatically on boot, add a new line to /etc/fstab with something like /dev/hdb1 /data ext2 defaults 1 2 Change ext2 to ext3, reiser or xfs if you decide to go with one of them instead (I highly recommend it)
On Tuesday 09 Nov 2004 21:27 pm, Anders Johansson wrote:
On Tuesday 09 November 2004 21:58, David James Pettifor wrote:
Hi,
I'm looking for some advice with regards using a second hard disk with SUSE Linux Professional 9.1. So far I have carried out the following. Logged in as root user and partitioned my new hard disk with fdisk, using the command fdisk /dev/hdb1. I then formatted the partition with the following command, mke2fs /dev/hdb1.
Why do you use ext2 as a file system. Why not at least ext3,
Maybe he did use ext3 - mke2fs deals with both.
or xfs, or reiserfs? (format with mkfs.ext3, mkfs.xfs or mkfs.reiserfs respectively)
To avoid boot-time module issues, maybe?
What I want to know now, is how I go about mounting the drive? I want the second hard drive to act as extra space for my own documents, such as mp3's, photos, movie files etc.
Decide where you want your new drive to be accessed. For example /data or /usr/local/data or /mnt/data, or whatever. When you've decided, create the directory with "mkdir /data" (or whatever you decide on), then mount it with "mount /dev/hdb1 /data".
to make it mount automatically on boot, add a new line to /etc/fstab with something like
/dev/hdb1 /data ext2 defaults 1 2
Change ext2 to ext3, reiser or xfs if you decide to go with one of them instead (I highly recommend it)
-- "I see your Schwartz is as big as mine" -Dark Helmet
On Tuesday 09 November 2004 22:41, Dylan wrote:
or xfs, or reiserfs? (format with mkfs.ext3, mkfs.xfs or mkfs.reiserfs respectively)
To avoid boot-time module issues, maybe?
He said he was getting it as a secondary disk, so there won't be any module issues. You only need to worry about modules to mount the root partition. Once that's done, the rest is automatic And even if it were a root partition he was creating, having to put a module in an initrd is a pretty cheap price to pay for not having to sit through endless fsck runs in case of improper shutdowns. One extra thing to do once, compared to what could be hours of waiting potentially several times
On Tuesday 09 November 2004 21:27, Anders Johansson wrote:
On Tuesday 09 November 2004 21:58, David James Pettifor wrote:
Hi,
I'm looking for some advice with regards using a second hard disk with SUSE Linux Professional 9.1. So far I have carried out the following. Logged in as root user and partitioned my new hard disk with fdisk, using the command fdisk /dev/hdb1. I then formatted the partition with the following command, mke2fs /dev/hdb1.
Why do you use ext2 as a file system. Why not at least ext3, or xfs, or reiserfs? (format with mkfs.ext3, mkfs.xfs or mkfs.reiserfs respectively)
What I want to know now, is how I go about mounting the drive? I want the second hard drive to act as extra space for my own documents, such as mp3's, photos, movie files etc.
Decide where you want your new drive to be accessed. For example /data or /usr/local/data or /mnt/data, or whatever. When you've decided, create the directory with "mkdir /data" (or whatever you decide on), then mount it with "mount /dev/hdb1 /data".
to make it mount automatically on boot, add a new line to /etc/fstab with something like
/dev/hdb1 /data ext2 defaults 1 2
Change ext2 to ext3, reiser or xfs if you decide to go with one of them instead (I highly recommend it) Thanks for the thorough response Anders. Could you please enlighten me as to which of the advised formats you think I should use and why? -- David
.~. / ^ \ /| |\ simply change .\ /. .^.
On Tuesday 09 November 2004 22:48, David James Pettifor wrote:
Thanks for the thorough response Anders. Could you please enlighten me as to which of the advised formats you think I should use and why?
I would use xfs if I were you, since you mentioned storing movies on it and xfs is widely held to be the best file system for large files. xfs is also my favourite file system for other reasons, it has a very good tool support If you do decide to go with xfs, make sure you've done an online update, as the original kernel in 9.1 had a bug that made it fail with xfs partitions. A fixed kernel was released shortly after 9.1 was released, so if you've already done one online update you should be fine now
On Tuesday 09 Nov 2004 20:58 pm, David James Pettifor wrote:
Hi,
I'm looking for some advice with regards using a second hard disk with SUSE Linux Professional 9.1. So far I have carried out the following. Logged in as root user and partitioned my new hard disk with fdisk, using the command fdisk /dev/hdb1. I then formatted the partition with the following command, mke2fs /dev/hdb1.
What I want to know now, is how I go about mounting the drive?
First, you need to decide where you want to mount it and create the mount point. I have my second drive mounted at /media/data so I'll assume that here. So, create the mount point: md /media/data then mount it 'manually' to make sure all is fine: mount -t ext2 /dev/hdb1 /media/data substitute ext3 for ext2 if you told mke2fs to create the journal. You can get info on the mount options by typing man mount in a terminal/console, or man:mount in konqueror. Now, just type: mount to see if it's mounted. You should see: /dev/hdb1 on /media/data type ext(2/3) (<some parameters>) along with other stuff. To be extra sure, type: df -h to have the machine tell you how much space is on each mounted fs. You should see something like: Filesystem Size Used Avail Use% Mounted on /dev/hda1 6.0G 966M 4.7G 17% / tmpfs 126M 8.0K 126M 1% /dev/shm /dev/hdc2 7.6G 881M 6.3G 13% /home /dev/hdg2 111G 36G 70G 34% /srv/nfs/data /dev/hdg1 40G 13G 25G 35% /srv/nfs/install with your new drive in the list. So far, so good. Now to make it mount on boot. Open /etc/fstab in your favourite text editor and add the line: /dev/hdb1 /media/data ext2 defaults 1 1 again, use ext3 is appropriate, and you can find out about the options in man mount. Next, unmount the fs with umount /dev/hdb1 use mount on its own to make sure it is unmounted, and make the machine mount it by reading /etc/fstab : mount -a use mount on its own again to make sure it has mounted. You will need to set the permissions on the mount point to your requirements while it is mounted. HTH Dylan
I want the second hard drive to act as extra space for my own documents, such as mp3's, photos, movie files etc.
Any advice, most appreciated. -- David
.~. / ^ \ /| |\ simply change .\ /. .^.
-- "I see your Schwartz is as big as mine" -Dark Helmet
On Tuesday 09 November 2004 21:39, Dylan wrote:
On Tuesday 09 Nov 2004 20:58 pm, David James Pettifor wrote:
Hi,
I'm looking for some advice with regards using a second hard disk with SUSE Linux Professional 9.1. So far I have carried out the following. Logged in as root user and partitioned my new hard disk with fdisk, using the command fdisk /dev/hdb1. I then formatted the partition with the following command, mke2fs /dev/hdb1.
What I want to know now, is how I go about mounting the drive?
First, you need to decide where you want to mount it and create the mount point. I have my second drive mounted at /media/data so I'll assume that here.
So, create the mount point:
md /media/data
then mount it 'manually' to make sure all is fine:
mount -t ext2 /dev/hdb1 /media/data
substitute ext3 for ext2 if you told mke2fs to create the journal. You can get info on the mount options by typing
man mount
in a terminal/console, or
man:mount
in konqueror. Now, just type:
mount
to see if it's mounted. You should see:
/dev/hdb1 on /media/data type ext(2/3) (<some parameters>)
along with other stuff. To be extra sure, type:
df -h
to have the machine tell you how much space is on each mounted fs. You should see something like:
Filesystem Size Used Avail Use% Mounted on /dev/hda1 6.0G 966M 4.7G 17% / tmpfs 126M 8.0K 126M 1% /dev/shm /dev/hdc2 7.6G 881M 6.3G 13% /home /dev/hdg2 111G 36G 70G 34% /srv/nfs/data /dev/hdg1 40G 13G 25G 35% /srv/nfs/install
with your new drive in the list.
So far, so good. Now to make it mount on boot. Open /etc/fstab in your favourite text editor and add the line:
/dev/hdb1 /media/data ext2 defaults 1 1
again, use ext3 is appropriate, and you can find out about the options in man mount. Next, unmount the fs with
umount /dev/hdb1
use mount on its own to make sure it is unmounted, and make the machine mount it by reading /etc/fstab :
mount -a
use mount on its own again to make sure it has mounted. You will need to set the permissions on the mount point to your requirements while it is mounted.
HTH
Dylan
I want the second hard drive to act as extra space for my own documents, such as mp3's, photos, movie files etc.
Any advice, most appreciated. -- David
.~. / ^ \ /| |\ simply change .\ /. .^.
-- "I see your Schwartz is as big as mine" -Dark Helmet Wow!
That sure did help! I have not tried anything out as yet but I sure will do with such thorough advice. One thing though, what does the following mean?
substitute ext3 for ext2 if you told mke2fs to create the journal. -- David
.~. / ^ \ /| |\ simply change .\ /. .^.
On Tuesday 09 Nov 2004 21:53 pm, David James Pettifor wrote:
On Tuesday 09 November 2004 21:39, Dylan wrote: <SNIP> Wow!
That sure did help! I have not tried anything out as yet but I sure will do with such thorough advice. One thing though, what does the following mean?
substitute ext3 for ext2 if you told mke2fs to create the journal.
This is relevant to the question you asked Anders too. ext2 and ext3 are very similar filesystems, basically, ext3 is the same as ext2 except that it has a 'journal.' That means that when you write to the fs, the data isn't (necessarily) updated straight away, and that a record of 'transactions' (i.e. writes) is kept. There are at least two main benefits to this - writes tend to be faster, especially if the same data is re-written before it is 'committed' to the disk; the status of the on-disk data can be checked quickly, and to a great extent re-constructed if necessary. That means there are less filesystem checks as boot (my ext3 partitions are checked fully every 40 days or so, whereas IIRC ext2 is checked each boot) and that in the event of a crash less data if any will get lost/corrupted. in man mke2fs it describes the options which allow you to add the journal information so it makes an ext3 fs instead. If you just used: mke2fs /dev/hdb1 then you will have an ext2 filesystem, mke2fs -j /dev/hdb1 would create an ext3 fs. You can turn an ext2 into an ext3 fs by adding a journal with: tune2fs -j /dev/hdb1 but since the fs is empty, if you wanted to change it you could just as well re-format it. As for which to use... you'll likely get as many opinions as people answering. I can't talk for xfs since I've never used it (Anders already covered that anyway) but my preference is for ext3 because it is 'native' to the kernel, and can be mounted and used as an ext2 fs for recovery by emergency boot floppies without worrying about whether they have modules for other fs's. It is well supported by maintenance tools and interacts seamlessly with the rest of the system. I've used reiser, but found the maintenance tools lacking, and had stability issues when using it with nfs (but these are supposed to have been resolved.) When it comes to it, unless there is pressing reason to use another fs, I'm going to stick with ext3. Dylan -- "I see your Schwartz is as big as mine" -Dark Helmet
On Tuesday 09 November 2004 21:58, David James Pettifor wrote:
Hi,
I'm looking for some advice with regards using a second hard disk with SUSE Linux Professional 9.1. So far I have carried out the following. Logged in as root user and partitioned my new hard disk with fdisk, using the command fdisk /dev/hdb1. I then formatted the partition with the following command, mke2fs /dev/hdb1.
What I want to know now, is how I go about mounting the drive? I want the second hard drive to act as extra space for my own documents, such as mp3's, photos, movie files etc.
Any advice, most appreciated. -- Since you did not mention the sizes of the drives, and mentioned the drive as "extra", you've already crossed out another possibility.
On the other hand you are asking newbie questions, so I'll mention this anyway... You can use the drive to store ALL of you personal files, freeing up the primary drive for other things... This is done by copying over the files currently in your home directory and then mounting the drive as your home directory. Then all user data will be stored on the "new" drive. If this sounds like a solution to you, then I'm sure many of the fine folks here will help you out... Jerry
David
.~. / ^ \ /| |\ simply change .\ /. .^.
On Tuesday 09 November 2004 23:05, Jerry Westrick wrote:
On Tuesday 09 November 2004 21:58, David James Pettifor wrote:
Hi,
I'm looking for some advice with regards using a second hard disk with SUSE Linux Professional 9.1. So far I have carried out the following. Logged in as root user and partitioned my new hard disk with fdisk, using the command fdisk /dev/hdb1. I then formatted the partition with the following command, mke2fs /dev/hdb1.
What I want to know now, is how I go about mounting the drive? I want the second hard drive to act as extra space for my own documents, such as mp3's, photos, movie files etc.
Any advice, most appreciated. --
Since you did not mention the sizes of the drives, and mentioned the drive as "extra", you've already crossed out another possibility.
I am intrigued. What is this possibility I have crossed out?
On the other hand you are asking newbie questions, so I'll mention this anyway...
You can use the drive to store ALL of you personal files, freeing up the primary drive for other things...
This is done by copying over the files currently in your home directory and then mounting the drive as your home directory. Then all user data will be stored on the "new" drive.
If this sounds like a solution to you, then I'm sure many of the fine folks here will help you out...
This does sound interesting. Could you give me a few pointers? -- David .~. / ^ \ /| |\ simply change .\ /. .^.
On Wednesday 10 November 2004 08:59, David James Pettifor wrote: <snip>
Since you did not mention the sizes of the drives, and mentioned the drive as "extra", you've already crossed out another possibility.
I am intrigued. What is this possibility I have crossed out?
On the other hand you are asking newbie questions, so I'll mention this anyway...
You can use the drive to store ALL of you personal files, freeing up the primary drive for other things...
This is done by copying over the files currently in your home directory and then mounting the drive as your home directory. Then all user data will be stored on the "new" drive.
If this sounds like a solution to you, then I'm sure many of the fine folks here will help you out...
This does sound interesting. Could you give me a few pointers? -- David
Okay, what we need to do here is to mount the new partition (drive) as /home. In order to do this we want the /home directory to be empty on the /root partition. And we want the current contents of the /home directory to be moved to the new partion. So we need to: - copy the files across - rename /home to /home_old - mount the new partition... But not necessarily in that order, but personally, I tend to leave the system in a stable state as long as possible so we'll do it that way.... So first we need to temporarily mount the new partition as example: (as root of course) $ mkdir /media/tmp $ mount -t <type> /dev/<xxx> /media/tmp Then we need to copy the /home directory structure to it: $ cp -a /home/* /media/tmp/ Then we need to unmount the new partition: $ umount /media/tmp Next we move the /home directory $ mv /home /home_old and last we mount the new partition as /home $ mkdir /home $ mount -t <type> /dev/<xxx> /home And that should do it for you... You can delete the old home as soon as you feel secure with the new setup... Jerry P.S. You need to add the new partition to the fstab so that it'll get mounted during the next boot...
On Wednesday 10 November 2004 02:59, David James Pettifor wrote:
On Tuesday 09 November 2004 23:05, Jerry Westrick wrote:
On Tuesday 09 November 2004 21:58, David James Pettifor wrote:
Hi,
I'm looking for some advice with regards using a second hard disk with SUSE Linux Professional 9.1. So far I have carried out the following. Logged in as root user and partitioned my new hard disk with fdisk, using the command fdisk /dev/hdb1.
This is either a typo or most likely your problem. The command should be "fdisk /dev/hdb". "hdb1" refers to the first partition on drive "b", not the drive itself. Jeff
On Wednesday 10 Nov 2004 07:59 am, David James Pettifor wrote:
On Tuesday 09 November 2004 23:05, Jerry Westrick wrote: <SNIP>
Since you did not mention the sizes of the drives, and mentioned the drive as "extra", you've already crossed out another possibility.
I am intrigued. What is this possibility I have crossed out?
He's alluding to the possibility of splitting the new drive into two partitions - one to act as the /home directory and one for data storage. The benefit of this is that if you need to re-install your system you will not need to touch either partition and so the process is less painful. Dylan-- "I see your Schwartz is as big as mine" -Dark Helmet
participants (5)
-
Anders Johansson
-
David James Pettifor
-
Dylan
-
Jeffrey Laramie
-
Jerry Westrick