ubuntu挂载新硬盘

jupiter
2022-06-13 / 0 评论 / 489 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2022年06月13日,已超过680天没有更新,若内容或图片失效,请留言反馈。

1.定位新硬盘

(base) 3090@3090:~$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb      8:16   0   1.8T  0 disk /data
sr0     11:0    1  1024M  0 rom
sdc      8:32   0  14.6T  0 disk
└─sdc1   8:33   0  14.6T  0 part
sda      8:0    0   477G  0 disk
├─sda2   8:2    0   7.6G  0 part [SWAP]
├─sda3   8:3    0 468.4G  0 part /
└─sda1   8:1    0   976M  0 part /boot/efi

发现待挂载的硬盘为sdc1

2.硬盘格式化

mkfs -t ext4 /dev/sdc1
mke2fs 1.42.13 (17-May-2015)
/dev/sdc1 contains a xfs file system
Proceed anyway? (y,n) y
Creating filesystem with 3906469376 4k blocks and 488308736 inodes
Filesystem UUID: ed6952c9-b147-4cfb-b68f-d79e4fcecbb5
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848, 512000000, 550731776, 644972544, 1934917632,
        2560000000, 3855122432

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

3.挂载

3.1 手动挂载

  • 挂载到挂载点/16t
sudo mount /dev/sdc1 /16t
  • 查看挂载结果
(base) 3090@3090:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             63G     0   63G   0% /dev
tmpfs            13G   19M   13G   1% /run
/dev/sda3       461G   31G  407G   8% /
tmpfs            63G  180K   63G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs            63G     0   63G   0% /sys/fs/cgroup
/dev/sdb        1.8T  9.2G  1.7T   1% /data
/dev/sda1       975M  4.3M  970M   1% /boot/efi
tmpfs            13G   64K   13G   1% /run/user/1000
tmpfs            13G     0   13G   0% /run/user/1001
/dev/sdc1        15T  9.1M   14T   1% /16t

3.2 配置开机自动挂载

  • 查看UUID
(base) 3090@3090:~$ sudo blkid /dev/sdc1
/dev/sdc1: UUID="ed6952c9-b147-4cfb-b68f-d79e4fcecbb5" TYPE="ext4" PARTLABEL="primary" PARTUUID="bbcf63f5-3927-41e8-abc6-ca9062aec08c"
  • 修改/etc/fstab
sudo vim /etc/fstab
# 在末尾添加如下内容
UUID=ed6952c9-b147-4cfb-b68f-d79e4fcecbb5 /16t auto defaults    0    0 

参考资料

  1. Ubuntu中查看硬盘分区UUID的方法(所有Linux目录的解释)
  2. ubuntu 挂载硬盘指令
  3. fstab挂载参数
0

评论 (0)

打卡
取消