查看“InstallingANewHardDrive”的源代码
来自Ubuntu中文
←
InstallingANewHardDrive
跳到导航
跳到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 安装新硬盘 == 原文出处:官方WIKI 原文作者: 授权许可: * [http://creativecommons.org/licenses/by-sa/2.0/ 创作共用协议Attribution-ShareAlike 2.0] * [http://www.gnu.org/copyleft/fdl.html GNU自由文档许可证] 翻译人员:sanebaby 校正人员:purewind 贡献人员: 适用版本: 文章状态:[[翻译完成]] ---- === Introduction(说明) === This howto explains how to configure Ubuntu so that an additional hard disk is accessible. We assume that the hard drive is physically mounted and detected by the BIOS.<br>本文将说明在添加了新的磁盘后如何配置Ubuntu使其可以访问。我们假定磁盘已经被物理安装,且已经被BIOS检测到。 Understanding basic command line usage is needed for this.<br> 这里需要了解基本的命令行的用法。 === Find drive info(找到硬盘信息) === To find out what the system sees as the drive letter/number:<br>找出系统标示的磁盘的 盘符/编号: <pre><nowiki> sudo lshw -C disk </nowiki></pre> attachment:IconsPage/IconExample48.png Here is sample output:<br> 这有一个输出样本: <pre><nowiki> **-disk description: ATA Disk product: IC25N040ATCS04-0 vendor: Hitachi physical id: 0 bus info: ide@0.0 logical name: /dev/hda version: CA4OA71A serial: CSH405DCLSHK6B size: 37GB capacity: 37GB </nowiki></pre> === Set up drive(设置硬盘) === Skip to "Set mount point" if the drive already has data on it. Otherwise, you need to decide if you want to make one big partition on the drive or several smaller ones. You would use fdisk to accomplish this. For illustration I'll use /dev/hdd1:<br> 如果你的磁盘上已经有数据存在,请跳至"Set mount point"(设定加载点) 。否则您需要决定把该硬盘作为一个大分区使用还是分为几个小的分区。您将用 fdisk 来完成这项工作。例如我将使用/dev/hdd1; <pre><nowiki> sudo fdisk /dev/hdd </nowiki></pre> The number of cylinders for this disk is set to 77557. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with:<br> 这个磁盘的柱面数为77557。这没有任何错误,但是大于1024可能会在一些特定的设置中引起问题: *** software that runs at boot time (e.g., old versions of LILO)<br>启动过程中运行的软件(如:老版本的LILO) *** booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)<br>其它操作系统中的引导和分区软件(如:DOS FDISK,OS/2 FDISK) <pre><nowiki> Command (m for help): m <enter> 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):n <enter> Command action e extended p primary partition (1-4) p <enter> Partition number (1-4): 1 <enter> Command (m for help):w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. user@myubuntubox:~ $ </nowiki></pre> === Format disk(格式化磁盘) === Then you format the disc like this (I'll make it an ext3 partition)<br> 您可以像这样格式化磁盘(我将磁盘格式化为ext3格式) <pre><nowiki> sudo mke2fs -j /dev/hdd1 mke2fs 1.35 (28-Feb-2004) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 4889248 inodes, 9772174 blocks 488608 blocks (5.00%) reserved for the super user First data block=0 299 block groups 32768 blocks per group, 32768 fragments per group 16352 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624 Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 27 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. user@myubuntubox:~ $ </nowiki></pre> === Modify reserved space (optional)(修改保留空间-可选) === When formatting the drive, 5% of the drive space is reserved for the super user so that the operating system can still write to the disk even if it is full. However, for disks that only contains data this is not necessary. You can ajust the percentage of reserved space with the "tune2fs" command, like this:<br> 当您格式化磁盘时,为了保证操作系统在磁盘己满的情况下仍能写入数据,5%的磁盘空间将保留给管理员。然而,对于只用来存放数据的磁盘并不需要。您可以用“tune2fs”命令调整保留空间的百分比,像这样:<br> <pre><nowiki> sudo tune2fs -m 1 /dev/hdd1 </nowiki></pre> This example reserves 1% of space - change this number if you want.<br> 上面的例子保留了1%的空间--如果需要您可以修改此数字。 {i} Using this command does not change any existing data on the drive. You can use it on a drive which already contains data.<br> {i} 使用这条命令不会影响磁盘上的数据。您可以在任何含有数据的磁盘上使用该命令。 === Set mount point(设定挂载点) === Next make your mount point:<br> 接下来设定您的挂载点: <pre><nowiki> sudo mkdir /backup </nowiki></pre> and mount it:<br> 挂载: <pre><nowiki> sudo mount /dev/hdd1 /backup </nowiki></pre> === Set to mount at boot(设定为启动挂载) === Next add an entry in /etc/fstab using existing entries as a guide and you can then mount and/or unmount your new drive as you see fit by using the command:<br>接下来添加一条内容到 /etc/fstab ,用已存在的内容作为参照。现在您可以使用如下命令来挂载或缷载您的新磁盘: <pre><nowiki> sudo mount /backup </nowiki></pre> {i} A good guide to fstab can be found [http://www.tuxfiles.org/linuxhelp/fstab.html here]<br> {i} [http://www.tuxfiles.org/linuxhelp/fstab.html 这里]有一个针对fstab的好指南。 To unmount the drive: <br> 缷载磁盘 <pre><nowiki> sudo umount /backup <enter> </nowiki></pre> That's it :)<br> 好了 :) === Need help?(需要帮助? ) === attachment:IconsPage/IconHelp.png If you run into problems or need more help; search here in the wiki or go to http://ubuntuforums.org and ask for help.<br> 如果您在运行过程中遇到了问题或需要更多的帮助,请在wiki中搜索或到 http://ubuntuforums.org 寻求帮助。
返回
InstallingANewHardDrive
。
导航菜单
页面操作
页面
讨论
阅读
查看源代码
历史
页面操作
页面
讨论
更多
工具
个人工具
登录
导航
首页
最近更改
随机页面
页面分类
帮助
搜索
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息