当前位置: 首页 > news >正文

Ubuntu 挂载新盘

1.磁盘分区

root@ljz:/# lsblk
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0     7:0    0     4K  1 loop /snap/bare/5
loop1     7:1    0 104.2M  1 loop /snap/core/17200
loop2     7:2    0  73.9M  1 loop /snap/core22/1908
loop3     7:3    0 104.6M  1 loop /snap/core/17210
loop4     7:4    0 221.4M  1 loop /snap/gnome-3-34-1804/21
loop5     7:5    0 505.1M  1 loop /snap/gnome-42-2204/176
loop6     7:6    0  12.2M  1 loop /snap/snap-store/1216
loop7     7:7    0  73.9M  1 loop /snap/core22/1963
loop8     7:8    0 218.4M  1 loop /snap/gnome-3-34-1804/93
loop9     7:9    0  55.4M  1 loop /snap/core18/2846
loop10    7:10   0  55.4M  1 loop /snap/core18/2855
loop11    7:11   0   516M  1 loop /snap/gnome-42-2204/202
loop12    7:12   0  48.3M  1 loop /snap/gtk-common-themes/1474
loop13    7:13   0  91.7M  1 loop /snap/gtk-common-themes/1535
loop14    7:14   0  12.9M  1 loop /snap/snap-store/1113
sda       8:0    0 238.5G  0 disk
├─sda1    8:1    0   512M  0 part /boot/efi
└─sda2    8:2    0   238G  0 part /
nvme0n1 259:0    0 465.8G  0 disk
root@ljz:/# sudo fdisk /dev/nvme0n1Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x326745dd.Command (m for help): p
Disk /dev/nvme0n1: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: BIWIN NV7200 500GB                      
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: dos
Disk identifier: 0x326745ddCommand (m for help): n
Partition typep   primary (0 primary, 0 extended, 4 free)e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):  
First sector (2048-976773167, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-976773167, default 976773167): 488386583Created a new partition 1 of type 'Linux' and of size 232.9 GiB.Command (m for help): n
Partition typep   primary (1 primary, 0 extended, 3 free)e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2):
First sector (488386584-976773167, default 488388608):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (488388608-976773167, default 976773167):Created a new partition 2 of type 'Linux' and of size 232.9 GiB.Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.root@ljz:/# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0         7:0    0     4K  1 loop /snap/bare/5
loop1         7:1    0 104.2M  1 loop /snap/core/17200
loop2         7:2    0  73.9M  1 loop /snap/core22/1908
loop3         7:3    0 104.6M  1 loop /snap/core/17210
loop4         7:4    0 221.4M  1 loop /snap/gnome-3-34-1804/21
loop5         7:5    0 505.1M  1 loop /snap/gnome-42-2204/176
loop6         7:6    0  12.2M  1 loop /snap/snap-store/1216
loop7         7:7    0  73.9M  1 loop /snap/core22/1963
loop8         7:8    0 218.4M  1 loop /snap/gnome-3-34-1804/93
loop9         7:9    0  55.4M  1 loop /snap/core18/2846
loop10        7:10   0  55.4M  1 loop /snap/core18/2855
loop11        7:11   0   516M  1 loop /snap/gnome-42-2204/202
loop12        7:12   0  48.3M  1 loop /snap/gtk-common-themes/1474
loop13        7:13   0  91.7M  1 loop /snap/gtk-common-themes/1535
loop14        7:14   0  12.9M  1 loop /snap/snap-store/1113
sda           8:0    0 238.5G  0 disk
├─sda1        8:1    0   512M  0 part /boot/efi
└─sda2        8:2    0   238G  0 part /
nvme0n1     259:0    0 465.8G  0 disk
├─nvme0n1p1 259:1    0 232.9G  0 part
└─nvme0n1p2 259:2    0 232.9G  0 part

root@ljz:/# lsblk

root@ljz:/# sudo fdisk /dev/nvme0n1

Command (m for help): p
 

Command (m for help): n

Select (default p): p

Command (m for help): n

Select (default p): p
Partition number (2-4, default 2):
First sector (488386584-976773167, default 488388608):(计算结果)
Last sector, +/-sectors or +/-size{K,M,G,T,P} (488388608-976773167, default 976773167):

Created a new partition 2 of type 'Linux' and of size 232.9 GiB.

root@ljz:/# lsblk

nvme0n1     259:0    0 465.8G  0 disk
├─nvme0n1p1 259:1    0 232.9G  0 part
└─nvme0n1p2 259:2    0 232.9G  0 part

二.文件挂载

1.lsblk -f 可以查看当前所有的盘分区的的文件类型

2.

强制修改所挂载盘的类型

sudo mkfs.ext4 /dev/nvme0n1p1

3.

选定文件夹目录挂载盘。此时要注意盘的类型和名称

sudo mount /dev/nvme0n1p1 /home/ljz/Open_source

相关文章:

  • 飞腾D2000,麒麟系统V10,docker,ubuntu1804,小白入门喂饭级教程
  • seafile:ubuntu搭建社区版seafile12.0
  • 解决 Ubuntu 20.04 虚拟机中 catkin_make 编译卡死问题
  • CppCon 2014 学习:Anatomy of a Smart Pointer
  • windows安装和部署docker
  • 八.MySQL复合查询
  • LangChain操作指南
  • 手把手教你用Appsmith打造企业级低代码平台:从部署到性能调优实战
  • 化工厂爆炸事件看制造业AI转型
  • Manus AI与多语言手写识别的创新革命:从技术突破到行业赋能
  • SpringBoot 自定义注解实现限流
  • 【操作系统原理08】文件管理
  • (三)动手学线性神经网络:从数学原理到代码实现
  • git clone报错:SSL certificate problem: unable to get local issuer certificate
  • 物联网数据归档方案选择分析
  • 【Bluedroid】蓝牙启动之sdp_init 源码解析
  • 帝可得- 人员管理
  • Linux系统-基本指令(5)
  • STM32入门教程——按键控制LED光敏传感器控制蜂鸣器
  • 05 APP 自动化- Appium 单点触控 多点触控
  • 做网站首选智投未来1/宁波正规优化seo公司
  • 南海局势最新军事动态/画质优化app下载
  • 天津市建设工程评标专家网/2022年搜索引擎优化指南
  • 英文网站案例/ui培训
  • 公司销售网站怎么做/网站注册页面
  • 深圳 网站制作/seo网页的基础知识