Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
06-27-2005, 03:25 PM
|
#1
|
|
LQ Newbie
Registered: Mar 2004
Location: NC
Distribution: RHEL3 (WS), Update 3
Posts: 16
Rep:
|
How to add a hard drive existing Linux system
Friends, I have an existing Red Hat 9.0 (2.4.20-8) system running that I have added RAM and a CD-ROM drive to with no problems.
I've now added an additional 40GB hard drive to the system, and I would like to add it logically so my partitions have more space available. I have no idea how to do this! I have the drive physically connected, and the system sees it as /dev/hdb.
Currently, my system shows:
Code:
---------------------------------------------------------------------------
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 27G 2.6G 23G 11% /
/dev/hda1 99M 14M 80M 15% /boot
none 314M 0 314M 0% /dev/shm
---------------------------------------------------------------------------
# cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda3 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
---------------------------------------------------------------------------
# fdisk -l
Disk /dev/hda: 30.0 GB, 30020272128 bytes
255 heads, 63 sectors/track, 3649 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 3552 28427017+ 83 Linux
/dev/hda3 3553 3649 779152+ 82 Linux swap
Disk /dev/hdb: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 1 4865 39078081 83 Linux
---------------------------------------------------------------------------
So, I have successfully added the disk and deleted the NTFS partition table using fdisk. What do I do now???
|
|
|
|
06-27-2005, 04:00 PM
|
#2
|
|
Senior Member
Registered: May 2005
Location: boston, usa
Distribution: fc-12/ fc-11-live-usb/ aix
Posts: 2,733
|
it didn't come up in your df -h list because it is not listed in your fstab. fdisk lists it. so to mount it you can do a:
mount -t ext2 /dev/hdb1 /mnt/hd2
forgive me, i didn't test it out. you may not need to specify the type (-t ext2) or it may just be wrong. (man mount for acceptable arguements).
when you get it working on the command line, add it your fstab to automagically mount it on start-up.
~schneidz
|
|
|
|
06-27-2005, 07:00 PM
|
#3
|
|
LQ Newbie
Registered: Mar 2004
Location: NC
Distribution: RHEL3 (WS), Update 3
Posts: 16
Original Poster
Rep:
|
Thanks for the help; still having trouble
Thanks for the tip -- what you stated makes perfect sense. I'm not sure if I'm doing something wrong or not, but when I run the command below as root (where <mount point> is various things like /var2, /temp2, etc. on the filesystem):
Code:
# mount -t ext2 /dev/hda3 <mount point>
I get an error that says
Code:
mount: mount point <mount point> does not exist
. Does this mean that the place I'm mounting the disk must exist first? I've tried touching a file (for example, /var2) but that doesn't seem to work either.
|
|
|
|
06-27-2005, 07:18 PM
|
#4
|
|
Member
Registered: Feb 2004
Location: Southern Maine, United States
Distribution: Slackware Ubuntu Debian FreeBSD
Posts: 418
Rep:
|
it has to be a directory.
and it doesn't seem that you've formatted a filesystem on it yet, if you haven't then you'll run into that error after you fix the mount-point problem.
use mkfs to do so. (mkfs.ext2 or mkfs.ext3, as you may prefer)
|
|
|
|
06-27-2005, 07:26 PM
|
#5
|
|
LQ Newbie
Registered: Mar 2004
Location: NC
Distribution: RHEL3 (WS), Update 3
Posts: 16
Original Poster
Rep:
|
DaWallace, that was the ticket! I used mkfs to format the disk first, as in:
Then, I created a new directory to use as the mount point:
Next, I mounted the newly formatted partition (which happened to be the whole hdb device, in my case):
Code:
mount /dev/hdb /var2
I simply wrote out these steps in case it might help somebody else that comes along. I have one final question; what entries should I place in /etc/fstab to ensure that my new directory gets mounted each boot time? I'm a little confused about that.
My current /etc/fstab includes:
Code:
# cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda3 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
Thanks!
|
|
|
|
06-28-2005, 02:20 PM
|
#6
|
|
Senior Member
Registered: May 2005
Location: boston, usa
Distribution: fc-12/ fc-11-live-usb/ aix
Posts: 2,733
|
there is a man-page for fstab so you can get info on all feilds there. (make sure it's not the fstab.h man-page)
i don't think you can go wrong by copying/ modifying the line for the root partition. in that case it would be:
# source destination file-system parameters dump fsck-order
/hdb1 /var2 ext3 defaults 1 1
good luck
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:47 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|