内容简介:首先切换到磁盘页面,然后点击添加数据磁盘按钮:然后选定存储容器,这里使用的是存储账户 Blob,然后点击确定按钮:
首先切换到磁盘页面,然后点击添加数据磁盘按钮:
然后选定存储容器,这里使用的是存储账户 Blob,然后点击确定按钮:
主机缓存切换为“读/写”,然后点击保存:
这样就添加好了。
挂载磁盘
接下来回到 Linux 服务器下,我们需要将磁盘进行挂载。
首先 SSH 连接到服务器,然后使用 dmesg 命令来查找磁盘:
dmesg | grep SCSI
输出类似如下:
[ 0.728389] SCSI subsystem initialized [ 2.139341] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 244) [ 2.978928] sd 1:0:1:0: [sdb] Attached SCSI disk [ 3.341183] sd 0:0:0:0: [sda] Attached SCSI disk [ 18.397942] Loading iSCSI transport class v2.0-870. [ 6641.364794] sd 3:0:0:0: [sdc] Attached SCSI disk
这里 sdc 就是我们新添加的一块硬盘。
然后我们使用 fdisk 对其进行分区,将其设置为分区 1 中的主磁盘,并接受其他的默认值,命令如下:
sudo fdisk /dev/sdc
使用 n 命令添加新分区,然后 p 选择主分区,其他的默认:
Welcome to fdisk (util-linux 2.27.1). 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 0xc305fe54. 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): First sector (2048-2145386495, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-2145386495, default 2145386495): Created a new partition 1 of type 'Linux' and of size 1023 GiB.
然后使用 p 打印分区表并使用 w 将表写入磁盘,然后退出:
Command (m for help): p Disk /dev/sdc: 1023 GiB, 1098437885952 bytes, 2145386496 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: dos Disk identifier: 0xc305fe54 Device Boot Start End Sectors Size Id Type /dev/sdc1 2048 2145386495 2145384448 1023G 83 Linux Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.
接下来使用 mkfs 命令将文件系统写入分区,指定文件系统的类型和设备名称:
sudo mkfs -t ext4 /dev/sdc1
输出类似如下:
mke2fs 1.42.13 (17-May-2015) Creating filesystem with 268173056 4k blocks and 67043328 inodes Filesystem UUID: d744c5d7-f4d1-4f81-9f56-59dfab956782 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 (32768 blocks): done Writing superblocks and filesystem accounting information: done
然后使用 mkdir 创建一个目录来装载该文件系统,然后挂载:
sudo mkdir /datadrive sudo mount /dev/sdc1 /datadrive
这样就挂载成功了。
添加引导信息
若要确保在重新引导后自动重新装载驱动器,必须将其添加到 /etc/fstab 文件。 此外,强烈建议在 /etc/fstab 中使用 UUID(全局唯一标识符)来引用驱动器而不是只使用设备名称(例如 /dev/sdc1)。 如果 OS 在启动过程中检测到磁盘错误,使用 UUID 可以避免将错误的磁盘装载到给定位置。 然后,为剩余的数据磁盘分配这些设备 ID。 若要查找新驱动器的 UUID,请使用 blkid 实用工具:
sudo -i blkid
输入类似如下:
/dev/sdb1: UUID="d5b61f40-4129-4b39-b861-c2d3b09cee69" TYPE="ext4" PARTUUID="4927b944-01" /dev/sda1: LABEL="cloudimg-rootfs" UUID="b2e62f4f-d338-470e-9ae7-4fc0e014858c" TYPE="ext4" PARTUUID="577c3e7c-01" /dev/sdc1: UUID="d744c5d7-f4d1-4f81-9f56-59dfab956782" TYPE="ext4" PARTUUID="c305fe54-01"
然后编辑 /etc/fstab,添加下面一行:
UUID=d744c5d7-f4d1-4f81-9f56-59dfab956782 /datadrive ext4 defaults,nofail 1 2
然后保存退出即可。
这样就成功添加了一块外部磁盘。
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- shell之磁盘容量检查,配合crontab可以定时清理磁盘
- 微软为旗下Azure Data Box磁盘设备添加新的SSD磁盘选项
- 磁盘操作那些事
- VirtualBox 虚拟机磁盘扩容
- linux 磁盘管理与文件挂载
- Glide - 内存缓存与磁盘缓存
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
马尔可夫链:模型、算法与应用
Wai-Ki Ching、Ximin Huang / 陈曦 / 清华大学出版社 / 2015-6 / 39
《马尔可夫链:模型、算法与应用 应用数学译丛》讲述了马尔可夫链模型在排队系统、网页重要性排名、制造系统、再制造系统、库存系统以及金融风险管理等方面的最新应用进展.全书共安排8章内容,第1章介绍马尔可夫链、隐马尔可夫模型和马尔可夫决策过程的基本理论和方法,其余7章分别介绍马尔可夫链模型在不同领域中的应用. 《马尔可夫链:模型、算法与应用 应用数学译丛》可作为自动化、工业工程、统计学、应用数学以及管理......一起来看看 《马尔可夫链:模型、算法与应用》 这本书的介绍吧!