centos 5.3下fdisk分区、格式化、挂载新硬盘.doc

上传人:大米 文档编号:543469065 上传时间:2023-03-29 格式:DOC 页数:3 大小:36.01KB
返回 下载 相关 举报
centos 5.3下fdisk分区、格式化、挂载新硬盘.doc_第1页
第1页 / 共3页
centos 5.3下fdisk分区、格式化、挂载新硬盘.doc_第2页
第2页 / 共3页
centos 5.3下fdisk分区、格式化、挂载新硬盘.doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

《centos 5.3下fdisk分区、格式化、挂载新硬盘.doc》由会员分享,可在线阅读,更多相关《centos 5.3下fdisk分区、格式化、挂载新硬盘.doc(3页珍藏版)》请在金锄头文库上搜索。

1、公司内网的服务器硬盘空间不足,将新买来的150G硬盘挂载并设置成samba的共享目录,关于samba请参考此文章http:/ 1、# fdisk -l 查看当前磁盘信息,就会发现最下面显示新加入的硬盘不是有效分区,如下:Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes255 heads, 63 sectors/track, 182401 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDisk /dev/sdc doesnt contain a valid partition table

2、2、# fdisk /dev/sdc 对新硬盘分区,并根据提示进一步操作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 cylinder

3、s for this disk is set to 182401.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: inv

4、alid flag 0x0000 of partition table 4 will be corrected by w(rite)Command (m for help): h 输入h可查看帮助命令h: unknown commandCommand 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 parti

5、tion 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 partitions system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only)Comm

6、and (m for help): n 输入n进行分区Command action e extended p primary partition (1-4)p 输入p为主分区,e为逻辑分区Partition number (1-4): 1 由于是新盘我们输入1来分第一个主分区,共可以分4个主分区First cylinder (1-182401, default 1): 选择该分区的起始磁盘数,如无特殊需求强烈建议选择默认,也就是1来分区(直接按回车)Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-182401

7、, default 182401): 定义该分区的大小,如果按默认(按回车)即是使用全部可用存储额,如分一个1G的空间,输入+1024mUsing default value 182401Command (m for help): w 写入分区The partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.3、# fdisk -l 可以找到我们刚才分的一个分区,内容如下:Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes255 he

8、ads, 63 sectors/track, 182401 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sdc1 1 182401 1465136001 83 Linux4、# mkfs -t ext3 -c /dev/sdc1 对分区使用ext3格式化,如多个分区sdc2等以此类推,因为新硬盘加了-c参数要先检测磁盘坏道,此过程万分漫长(150G),等待。mke2fs 1.39 (29-May-2006)Filesystem label

9、=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)183156736 inodes, 366284000 blocks18314200 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=011179 block groups32768 blocks per group, 32768 fragments per group16384 inodes per groupSuperblock backup

10、s stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848Checking for bad blocks (read-only test): doneWriting inode tables: doneCreating journal (32768 blocks): doneWriting sup

11、erblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 22 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.5、# mkdir /var/samba 新建挂载目录6、# mount /dev/sdc1 /var/samba 挂载新硬盘7、# df -hl 查看分区大小是否和我们预定的一样:文件系统 容量 已用 可用 已用% 挂载点/dev/s

12、da7 9.5G 3.2G 5.9G 35% /dev/sda6 9.5G 151M 8.9G 2% /tmp/dev/sda5 19G 3.6G 15G 20% /usr/dev/sda3 19G 719M 18G 4% /home/dev/sda2 230G 23G 196G 11% /var/dev/sda1 99M 25M 69M 27% /boot/dev/sdb1 233G 156G 78G 67% /var/samba2tmpfs 1008M 0 1008M 0% /dev/shm/dev/sdc1 1.4T 198M 1.3T 1% /var/samba 此行为新硬盘8、# vi /etc/fstab 设置系统自动挂载硬盘,加入一行:/dev/sdc1 /var/samba2 ext3 defaults 0 09、重启服务器,用步骤7检查一下,一切正常挂载完成,祝好运

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号