码迷,mamicode.com
首页 > 系统相关 > 详细

linux磁盘分区

时间:2018-01-26 10:56:03      阅读:246      评论:0      收藏:0      [点我收藏+]

标签:ext4   rtu   disk   --   磁盘格式   帮助   格式   ##   type   

1、 parted 磁盘分区
1)查看新加磁盘
[root@Tim ~]# ll /dev/sd
[root@Tim ~]# ll /dev/sd
brw-rw---- 1 root disk 8, 0 Jan 25 21:18 /dev/sda
brw-rw---- 1 root disk 8, 1 Jan 25 21:18 /dev/sda1
brw-rw---- 1 root disk 8, 2 Jan 25 21:18 /dev/sda2
brw-rw---- 1 root disk 8, 16 Jan 25 21:33 /dev/sdb
2)磁盘分区 输入h查看parted 命令帮助
[root@Tim ~]# parted /dev/sdb
GNU Parted 2.1
Using /dev/sdb
Welcome to GNU Parted! Type ‘help‘ to view a list of
commands.
(parted) mklabel gpt Yes ##转换磁盘格式
(parted) mkpart primary 0 100 ##磁盘分区
(parted) p ##查看磁盘分区情况
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 100MB 100MB primary

             (parted) mkpart primary 101 201

                 (parted) mkpart logical ext4 202 302

             (parted) p     
     Model: VMware, VMware Virtual S (scsi)
     Disk /dev/sdb: 1074MB
     Sector size (logical/physical): 512B/512B
     Partition Table: gpt
     Number  Start   End    Size    File system  Name     Flags
        1      17.4kB  100MB  100MB                primary
        2      101MB   201MB  101MB                primary
        3      202MB   302MB  99.6MB               logical
                (parted) rm 3  ##删除分区3

                ###命令批量执行创建分区###

            [root@Tim ~]# parted /dev/sdb mklabel gpt Yes
    parted /dev/sdb mkpart primary 0 10 Ignore 
    parted /dev/sdb mkpart primary linux-swap 11 21 Ignore
    parted /dev/sdb mkpart logical ext4 22 32 Ignore
    parted /dev/sdb p

linux磁盘分区

标签:ext4   rtu   disk   --   磁盘格式   帮助   格式   ##   type   

原文地址:http://blog.51cto.com/13480211/2065293

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!