[转帖]Linux系统NVME盘分区和挂载

linux,系统,nvme,分区,挂载 · 浏览次数 : 0

小编点评

HWE52P432T0L002N (nvme)Disk /dev/nvme0n1: 2000GBSector size (logical/physical): 512B/512BPartition Table: gptDisk Flags:Number Start End Size File system Name Flags(parted) mkpart primary 0 2000GBWarning: The resulting partition is not properly aligned for best performance.Ignore/Cancel? Ignore(parted) printModel: HWE52P432T0L002N (nvme)Disk /dev/nvme0n1: 2000GBSector size (logical/physical): 512B/512BPartition Table: gptDisk Flags:Number Start End Size File system Name Flags 1 17.4kB 2000GB 2000GB primary(parted) quitInformation: You may need to update /etc/fstab.写入分区类型$ sudo mkfs.ext4 /dev/nvme0n1mke2fs 1.44.1 (24-Mar-2018)Found a gpt partition table in /dev/nvme0n1Proceed anyway? (y,N) yDiscarding device blocks: doneCreating filesystem with 488378646 4k blocks and 122101760 inodesFilesystem UUID: 60b94695-8f59-4b28-9d6c-c2fcb177f7faSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848Allocating group tables: doneWriting inode tables: doneCreating journal (262144 blocks): doneWriting superblocks and filesystem accounting information: done查看$ lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 892.2G 0 disk├─sda1 8:1 0 512M 0 part /boot/efi├─sda2 8:2 0 1G 0 part /boot└─sda3 8:3 0 890.7G 0 part └─ubuntu--vg-ubuntu--lv 253:0 0 200G 0 lvm /nvme0n1 259:0 0 1.8T 0 disknvme1n1 259:1 0 1.8T 0 disk├─nvme1n1p1 259:2 0 512M 0 part└─nvme1n1p2 259:3 0 1.8T 0 part挂载$ sudo mount /dev/nvme0n1 /apps/$ df -

正文

https://www.jianshu.com/p/04327f1b97cb

 

查看系统里面识别到的硬盘和分区的信息

$ sudo fdisk -l
Disk /dev/nvme1n1: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: FA514C81-E2C5-4A87-B1D4-1F5F1EF56607

Device           Start        End    Sectors  Size Type
/dev/nvme1n1p1    2048    1050623    1048576  512M EFI System
/dev/nvme1n1p2 1050624 3907028991 3905978368  1.8T Linux filesystem


Disk /dev/nvme0n1: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: E62B9CAF-036D-49B9-80E8-9D4F537D1852

Device             Start        End    Sectors   Size Type
/dev/nvme0n1p1        64     204863     204800   100M EFI System
/dev/nvme0n1p2    206848     208895       2048     1M Linux filesystem
/dev/nvme0n1p3   8595456    8597503       2048     1M Linux filesystem
/dev/nvme0n1p5    208896    8595455    8386560     4G Microsoft basic data
/dev/nvme0n1p6   8597504   16984063    8386560     4G Microsoft basic data
/dev/nvme0n1p7  16986112  268435455  251449344 119.9G unknown
/dev/nvme0n1p8 268437504 3907029134 3638591631   1.7T unknown

Partition table entries are not in disk order.


Disk /dev/sda: 892.2 GiB, 957997907968 bytes, 1871089664 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disklabel type: gpt
Disk identifier: B3B492D9-7CC4-428A-9CE3-036643661A8F

Device       Start        End    Sectors   Size Type
/dev/sda1     2048    1050623    1048576   512M EFI System
/dev/sda2  1050624    3147775    2097152     1G Linux filesystem
/dev/sda3  3147776 1871087615 1867939840 890.7G Linux filesystem


Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 200 GiB, 214748364800 bytes, 419430400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes

格式化硬盘

$ sudo parted /dev/nvme0n1
GNU Parted 3.2
Using /dev/nvme0n1
Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) mklabel gpt
Warning: The existing disk label on /dev/nvme0n1 will be destroyed and all data on this
disk will be lost. Do you want to continue?
Yes/No? yes
(parted) print
Model: HWE52P432T0L002N (nvme)
Disk /dev/nvme0n1: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart primary 0 2000GB
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Ignore
(parted) print
Model: HWE52P432T0L002N (nvme)
Disk /dev/nvme0n1: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
 1      17.4kB  2000GB  2000GB               primary

(parted) quit
Information: You may need to update /etc/fstab.

写入分区类型

$ sudo mkfs.ext4 /dev/nvme0n1
mke2fs 1.44.1 (24-Mar-2018)
Found a gpt partition table in /dev/nvme0n1
Proceed anyway? (y,N) y
Discarding device blocks: done
Creating filesystem with 488378646 4k blocks and 122101760 inodes
Filesystem UUID: 60b94695-8f59-4b28-9d6c-c2fcb177f7fa
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
    102400000, 214990848

Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done

查看

$ lsblk
NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                         8:0    0 892.2G  0 disk
├─sda1                      8:1    0   512M  0 part /boot/efi
├─sda2                      8:2    0     1G  0 part /boot
└─sda3                      8:3    0 890.7G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0   200G  0 lvm  /
nvme0n1                   259:0    0   1.8T  0 disk
nvme1n1                   259:1    0   1.8T  0 disk
├─nvme1n1p1               259:2    0   512M  0 part
└─nvme1n1p2               259:3    0   1.8T  0 part

挂载

$ sudo mount /dev/nvme0n1 /apps/
$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                               189G     0  189G   0% /dev
tmpfs                               38G  2.1M   38G   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  196G   24G  163G  13% /
tmpfs                              189G     0  189G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              189G     0  189G   0% /sys/fs/cgroup
/dev/sda2                          976M  146M  763M  17% /boot
/dev/sda1                          511M  6.6M  505M   2% /boot/efi
tmpfs                               38G     0   38G   0% /run/user/1000
/dev/nvme0n1                       1.8T   77M  1.7T   1% /apps

与[转帖]Linux系统NVME盘分区和挂载相似的内容:

[转帖]Linux系统NVME盘分区和挂载

https://www.jianshu.com/p/04327f1b97cb 查看系统里面识别到的硬盘和分区的信息 $ sudo fdisk -l Disk /dev/nvme1n1: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors Units: s

[转帖]Linux系统多网卡环境下的路由配置

https://www.cnblogs.com/connect/p/linux-static-route.html Linux下路由配置命令 1. 添加主机路由 route add -host 192.168.1.11 dev eth0 route add -host 192.168.1.12 gw

[转帖]linux 系统 UDP 丢包问题分析思路

https://cizixs.com/2018/01/13/linux-udp-packet-drop-debug/ 最近工作中遇到某个服务器应用程序 UDP 丢包,在排查过程中查阅了很多资料,总结出来这篇文章,供更多人参考。 在开始之前,我们先用一张图解释 linux 系统接收网络报文的过程。 首

[转帖]Linux系统IO基准测试方法

https://www.cnblogs.com/wangzhen3798/p/13631848.html 顺序读写测试 主要关注磁盘的吞吐量,即每秒能够读入或者写出多少数据。普通单块机械磁盘顺序写在100MB/s左右,普通单块SSD的顺序写在500MB/s左右。该指标对MQ、ES等以append方式

[转帖]Linux系统指令 top 之 %si 占用高,分析实例

https://www.coonote.com/linux-note/linux-top-si-high-instance.html 续“top %wa 高的问题”之后,又遇到top之%si过高(高峰时段超过95%)的问题。 %wa高,说明磁盘忙。譬如磁盘读写次数非常高。 %si高,是否说明软中断忙

[转帖]Linux系统中的tar命令

https://www.cnblogs.com/PatrickLiu/p/9761988.html 时间一长什么东西都容易忘记,尤其是一些不常用的东西忘记的更快,所以避免忘记,就记录下来,可以方面使用的时候查询。Tar命令在linux系统中算是一个比较重要的命令,今天就针对该命令进行总结一下。 1.

[转帖]Linux 系统TCP连接内存大小限制 调优

https://www.cnblogs.com/liujunjun/p/12496677.html 系统TCP连接内存大小限制 TCP的每一个连接请求,读写都需要占用系统内存资源,可根据系统配置,对TCP连接数,内存大小,限制调优。 查看系统内存资源 记录内存 详情:cat /proc/meminf

[转帖]linux系统make命令详解

https://www.jianshu.com/p/9a3fc3edb18c 姓名:曾国强 学号:19021210984 转载自https://blog.csdn.net/ididcan/article/details/6193199 【嵌牛导读】make是linux和unix系统常用的编译命令。m

[转帖]linux系统gcc编译过程

https://www.jianshu.com/p/09c8edd86a96 姓名:曾国强 学号:19021210984 【嵌牛导读】GCC(GNU Compiler Collection,GNU编译器套件)是由GNU开发的编程语言译器。GNU编译器套件包括C、C++、 Objective-C、 F

[转帖]Linux系统中双网卡绑定的方法

1、备份原有配置文件 cd /etc/sysconfig/network-scripts/mv ifcfg-eth0 ifcfg-eth1 /home/ 2、新建网卡配置文件,并填写配置信息 touch ifcfg-bond0 ifcfg-eth0 ifcfg-eth1 vi ifcfg-bond0