挂载之前:
nx@nx-desktop:/data$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mmcblk0p1 28G 22G 5.3G 81% /
none 3.5G 0 3.5G 0% /dev
tmpfs 3.8G 4.0K 3.8G 1% /dev/shm
tmpfs 3.8G 94M 3.8G 3% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup
tmpfs 778M 20K 778M 1% /run/user/120
tmpfs 778M 0 778M 0% /run/user/1000
挂载之后:
nx@nx-desktop:/data$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mmcblk0p1 28G 22G 5.3G 81% /
none 3.5G 0 3.5G 0% /dev
tmpfs 3.8G 4.0K 3.8G 1% /dev/shm
tmpfs 3.8G 94M 3.8G 3% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup
tmpfs 778M 20K 778M 1% /run/user/120
tmpfs 778M 0 778M 0% /run/user/1000
/dev/nvme0n1 458G 73M 435G 1% /data
参考:
https://blog.csdn.net/jiangchao3392/article/details/73549680
但是在运行:`sudo mount -t ext4 /dev/sda /data`时提示:
nx@nx-desktop:/$ sudo mkfs -t ext4 /dev/nvme0n1p1
mke2fs 1.44.1 (24-Mar-2018)
Found a dos partition table in /dev/nvme0n1p1
Proceed anyway? (y,N) y
mkfs.ext4: inode_size (128) * inodes_count (0) too big for a
filesystem with 0 blocks, specify higher inode_ratio (-i)
or lower inode count (-N).
参考:https://blog.csdn.net/jakieyoung/article/details/6885418删除的时候报错:
Command (m for help): d
No partition is defined yet!
Could not delete partition 367759241473
然后:
nx@nx-desktop:/$ sudo fdisk /dev/nvme0n1
Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): d
Selected partition 1
Partition 1 has been deleted.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-976773167, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-976773167, default 976773167):
Created a new partition 1 of type 'Linux' and of size 465.8 GiB.
Command (m for help): n
All space for primary partitions is in use.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
nx@nx-desktop:/$ sudo mkfs -t ext4 /dev/nvme0n1p1
mke2fs 1.44.1 (24-Mar-2018)
Found a dos partition table in /dev/nvme0n1p1
Proceed anyway? (y,N) y
Discarding device blocks: done
Creating filesystem with 122096390 4k blocks and 30531584 inodes
Filesystem UUID: 3b6711c2-0902-45f6-8697-83221b2c2d0e
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
就成功了,后边就没有问题了。