Navigation

    DDBB

    • Register
    • Login
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Azure linux如何挂载数据磁盘

    Linux
    1
    1
    125
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      admin last edited by admin

      Azure linux报错:SSH2_MSG_CHANNEL_FAILURE for nonexistent channel0
      原因:Azure linux报错:SSH2_MSG_CHANNEL_FAILURE for nonexistent channel0
      参考:
      Azure参考手册
      CSDN参考

      1.查看新挂载的卷名,可根据容量判断Disk /dev/sdb 512G

      [azureuser@onezos /]$ sudo fdisk -l
      Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
      Units: sectors of 1 * 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 4096 bytes
      I/O size (minimum/optimal): 4096 bytes / 4096 bytes
      Disklabel type: dos
      Disk identifier: 0xa48a0604
      
      Device     Boot Start      End  Sectors Size Id Type
      /dev/sda1        2048 41940991 41938944  20G  7 HPFS/NTFS/exFAT
      
      
      Disk /dev/sdc: 64 GiB, 68719476736 bytes, 134217728 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: gpt
      Disk identifier: B8265C8F-141E-4E0B-B7DE-9DE6F75CCF40
      
      Device       Start       End   Sectors  Size Type
      /dev/sdc1  1026048   2050047   1024000  500M Linux filesystem
      /dev/sdc2  2050048 134215679 132165632   63G Linux LVM
      /dev/sdc14    2048     10239      8192    4M BIOS boot
      /dev/sdc15   10240   1024000   1013761  495M EFI System
      
      Partition table entries are not in disk order.
      
      
      
      
      Disk /dev/mapper/rootvg-tmplv: 2 GiB, 2147483648 bytes, 4194304 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
      
      
      Disk /dev/mapper/rootvg-usrlv: 10 GiB, 10737418240 bytes, 20971520 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
      
      
      Disk /dev/mapper/rootvg-homelv: 1 GiB, 1073741824 bytes, 2097152 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
      
      
      Disk /dev/mapper/rootvg-varlv: 8 GiB, 8589934592 bytes, 16777216 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
      
      
      Disk /dev/mapper/rootvg-rootlv: 2 GiB, 2147483648 bytes, 4194304 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
      
      
      Disk /dev/sdb: 512 GiB, 549755813888 bytes, 1073741824 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
      

      2.分区

      [azureuser@onezos /]$ sudo fdisk /dev/sdb
      
      Welcome to fdisk (util-linux 2.32.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 0x15fe7954.
      
      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-1073741823, default 2048): 
      Last sector, +sectors or +size{K,M,G,T,P} (2048-1073741823, default 1073741823): 
      
      Created a new partition 1 of type 'Linux' and of size 512 GiB.
      
      Command (m for help): p
      Disk /dev/sdb: 512 GiB, 549755813888 bytes, 1073741824 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: 0x15fe7954
      
      Device     Boot Start        End    Sectors  Size Id Type
      /dev/sdb1        2048 1073741823 1073739776  512G 83 Linux
      
      Command (m for help): wq
      The partition table has been altered.
      Calling ioctl() to re-read partition table.
      Syncing disks.
      

      3.格式化

      [azureuser@onezos /]$ sudo mkfs.xfs /dev/sdb1
      meta-data=/dev/sdb1              isize=512    agcount=4, agsize=33554368 blks
               =                       sectsz=512   attr=2, projid32bit=1
               =                       crc=1        finobt=1, sparse=1, rmapbt=0
               =                       reflink=1
      data     =                       bsize=4096   blocks=134217472, imaxpct=25
               =                       sunit=0      swidth=0 blks
      naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
      log      =internal log           bsize=4096   blocks=65535, version=2
               =                       sectsz=512   sunit=0 blks, lazy-count=1
      realtime =none                   extsz=4096   blocks=0, rtextents=0
      [azureuser@onezos /]$ sudo blkid
      /dev/sda1: UUID="c357eccc-5bd5-4af3-84cb-fd068f37b6d6" TYPE="ext4" PARTUUID="a48a0604-01"
      /dev/sdc1: UUID="58e5db49-8935-4325-80c1-6628c0d61820" TYPE="xfs" PARTUUID="dbc4d454-142c-4c6b-b847-7c3a45697ce2"
      /dev/sdc2: UUID="nqwdS4-Gvs3-eccT-l4w6-e0fd-yFan-73oea9" TYPE="LVM2_member" PARTUUID="88262e85-6ced-4c85-a844-181f2963c3d6"
      /dev/sdc15: SEC_TYPE="msdos" UUID="F3D4-BA52" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="9a17795a-c9fe-43d3-948d-b8478d7f1bea"
      /dev/mapper/rootvg-tmplv: UUID="8d4f8350-fec9-465b-9c15-945032f09d8e" TYPE="xfs"
      /dev/mapper/rootvg-usrlv: UUID="6f701637-4bfc-4067-a1b8-ff322b287bd2" TYPE="xfs"
      /dev/mapper/rootvg-homelv: UUID="b8f675fe-6736-484e-b34a-edba5f85080a" TYPE="xfs"
      /dev/mapper/rootvg-varlv: UUID="83266738-232f-4daa-b442-a3e0bdbc1979" TYPE="xfs"
      /dev/mapper/rootvg-rootlv: UUID="233e5dcb-51f0-48b1-a941-e948ed6ec8ec" TYPE="xfs"
      /dev/sdc14: PARTUUID="15f2ea65-e018-497e-b63b-8f2feacbadfe"
      /dev/sdb1: UUID="4a61f98e-5d32-4f0a-9c17-1455f32558df" TYPE="xfs" PARTUUID="15fe7954-01"
      [azureuser@onezos /]$ cd /
      [azureuser@onezos /]$ ls
      bin  boot  deployTemp  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
      [azureuser@onezos /]$ sudo mkdir /data
      [azureuser@onezos /]$ ls
      bin  boot  data  deployTemp  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
      

      4.MOUNT新挂载的卷

      [azureuser@onezos /]$ sudo mount /dev/sdb1 /data
      [azureuser@onezos /]$ sudo chmod 755 /data
      [azureuser@onezos /]$ cd /data
      [azureuser@onezos data]$ mkdir zdtee
      mkdir: cannot create directory ‘zdtee’: Permission denied
      [azureuser@onezos data]$ sudo chmod -R 777 /data
      [azureuser@onezos data]$ mkdir zdtee
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post