azure微软云规范挂载附加数据磁盘(转)

author author     2022-08-28     664

关键词:

1,先使用fdisk进行磁盘分区,一般直接分成一个区

[[email protected]_db_m01 ~]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xd788cc0a.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won‘t be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It‘s strongly recommended to
         switch off the mode (command ‘c‘) and change display units to
         sectors (command ‘u‘).

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-133544, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-133544, default 133544): 
Using default value 133544

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition‘s system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[[email protected]_db_m01 ~]# 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48




2,分区后查看实际分好的分区磁盘目录名称

[[email protected]_db_m01 ~]# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c23d3

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3789    30432256   83  Linux
/dev/sda2            3789        3917     1024000   82  Linux swap / Solaris

Disk /dev/sdb: 240.5 GB, 240518168576 bytes
255 heads, 63 sectors/track, 29241 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x40a7f99c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       29242   234879936   83  Linux

Disk /dev/sdc: 1098.4 GB, 1098437885952 bytes
255 heads, 63 sectors/track, 133544 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd788cc0a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      133544  1072692148+  83  Linux
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32




3,使用 mkfs.ext4 命令格式化磁盘成格式化成ext4各式的文件系统。

[[email protected]_db_m01 ~]# mkfs.ext4 /dev/sdc1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
67043328 inodes, 268173037 blocks
13408651 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
8184 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
    102400000, 214990848

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

This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[[email protected]_db_m01 ~]# 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26




4,开始挂载新的分区磁盘到/oracle

[root@crm_db_m01 ~]# mkdir /oracle
[root@crm_db_m01 ~]# mount /dev/sdc1 /oracle
[root@crm_db_m01 ~]# 

  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5




5,开机启动挂载配置



需要用uuid的方式挂载,最好先用ulkid获取/dev/sdc1的uuid,然后再设置开机启动挂载配置

 [root@crm_db_m01 ~]# blkid
/dev/sda1: UUID="6d089360-3e14-401d-91d0-378f3fd09332" TYPE="ext4" 
/dev/sdc1: UUID="81796489-70bd-4707-b844-9088f8a1a209" TYPE="ext4" 
[root@crm_db_m01 ~]# 
  • 1
  • 2
  • 3
  • 4
  • 1
  • 2
  • 3
  • 4



进行配置/etc/fstab,配置uuid

[[email protected]_db_m01 ~]# vim /etc/fstab 
You have new mail in /var/spool/mail/root
[[email protected]_db_m01 ~]# more /etc/fstab 

#
# /etc/fstab
# Created by anaconda on Wed Jan 15 04:45:47 2014
#
# Accessible filesystems, by reference, are maintained under ‘/dev/disk‘
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=6d089360-3e14-401d-91d0-378f3fd09332 /                       ext4    defaults        1 1
UUID=81796489-70bd-4707-b844-9088f8a1a209           /oracle                   ext4    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
[[email protected]_db_m01 ~]# 

 

Azure:无法将我的数据磁盘附加到 VM

】Azure:无法将我的数据磁盘附加到VM【英文标题】:Azure:UnabletoattachmydatadisktoVM【发布时间】:2015-01-1708:31:12【问题描述】:我有一个在美国西部运行的Linux虚拟机。我有一个与vhd相对应的250GB磁盘。今天发生了Azure存储帐户中断... 查看详情

如何在 azure 虚拟机上用附加的数据磁盘替换 os 磁盘

】如何在azure虚拟机上用附加的数据磁盘替换os磁盘【英文标题】:Howtoreplaceosdiskwithattacheddatadiskonazurevirtualmachine【发布时间】:2017-01-1505:49:19【问题描述】:我将一个新的vhd文件附加到我的虚拟机,但我找不到使用此磁盘启动该... 查看详情

什么会导致附加到 Azure 虚拟机的数据磁盘突然变得未附加?

】什么会导致附加到Azure虚拟机的数据磁盘突然变得未附加?【英文标题】:WhatwouldcausetheDataDisksattachedtoanAzureVirtualMachinetosuddenlybecomeunattached?【发布时间】:2019-09-2204:45:14【问题描述】:我在故障转移群集设置中运行了两个AzureWi... 查看详情

azure云存储及存储账户概述

本文介绍下Azure云存储及存储账户。1、什么是微软Azure云存储微软Azure云存储是微软提供的云端数据存储服务,是一种可伸缩、持久化的数据存储服务,可以在Internet上被访问并按实际存储容量收费。它也可以被RESTAPI访问,可以... 查看详情

腾讯云挂载磁盘(代码片段)

挂载云硬盘最近更新时间:2021-01-2722:01:29 前往GitHub编辑     我的收藏本页目录:自动挂载挂载数据盘(Windows)挂载数据盘(Linux)手动挂载使用控制台挂载云硬盘使用API挂载云硬盘开启磁盘热插拔功能您可... 查看详情

使用azure门户从虚拟机分离数据磁盘

...介绍过使用Azure门户为虚拟机添加数据磁盘。当不再需要附加到虚拟机的数据磁盘时,我们也可以轻松地分离它。这会从虚拟机中删除磁盘,但不会从存储中删除它。如果希望再次使用磁盘上的现有数据,可以将其重新附加到相... 查看详情

1.阿里云数据盘挂载(代码片段)

...一弄错了盘符,哭都没地方哭!本文适用于阿里云数据盘挂载操作,同时对于个人虚拟机Linux环境下挂载磁盘也可参考此文....1.查看未挂载数据盘df-hfdisk-l可以先用df-h命令查看当前已挂载的磁盘,再用fdisk-l查看是否有未挂载的磁... 查看详情

如何将 SSD(高级)磁盘附加到我的 NC6 - Microsoft Azure 中的数据科学 VM?

】如何将SSD(高级)磁盘附加到我的NC6-MicrosoftAzure中的数据科学VM?【英文标题】:HowtoattachanSSD(premium)disktomyNC6-DataScienceVMinMicrosoftAzure?【发布时间】:2019-01-1607:01:54【问题描述】:我在Azure上的N系列实例上部署了一个数据科学虚... 查看详情

media-微软azure文字转语音(代码片段)

title:media-微软Azure文字转语音categories:Mediatags:[Azure,ai,语音]date:2022-03-0810:45:54comments:falsemathjax:truetoc:truemedia-微软Azure文字转语音前篇官方免费服务-https://portal.azure.com/?quickstart=True#blade/Micros 查看详情

转:微软分布式云计算框架orleans

...2068.html 一种构建分布式、高规模(伸缩)的应用程序微软对奥尔良计划(ProjectOrleans)云计算框架开源。奥尔良计划广泛应用于微软Azure云服务的建设,并且是游戏《光环4》的线上基础设施的后台支持。受益于这项开源举措... 查看详情

Azure 中如何获取未附加磁盘的磁盘容量和可用空间

】Azure中如何获取未附加磁盘的磁盘容量和可用空间【英文标题】:HowtogetthediskcapacityandfreespaceofunattacheddisksinAzure【发布时间】:2020-05-0319:32:20【问题描述】:我一直在研究,但是有没有办法在Azure中获取未附加磁盘的磁盘容量和... 查看详情

学习微软 Azure 云

】学习微软Azure云【英文标题】:LearnMicrosoftAzureCloud【发布时间】:2021-12-2719:23:48【问题描述】:我想学习AzureDatabricks、AzureDatalake、AzureDatawarehouse等MicrosoftAzure。如何创建这些以及如何使用它。有人可以帮助我使用任何学习平台... 查看详情

Azure Rest API 附加现有托管磁盘

】AzureRestAPI附加现有托管磁盘【英文标题】:AzureRestAPIattachanexistingmanageddisk【发布时间】:2021-02-2421:58:35【问题描述】:使用逻辑应用程序,从HTTP请求操作调用AzureRestAPI,我尝试创建托管磁盘(从快照),然后将磁盘附加到现... 查看详情

zabbix:通过修改zabbix官方redis模板监控微软云azure上多台mysql实例

  由于微软云上的MySQL实例无法安装插件来导出数据,因此参考上一篇 通过Zabbix官方模板监控微软云Azure上多台Redis实例,我们可以修改zabbix官方redis脚本,通过showstatus等命令获取到mysql的状态指标,用trap-messages模式发送给... 查看详情

人来人往的五年,微软智能云azure凭什么活着?

2018年3月20日,微软智能云Azure迎来了在华商用四周年。2013年5月22日,时任微软CEO的鲍尔默亲自来华宣布微软公有云Azure将于当年6月开放在华公众预览;2014年3月20日,微软公有云Azure正式在华商用。也是在2014年2月,微软史上第三... 查看详情

十大创客与微软智能云azure

由微软举办的“2016年创客先锋—基于微软智能云Azure的SaaS应用软件大赛”已于本周二在中关村圆满落幕。来自全国22家孵化园的创客,历时两个月,开发出百余项基于微软智能云Azure开发的创新项目和优秀的SaaS解决方案。十大创... 查看详情

如何为azure虚拟机添加数据磁盘

...久化的磁盘,它的读写速度要略高于系统磁盘或者普通的附加磁盘,所以通常用于存放一些临时数据,进行swap分区或者虚拟内存的配置,或者存放一些安装程序来使用。注意:临时磁盘上的数据在虚拟机关闭重新开机后数据会... 查看详情

天翼云——挂载数据盘(代码片段)

...是十分简单的,就是日常的一些linux命令,不要忘记创建挂载点了哈,比如本文中的/scrm创建分区先查看数据盘是否挂载上来,挂载上来后直接创建分区就好,然后查看下是否创建完成。格式化磁盘查看UUID写入fstab文件挂载 查看详情