- Print
- DarkLight
Mounting Guide: Remote Log Files Collection on Data Collector
Windows
To create a VHD, follow these steps:
Open Disk Management. In the search box on the taskbar, enter Computer Management, and select Disk Management.
Click on the Action menu, and select Create VHD.
After the Create and Attach Virtual Hard Disk dialog box opens, specify the location on the physical computer where you want the VHD file to be stored.
Under Location, select the Browse button and locate the folder you want to store the VHD.
Enter a name for the drive in the File name field.
Select Virtual Disk files (*.vhd) from the Save as Type dropdown menu.
Select Save.
Enter Virtual hard disk size.
Select Dynamically expanding or Fixed size under Virtual hard disk type section.
Select OK.
To make a VHD available for use (either one you've created or another existing VHD), follow the below steps:
Open Computer Management and select Disk Management.
On the ‘Action’ menu, select Attach VHD.
After the “Attach Virtual Hard Disk” dialog box opens, select the Browse button, and find your .vhd file.
Now that you've selected the .vhd file, you return to the “Attach Virtual Hard Disk” dialog box. Select OK.
Follow the instructions below to initialize the disk and configure its volume attachment.
Right-click on Disk. Select Initialize Disk and click on Save.
Right-click on Disk and select New Simple Volume. Click on Next.
Specify the size of the volume you want to create. Click Next. Assign any letter from the drop-down and click Next. Give a volume name, click Next, and then click Finish.
You can see the Volume 5(F:) disk is visible in File Explorer.
Ubuntu
To create a VHD, follow these steps:
Use the command dd to create a file.
sudo dd if=/dev/zero of=<path_to_virtual_hard_disk> bs=<bytes> count=<count>
Format the disk with the desired file system.
sudo mkfs -t <file_system_type> <path_to_virtual_hard_disk>
To format it with the ext4 file system, execute the following command:
sudo mkfs -t ext4 <path_to_virtual_hard_disk>
Mount Virtual Hard Disk:
To mount it in the directory, first create the directory, and then mount it using the following command.
sudo mount -o loop <path_to_virtual_hard_disk> <location_to_mount>
Check whether the virtual hard disk is mounted or not using the lsblk command.
As you can see in the below screenshot, a hard disk of 512 MB is successfully mounted in the specified directory.
To mount the VHD automatically during the boot, create a fstab entry. For that, open the fstab file using your favorite text editor.
Add the following line at the end:
<path_to_virtual_hard_disk> <location_to_mount> <file_system_type> <mount_options> 0 0
Note
The steps for mounting a hard disk are the same for both Ubuntu and RHEL.
RHEL
To create a VHD, follow these steps:
Use the command dd to create a file.
sudo dd if=/dev/zero of=<path_to_virtual_hard_disk> bs=<bytes> count=<count>
Format the disk with the desired file system.
sudo mkfs -t <file_system_type> <virtual hard disk>
To format it with the ext4 file system, execute the following command:
sudo mkfs -t ext4 <virtual hard disk>
Mount Virtual Hard Disk:
To mount it in the directory, first create the directory, and then mount it using the following command.
sudo mount -o loop <path_to_virtual_hard_disk> <location_to_mount>
Check whether the virtual hard disk is mounted or not using the lsblk command.
As you can see in the below screenshot, a hard disk of 512 MB is successfully mounted in the specified directory.
To mount the VHD automatically during the boot, create a fstab entry. For that, open the fstab file using your favorite text editor.
Add the following line at the end:
<path_to_virtual_hard_disk> <location_to_mount> <file_system_type> <mount_options> 0 0
EC2 Linux with EBS
Prerequisites:
AWS Account
EC2 Instance
To create a Virtual volume on the AWS cloud and mount it to EC2, follow these steps:
Open AWS. Navigate to EC2 Service
Open Volume from an EC2 > Elastic Block Store > Volumes
Create Volume
Provide disk size and necessary details, and keep the availability zone the same as the ec2 region.
Once EBS Volume is created then select the newly created volume and attach it to the ec2 instance.
Select the Instance in which you want to mount the volume and also select the recommended device name based on your OS.
Execute the below command to list out all the devices in the Linux machine.
Check whether the filesystem is involved or not. If not then configure the filesystem. To configure filesystem in new disk execute this command:
mkfs -t xfs /dev/xvdbf
Create a directory where you want to mount the disk, and then mount the disk to that directory.
Now check whether drive is mounted or not using the command below.
To configure automount on boot, please do following steps:
Open the /etc/fstab file in a text editor and add the following line at the end of the file and save it.
<Mount Disk Name> <Mount Directory Path> <filesystemtype> defaults,nofail 0 2
Note
To mount volumes on any other Cloud Virtual Machines, please refer to their official documentation.