How to mount disks ...
 
Notifications
Clear all

How to mount disks in linux VM

Raju
 Raju
(@raju)
Member Admin

How to mount disks in linux VM

https://learn.microsoft.com/en-us/azure/virtual-machines/linux/attach-disk-portal

 

To mount a disk in Ubuntu Linux, follow these steps:

  1. Use the

    lsblk

     command to list the available block devices and identify the disk that you want to mount. For example, if your disk is /dev/sdb, you can use the following command to see details about it:

    lsblk /dev/sdb
  2. Create a mount point for the disk. This is a directory where the disk will be accessible once it is mounted. You can create a mount point in the /mnt directory, or you can create a new directory in your home directory. For example, to create a new directory called mydisk in your home directory, use the following command:

    mkdir ~/mydisk
  3. Use the mount command to mount the disk on the mount point that you created. For example, if your disk is /dev/sdb and your mount point is /mnt/mydisk, you can use the following command to mount the disk:

    sudo mount /dev/sdb /mnt/mydisk
  4. Use the ls command to verify that the disk has been mounted. For example, to see the contents of the /mnt/mydisk directory, you can use the following command:

    ls /mnt/mydisk
  5. If you want the disk to be automatically mounted every time the system starts up, you can add an entry for it to the /etc/fstab file. For example, if your disk is /dev/sdb and your mount point is /mnt/mydisk, you can use the following command to add an entry to the /etc/fstab file:Copy code

    sudo echo "/dev/sdb /mnt/mydisk auto defaults 0 0" >> /etc/fstab

Keep in mind that these are just general instructions for mounting a disk in Ubuntu Linux. The exact steps may vary depending on your specific setup. Consult the Ubuntu Linux documentation for more detailed information.

 
 
 
lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"

sudo parted /dev/sda --script mklabel gpt mkpart xfspart xfs 0% 100%
sudo mkfs.xfs /dev/sda
sudo partprobe /dev/sda

sudo mkdir /sqlserver

sudo mount /dev/sda /sqlserver

sudo blkid

root@H1BWebServer:/var/opt/mssql/log# sudo blkid
/dev/sdb1: LABEL="cloudimg-rootfs" UUID="898098a3-2c50-49fd-ac32-98a16d91c16b" TYPE="ext4" PARTUUID="a4f8fa13-8274-4301-80ef-b3b7edab2b58"
/dev/sdb15: LABEL="UEFI" UUID="60D0-2ED1" TYPE="vfat" PARTUUID="1af08ef8-7060-49ba-a251-b084c061ab41"
/dev/sdc1: UUID="9f61dc1b-c907-41d6-be4b-2ab7d43b01a5" TYPE="ext4" PARTUUID="2a253061-01"
/dev/sda: UUID="32c55465-1165-472f-bb4e-4e1db58d70f6" TYPE="xfs"
/dev/sdb14: PARTUUID="f566f5af-e0b0-483d-97c8-cb22fabbb904"


UUID=32c55465-1165-472f-bb4e-4e1db58d70f6   /sqlserver   xfs   defaults,nofail   1   2
This topic was modified 2 years ago 3 times by Raju
Quote
Topic starter Posted : 04/12/2022 4:11 am
Topic Tags
Share: