分享
 
 
 

HOWTO add a second hard drive in Fedora Core system

王朝system·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

In this article, I would like to cover a basic HOWTO installing a second hard drive to expland your storage needs.

It's been about a year since I purchased my new Linux System and I feel my 80Gb internal hard drive is running out of space already. So I've decided to purchase a new 160Gb 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 in 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 use fdisk utility to partition the NEW hard drive. [root@localhost root]# fdisk /dev/hdb

The 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):

Type m to see the menu first. Command (m for help): m

Command 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):

Type p to print the current partition table. Command (m for help): p

Disk /dev/hdb: 160.0 GB, 160041885696 bytes

255 heads, 63 sectors/track, 19457 cylinders

Units = 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.

Type n to add new partition and p to choose primary partition Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Type 1 for first partition and press enter for first cylinder and enter again for last cylinder to accept the default. Partition number (1-4): 1

First cylinder (1-19457, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457):

Using default value 19457

Command (m for help):

Type p again to print current partition table.

Command (m for help): p

Disk /dev/hdb: 160.0 GB, 160041885696 bytes

255 heads, 63 sectors/track, 19457 cylinders

Units = 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 have Linux file system created in the partition table.

To save this new partition table, type w. Command (m for help): w

The 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 use mkfs.ext3 utility to format the partition as EXT3 file system which is EXT2 file system with journaling capabilities.

Also let's label the partition as /home2 [root@localhost root]# mkfs.ext3 -L /home2 /dev/hdb1

mke2fs 1.34 (25-Jul-2003)

Filesystem label=/home2

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

19546112 inodes, 39072080 blocks

1953604 blocks (5.00%) reserved for the super user

First data block=0

1193 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done

Creating journal (8192 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 23 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

[root@localhost root]#

In order to mount new partition labeled /home2 automatically during the reboot, type following line in red in the /etc/fstab file [root@localhost root]# vi /etc/fstab

LABEL=/ / ext3 defaults 1 1

LABEL=/boot /boot ext3 defaults 1 2

LABEL=/home2 /home2 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/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, 1 in the fifth field is used to determine if this filesystem will be backed up by the dump command and 2 in the sixth field is used to determine if this filesystem will be checked by the fsck program at the reboot time. Normally 1 is used for root filesystem (/) and 2 is 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 -h

Filesystem 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% /home2

none 252M 0 252M 0% /dev/shm

[root@localhost root]#

Congratulation, you've added the second hard drive in your Fedora Core system successfully!

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有