Linux硬盘分区和挂载

一:分区

[root@server ~]# fdisk -l                         //查看没有分区和挂载的硬盘信息如下:

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          16      128488+  83  Linux
/dev/sda2              17          49      265072+  82  Linux swap / Solaris
/dev/sda3              50        2610    20571232+  83  Linux
Disk /dev/sdb: 2190.4 GB, 2190433320960 bytes
255 heads, 63 sectors/track, 266305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn’t contain a valid partition table

[root@server ~]# parted                         #进入parted模式  后可接参数要分的硬盘名称 parted      /dev/sdb 

GNU Parted 1.8.1
Using /dev/sda
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted)
select /dev/sdb              #选择磁盘sdb
Using /dev/sdb
(parted) mklabel gpt                  #将MBR磁盘格式化为GPT
(parted) mkpart primary 0 -1          #将整块磁盘分成一个分区
(parted) print    #    查看
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 2190GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number  Start  End    Size    File system  Name    Flags
1      17.4kB  2190GB  2190GB              primary
(parted) quit            #    退出

Information: Don’t forget to update /etc/fstab, if necessary.

二:挂载


猜你喜欢

转载自blog.csdn.net/guo_cw/article/details/80637212
今日推荐