Azure mount Disk - Linux
- Category: 電腦相關
- Last Updated: Tuesday, 20 December 2016 23:28
- Published: Monday, 21 November 2016 14:20
- Written by sam
For ELK use, we need attach new datadisk
root@abc:/mnt# grep SCSI /var/log/syslog
Nov 21 12:36:37 localhost kernel: [333388.594976] sd 5:0:0:0: [sdc] Attached SCSI disk
root@abc:/mnt# fdisk /dev/sdc
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 0x2523aa78.
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): 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.
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: 0x2523aa78
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.
root@wantgooS:/mnt# mkfs -t ext4 /dev/sdc1
make mount point
root@abc:/mnt# mkdir /mntdisk
root@abc:/mnt# mount /dev/sdc1 /mntdisk
check with df -h
/dev/sdc1 1006G 77M 955G 1% /mntdisk
auto mount
root@wantgooS:/mnt# blkid
/dev/sr0: UUID="031E1A5672645f72" LABEL="rd_rdfe_stable.161012-2349" TYPE="udf"
/dev/sda1: LABEL="cloudimg-rootfs" UUID="8ea1c36c-48c4-4d09-ad46-607b266ac3a0" TYPE="ext4" PARTUUID="6c3955c7-4011-4be9-98cc-c2bd775518b1"
/dev/sda15: LABEL="UEFI" UUID="3F0C-9D6A" TYPE="vfat" PARTUUID="b923297e-3b66-4970-8381-ff43396ae54c"
/dev/sdb1: UUID="5391d32b-ab5b-463f-a82e-9e853bb7f9da" TYPE="ext4" PARTUUID="6f6b9520-01"
/dev/sda14: PARTUUID="5b578db3-4925-4bbc-8b43-9a4b01f6cd91"
/dev/sdc1: UUID="e1749b6d-94e1-4519-8faf-e6824a67f248" TYPE="ext4" PARTUUID="2523aa78-01"
backup /etc/fstab
root@abc:/mnt# cp /etc/fstab{,.backup}
add to /etc/fstab
UUID=e1749b6d-94e1-4519-8faf-e6824a67f248 /mntdisk ext4 defaults,discard 0 2
test it
root@abc:/# mount /mntdisk
root@abc:/# df
/dev/sdc1 1054807540 77852 1001078696 1% /mntdisk
Moidfy /etc/elasticsearch/elasticsearch.yml (must stop ELK all service)
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /mntdisk/for_elk
#
# Path to log files:
#
#path.logs: /path/to/logs
And, start all service.
Done.