




全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
如何为Linux操作系统添加硬盘Linux学习 2010-06-11 10:26:25 阅读71 评论0 字号:大中小订阅 如果你安装完Linux后,用过一段时间,觉得硬盘不够用了,要加装一块新硬盘,该怎么办呢?笔者以自己添加一个SCSI硬盘为例。 1.首先进行RAID设置; 2.进入linux系统,fdisk,mke2fs命令。 fdisk命令详解如下图:新安装的硬盘没有任何分区,我得操作如下:(1).fdisk /dev/sdc /输入fdisk命令,格式化第三个SCSI硬盘,原有2块。Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel. Changes will remain in memory only,until you decide to write them. After that, of course, the previouscontent wont be recoverable.The number of cylinders for this disk is set to 121534.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)Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)(2).Command (m for help): n /输入n,创建一个新的分区Command action e extended p primary partition (1-4)p /选择p,并输入1,创建sdc1分区Partition number (1-4): 1First cylinder (1-121534, default 1): /输入该分区开始扇区Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-121534, default 121534): 40178 / /输入该分区结束扇区(3).重复(2)依次创建sdc2,sdc3Command (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 2First cylinder (40179-121534, default 40179): Using default value 40179Last cylinder or +size or +sizeM or +sizeK (40179-121534, default 121534): 80356Command (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 3First cylinder (80357-121534, default 80357): Using default value 80357Last cylinder or +size or +sizeM or +sizeK (80357-121534, default 121534): Using default value 121534(4)Command (m for help): p /显示分区情况Disk /dev/sdc: 999.6 GB, 999653638144 bytes255 heads, 63 sectors/track, 121534 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sdc1 1 40178 322729753+ 83 Linux/dev/sdc2 40179 80356 322729785 83 Linux/dev/sdc3 80357 121534 330762285 83 Linux(5).Command (m for help): w /将分区情况写入磁盘,即保存分区信息The partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.(6).依次格式化三个分区mke2fs /dev/sdc1 (格式化为ext2格式)(mke2fs -j /dev/sdc1 (格式化为ext2格式),mkfs.ext3 格式化为ext3格式 mkfs -t ext3 )tune2fs -j * 将ext2转换成ext3df -T 查看时ext2格式还是ext3可以参考:/main/?q=node/83mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)40353792 inodes, 80682438 blocks4034121 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=42949672962463 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, 23887872, 71663616, 78675968Writing inode tables: done Writing 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.*mke2fs /dev/sdc2mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)40353792 inodes, 80682446 blocks4034122 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=42949672962463 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, 23887872, 71663616, 78675968Writing inode tables: done Writing superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 38 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.*mke2fs /dev/sdc3mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)41353216 inodes, 82690571 blocks4134528 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=42949672962524 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, 23887872, 71663616, 78675968Writing inode tables: done Writing superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 33 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.再用 df -h 命令查看下系统下所有分区情况,结果发现没有刚建立的分区,用 fdisk -l 或者 cat /proc/partitions 命令查看硬盘详细信息,发现有刚分区信息。WHy? 稍加思考下linux和window
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
评论
0/150
提交评论