0


linux debian11 挂载硬盘 及 开机自动挂载

首先查看硬盘 : fdisk -l

root@debian:/usr/local# fdisk -l
Disk /dev/sda: 446.63 GiB, 479559942144 bytes, 936640512 sectors
Disk model: PERC H745 Adp   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
Disklabel type: gpt
Disk identifier: AEA00544-8EC2-4211-92C0-4CD891A1306F

Device         Start       End   Sectors   Size Type
/dev/sda1       2048   1050623   1048576   512M EFI System
/dev/sda2    1050624 934637567 933586944 445.2G Linux filesystem
/dev/sda3  934637568 936638463   2000896   977M Linux swap

Disk /dev/sdb: 42.77 TiB, 47023449440256 bytes, 91842674688 sectors
Disk model: PERC H745 Adp   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 1048576 bytes

我要把42.77T的挂载

创建目录: **mkdir /data1 **

然后格式化42.77T的硬盘 mkfs.ext4 /dev/sdb

root@debian:/usr/local# mkfs.ext4 /dev/sdb
mke2fs 1.46.2 (28-Feb-2021)
Creating filesystem with 11480334336 4k blocks and 717520896 inodes
Filesystem UUID: 5e9e260d-94ee-4020-b47d-8fec9ca4661f
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, 5804752896

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

挂载到刚刚创建的Data1:

mount /dev/sdb /data1

设置开机自动挂载: ** echo '/dev/sdb /data1 ext4 defaults 0 0' >> /etc/fstab**

查看是否挂载成功:** **cat /etc/fstab

root@debian:/usr/local# echo '/dev/sdb /data1 ext4 defaults 0 0' >> /etc/fstab
root@debian:/usr/local# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# systemd generates mount units based on this file, see systemd.mount(5).
# Please run 'systemctl daemon-reload' after making changes here.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=cff055ad-0b92-412a-946b-2d44aabc1464 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=A318-4BF0  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda3 during installation
UUID=8b7a1217-2dc8-447a-9015-6c6ceca59796 none            swap    sw              0       0
/dev/sdb /data1 ext4 defaults 0 0

最下面显示你的硬盘信息 就OK了

标签: linux 运维 服务器

本文转载自: https://blog.csdn.net/weixin_56554479/article/details/134831822
版权归原作者 Complex。 所有, 如有侵权,请联系我们删除。

“linux debian11 挂载硬盘 及 开机自动挂载”的评论:

还没有评论