Howto add a second hard drive in Fedora Core System

Source: Internet
Author: User

In this article, I wowould like to cover a basic howto installing a second hard drive to explain and your storage needs.

It's been about a year since I purchased my new Linux system and I feel my 80 GB internal hard drive is running out of space already. so I 've decided to purchase a new 160 GB internal hard drive and install it as a second hard drive. but how do I Format and mount the second hard drive in existing Fedora Core System? Let's look at the process step by stop.

Reference: Http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/admin-primer/s1-storage-rhlspec.html

First, install the new hard drive as a slave drive. you might need to remove a jumper from the drvie to make it a slave drive. also make sure to plug black color connector to your old drive which indicates it's a master drive and plug gray color connector to your new hard drive which indicates it's a slave drive. see the Installation Guide comes with the hard drive for more information.

Don't forget to plugin 4-pin power connector on both hard drives and power on the computer.

Check the BIOS to make sure your computer detects both drives.

Now, before you format the new hard drive, you need to partition it as a Linux File System. Let's useFdiskUtility to partition the new hard drive.

[root@localhost root]# fdisk /dev/hdbThe number of cylinders for this disk is set to 19457.There is nothing wrong with that, but this is larger than 1024,and could in certain setups cause problems with:1) software that runs at boot time (e.g., old versions of LILO)2) booting and partitioning software from other OSs   (e.g., DOS FDISK, OS/2 FDISK)Command (m for help):

TypeMTo see the menu first.

Command (m for help): mCommand action   a   toggle a bootable flag   b   edit bsd disklabel   c   toggle the dos compatibility flag   d   delete a partition   l   list known partition types   m   print this menu   n   add a new partition   o   create a new empty DOS partition table   p   print the partition table   q   quit without saving changes   s   create a new empty Sun disklabel   t   change a partition's system id   u   change display/entry units   v   verify the partition table   w   write table to disk and exit   x   extra functionality (experts only) Command (m for help):

TypePTo print the current partition table.

Command (m for help): p Disk /dev/hdb: 160.0 GB, 160041885696 bytes255 heads, 63 sectors/track, 19457 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes    Device Boot    Start       End    Blocks   Id  System Command (m for help):

Notice it has an empty partition table since it's a brand new hard drive.

TypeNTo add new partition andPTo choose primary Partition

Command (m for help): nCommand action   e   extended   p   primary partition (1-4)p

Type1For first partition and pressEnterFor first cylinder andEnterAgain for last cylinder to accept the default.

Partition number (1-4): 1First cylinder (1-19457, default 1):Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457):Using default value 19457 Command (m for help):

TypePAgain to print current partition table.

Command (m for help): p Disk /dev/hdb: 160.0 GB, 160041885696 bytes255 heads, 63 sectors/track, 19457 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes    Device Boot    Start       End    Blocks   Id  System/dev/hdb1             1     19457 156288321   83  Linux Command (m for help):

Notice, now we haveLinuxFile System created in the partition table.

To save this new partition table, TypeW.

Command (m for help): wThe partition table has been altered! Calling ioctl() to re-read partition table.Syncing disks.[root@localhost root]#

Notice, you have also exited from fdisk utility.

Now that you have created LINUX partition, it's time to format the partition on the hard drive.

Let's useMkfs. ext3Utility to format the partition as ext3 file system which is ext2 File System with journaling capabilities.

Also let's label the partition/Home2

[root@localhost root]# mkfs.ext3 -L /home2 /dev/hdb1mke2fs 1.34 (25-Jul-2003)Filesystem label=/home2OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)19546112 inodes, 39072080 blocks1953604 blocks (5.00%) reserved for the super userFirst data block=01193 block groups32768 blocks per group, 32768 fragments per group16384 inodes per groupSuperblock backups stored on blocks:        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,        4096000, 7962624, 11239424, 20480000, 23887872Writing inode tables: doneCreating journal (8192 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 23 mounts or180 days, whichever comes first.  Use tune2fs -c or -i to override.[root@localhost root]#

In order to mount New partition labeled/Home2Automatically during the reboot, type following line in red in the/etc/fstab file

[root@localhost root]# vi /etc/fstabLABEL=/                 /                       ext3    defaults        1 1LABEL=/boot             /boot                   ext3    defaults        1 2LABEL=/home2            /home2                  ext3    defaults        1 2none                    /dev/pts                devpts  gid=5,mode=620  0 0none                    /proc                   proc    defaults        0 0none                    /dev/shm                tmpfs   defaults        0 0/dev/hda6               swap                    swap    defaults        0 0/dev/cdrom              /mnt/cdrom              udf,iso9660 noauto,owner,kudzu,ro 0 0/dev/cdrom1             /mnt/cdrom1             udf,iso9660 noauto,owner,kudzu,ro 0 0/dev/dvd                /mnt/dvd                udf,iso9660 noauto,owner,kudzu,ro 0 0/dev/dvd1               /mnt/dvd1               udf,iso9660 noauto,owner,kudzu,ro 0 0/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0/dev/sda1               /mnt/sda                auto    noauto,owner,users 0 0/dev/sdb1               /mnt/sdb                auto    noauto,owner,users 0 0/dev/sdc1               /mnt/sdc                auto    noauto,owner,users 0 0

BTW,1In the specified th field is used to determine if this filesystem will be backed up byDumpCommand and2In the sixth field is used to determine if this filesystem will be checked byFsckProgram at the reboot time. Normally1Is used for root filesystem (/) and2Is used for non-root file system (/home2 ).

It's almost done but before you reboot the system. Make sure to create a directory "/home2" as a mount point.

[root@localhost root]# mkdir /home2[root@localhost root]#

Now, it's done! Reboot the system and see if the partition on the new hard drive has been mounted.

[root@localhost root]# df -hFilesystem            Size  Used Avail Use% Mounted on/dev/hda5              70G   57G  9.7G  86% //dev/hda3              99M   55M   40M  59% /boot/dev/hdb1             147G   33M  140G   1% /home2none                  252M     0  252M   0% /dev/shm[root@localhost root]#

Congratulation, you 've added the second hard drive in your fedora core system successfully!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.