• Linux parted命令详解


    parted常见命令参数

    Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]
    Apply COMMANDs with PARAMETERS to DEVICE.  If no COMMAND(s) are given, run in
    interactive mode.
    
    选项:
      -h, --help                      显示此求助信息
      -l, --list                      lists partition layout on all block devices
      -m, --machine                   displays machine parseable output
      -s, --script                    从不提示用户
      -v, --version                   显示版本
      -a, --align=[none|cyl|min|opt]  alignment for new partitions
    
    命令:
      align-check TYPE N                        check partition N for TYPE(min|opt)
            alignment
      check NUMBER                             do a simple check on the file system
      cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER   copy file system to another partition
      help [COMMAND]                           print general help, or help on
            COMMAND
      mklabel,mktable LABEL-TYPE               create a new disklabel (partition
            table)
      mkfs NUMBER FS-TYPE                      make a FS-TYPE file system on
            partition NUMBER
      mkpart PART-TYPE [FS-TYPE] START END     make a partition
      mkpartfs PART-TYPE FS-TYPE START END     make a partition with a file system
      move NUMBER START END                    move partition NUMBER
      name NUMBER NAME                         name partition NUMBER as NAME
      print [devices|free|list,all|NUMBER]     display the partition table,
            available devices, free space, all found partitions, or a particular
            partition
      quit                                     exit program
      rescue START END                         rescue a lost partition near START
            and END
      resize NUMBER START END                  resize partition NUMBER and its file
            system
      rm NUMBER                                delete partition NUMBER
      select DEVICE                            choose the device to edit
      set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
      toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition
            NUMBER
      unit UNIT                                set the default unit to UNIT
      version                                  display the version number and
            copyright information of GNU Parted
    

    parted常见命令展示

    .parted分区(pgt分区)     -->即时生效,创建了以后就直接产生,可以非交互是的创建
            --> 大于2T,且使用gpt(全局唯一标示磁盘分区表格式)的分区表
            --> MBR 的最大可循地址为2T
        1.  交互式:
            1.parted /dev/sdb mklabel gpt  -->更改分区表
                 -->help写出帮助
                mkpart primary 0 10         -->0-10M 主分区
                rm 2                        -->删除,
            2.将修改后的内容告诉内核,否则需要重启
                partprobe /dev/sdb
            3.查看
                ll /dev/sd*
                ==>fdick -l 
     
        2.  非交互是的创建
            1.创建
                  parted /dev/sdb mklabel gpt yes
                parted /dev/sdb mklabel primary ext4 0 100 ignore
                parted /dev/sdb mklabel logic ext4 0 100 ignore
            2.将修改后的内容告诉内核,否则需要重启
                    partprobe /dev/sdb
                3.查看
                    ll /dev/sd*
                    ==>fdick –l

    * 磁盘划分结束后需要制作文件系统,例如 ext4

    【更多参考】https://www.cnblogs.com/ftl1012/p/9280862.html

  • 相关阅读:
    SQL Server查询死锁并KILL
    android之Widget01
    android之RatingBar控件用法
    android之SeekBar控件用法
    android之ExpandableListActivity
    【原创】开源.NET排列组合组件KwCombinatorics使用(一)—组合生成
    【吐槽】博客园新的原创文章在搜索引擎的排名不及转载的站点
    【资源】108个大数据文档PDF开放下载-整理后打包下载
    【原创】.NET平台机器学习组件-Infer.NET连载(二)贝叶斯分类器
    【原创】.NET平台机器学习组件-Infer.NET连载(一)介绍
  • 原文地址:https://www.cnblogs.com/ftl1012/p/parted.html
Copyright © 2020-2023  润新知