ddxiami

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2809|回复: 0

[其它] fdisk操作文档

[复制链接]
发表于 2013-5-27 01:09:02 | 显示全部楼层 |阅读模式
参考网址:http://hi.baidu.com/visual_art/item/aef372c260b7a0360831c616

fdisk -l 查看系统上的硬盘,找到需要分区的硬盘后比如说:/dev/sdb.
然后,fdisk /dev/sdb
进入该设备。此时出现:
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 注:l是列出分区类型,以供我们设置相应分区的类型;
    m    print this menu 注:m 是列出帮助信息;
    n    add a new partition 注:添加一个分区;
    o    create a new empty DOS partition table
    p    print the partition table 注:p列出分区表;
    q    quit without saving changes 注:不保存退出;
    s    create a new empty Sun disklabel     
    t    change a partition's system id 注:t 改变分区类型;
    u    change display/entry units
    v    verify the partition table
    w    write table to disk and exit 注:把分区表写入硬盘并退出;
    x    extra functionality (experts only) 注:扩展应用,专家功能;

========================================================================
##阿里云磁盘分区操作实例
#格式化生产环境的存储盘
fdisk /dev/xvdb
#根据提示,依次输入“n”,“p”“1”,两次回车,“wq”
#格式化新分区
mkfs.ext4 /dev/xvdb1
#设置挂载分区开机启动
echo '/dev/xvdb1  /data ext4    defaults    0  0' >> /etc/fstab
#手动挂载分区
mount -t ext4 /dev/xvdb1  /data
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|技术文档库 ( 闽ICP备15017263号-2 )|网站地图

GMT+8, 2025-5-18 20:41 , Processed in 0.034347 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表