Temp

From Coolscript
Jump to navigation Jump to search

az disk create -n myDataDisk01 -g default --size-gb 10 az vm disk attach --resource-group default --vm-name vm-disk --name myDataDisk01 dmesg -wH


az vm disk attach --resource-group default --vm-name vm-disk --name myDataDisk01

[Feb23 18:43] scsi 3:0:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 5 [ +0.007574] sd 3:0:0:0: Attached scsi generic sg3 type 0 [ +0.001249] sd 3:0:0:0: [sdc] 20971520 512-byte logical blocks: (10.7 GB/10.0 GiB) [ +0.000002] sd 3:0:0:0: [sdc] 4096-byte physical blocks [ +0.000087] sd 3:0:0:0: [sdc] Write Protect is off [ +0.000001] sd 3:0:0:0: [sdc] Mode Sense: 0f 00 10 00 [ +0.000508] sd 3:0:0:0: [sdc] Write cache: disabled, read cache: enabled, supports DPO and FUA [ +0.014544] sd 3:0:0:0: [sdc] Attached SCSI disk

fdisk /dev/sdc -n -p -1 -defaults (last/end sector) -l -t -8e -w


https://www.howtoforge.com/linux_lvm

pvcreate /dev/sdc1 pvdisplay

vgcreate fileserver /dev/sdc1 vgdisplay

lvcreate --name share --size 5G fileserver lvdisplay


mkfs.ext4 /dev/fileserver/share


mkdir /test mount /dev/fileserver/share /test


root@vm-disk:~# df -h Filesystem Size Used Avail Use% Mounted on udev 441M 0 441M 0% /dev tmpfs 92M 676K 92M 1% /run /dev/sda1 29G 1.4G 28G 5% / tmpfs 459M 0 459M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 459M 0 459M 0% /sys/fs/cgroup /dev/sda15 105M 3.7M 101M 4% /boot/efi /dev/sdb1 3.9G 16M 3.7G 1% /mnt tmpfs 92M 0 92M 0% /run/user/1000 /dev/mapper/fileserver-share 4.9G 20M 4.6G 1% /test


mount /dev/fileserver/share /test








az disk create -n myDataDisk02 -g default --size-gb 10 az vm disk attach --resource-group default --vm-name vm-disk --name myDataDisk02 dmesg -wH

[Feb23 19:10] scsi 3:0:0:1: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 5 [ +0.006942] sd 3:0:0:1: Attached scsi generic sg4 type 0 [ +0.002668] sd 3:0:0:1: [sdd] 20971520 512-byte logical blocks: (10.7 GB/10.0 GiB) [ +0.000002] sd 3:0:0:1: [sdd] 4096-byte physical blocks [ +0.000041] sd 3:0:0:1: [sdd] Write Protect is off [ +0.000002] sd 3:0:0:1: [sdd] Mode Sense: 0f 00 10 00 [ +0.000220] sd 3:0:0:1: [sdd] Write cache: disabled, read cache: enabled, supports DPO and FUA [ +0.041396] sd 3:0:0:1: [sdd] Attached SCSI disk


fdisk /dev/sdd -n -p -1 -defaults (last/end sector) -l -t -8e -w


pvcreate /dev/sdd1

vgextend fileserver /dev/sdd1

vgdisplay


root@vm-disk:~# lvextend -L10G /dev/fileserver/share

 Size of logical volume fileserver/share changed from 5.00 GiB (1280 extents) to 10.00 GiB (2560 extents).
 Logical volume fileserver/share successfully resized.


root@vm-disk:~# lvresize --size +5GB /dev/fileserver/share

 Size of logical volume fileserver/share changed from 10.00 GiB (2560 extents) to 15.00 GiB (3840 extents).
 Logical volume fileserver/share successfully resized.


root@vm-disk:~# resize2fs /dev/fileserver/share resize2fs 1.44.1 (24-Mar-2018) Filesystem at /dev/fileserver/share is mounted on /test; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 2 The filesystem on /dev/fileserver/share is now 3932160 (4k) blocks long.


root@vm-disk:~# df -h Filesystem Size Used Avail Use% Mounted on udev 441M 0 441M 0% /dev tmpfs 92M 676K 92M 1% /run /dev/sda1 29G 1.4G 28G 5% / tmpfs 459M 0 459M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 459M 0 459M 0% /sys/fs/cgroup /dev/sda15 105M 3.7M 101M 4% /boot/efi /dev/sdb1 3.9G 16M 3.7G 1% /mnt tmpfs 92M 0 92M 0% /run/user/1000 /dev/mapper/fileserver-share 15G 25M 15G 1% /test