Note:
Something to know ...
Rescan the SCSI bus
# echo "- - -" > /sys/class/scsi_host/host0/scan
To expand the same LUN, perform the following task
# echo 1 > /sys/class/scsi_device/device/rescan
Verify
# fdisk -l
v
Something to know ...
Rescan the SCSI bus
# echo "- - -" > /sys/class/scsi_host/host0/scan
To expand the same LUN, perform the following task
# echo 1 > /sys/class/scsi_device/device/rescan
Verify
# fdisk -l
$ ssh admin@192.168.0.10
$ sudo fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/sda: 268.4 GB, 268435456000 bytes, 524288000 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 label type: gpt
Disk identifier: EA4D9CB5-6A7C-417B-90B0- BF71AF7BB69F
# Start End Size Type Name
1 2048 4095 1M BIOS boot
2 4096 2101247 1G Microsoft basic
3 2101248 524285951 249G Linux LVM
Disk /dev/sdb: 10995.1 GB, 10995116277760 bytes, 21474836480 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/vg0-root: 37.6 GB, 37580963840 bytes, 73400320 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/vg0-swap: 4160 MB, 4160749568 bytes, 8126464 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/vg0-01: 5368 MB, 5368709120 bytes, 10485760 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/vg0-00: 220.2 GB, 220242903040 bytes, 430161920 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
$ sudo parted /dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
(parted) help
align-check TYPE N check partition N for TYPE(min|opt) alignment
help [COMMAND] print general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkpart PART-TYPE [FS-TYPE] START END make a partition
name NUMBER NAME name partition NUMBER as NAME
print [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or a
particular partition
quit exit program
rescue START END rescue a lost partition near START and END
resizepart NUMBER END resize partition NUMBER
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
disk_set FLAG STATE change the FLAG on selected device
disk_toggle [FLAG] toggle the state of FLAG on selected device
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
unit UNIT set the default unit to UNIT
version display the version number and copyright information of GNU Parted
(parted) unit TB
(parted) mkpart primary 0 0
(parted) print
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 11.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 0.00TB 0.00TB 0.00TB primary
(parted) mkpart primary 0 11
Warning: You requested a partition from 0.00TB to 11.0TB (sectors 0..21474836479).
The closest location we can manage is 0.00TB to 0.00TB (sectors 34..2047).
Is this still acceptable to you?
Yes/No? n
(parted) p
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 11.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 0.00TB 0.00TB 0.00TB primary
(parted) help
align-check TYPE N check partition N for TYPE(min|opt) alignment
help [COMMAND] print general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkpart PART-TYPE [FS-TYPE] START END make a partition
name NUMBER NAME name partition NUMBER as NAME
print [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or a
particular partition
quit exit program
rescue START END rescue a lost partition near START and END
resizepart NUMBER END resize partition NUMBER
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
disk_set FLAG STATE change the FLAG on selected device
disk_toggle [FLAG] toggle the state of FLAG on selected device
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
unit UNIT set the default unit to UNIT
version display the version number and copyright information of GNU Parted
(parted) rm 1
(parted) p
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 11.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
(parted) mkpart primary 0 11
(parted) p
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 11.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 0.00TB 11.0TB 11.0TB primary
(parted) q
Information: You may need to update /etc/fstab.
$ sudo parted /dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 11.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 11.0TB 11.0TB primary
(parted) q
$ sudo pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.
$ sudo vgcreate datavg /dev/sdb1
sudo vgs Volume group "datavg" successfully created
$ sudo vgs
VG #PV #LV #SN Attr VSize VFree
datavg 1 0 0 wz--n- <10.00t <10.00t
vg0 1 4 0 wz--n- <249.00g 4.00m
$ sudo lvcreate -n nesslv -L +99G datavg
Logical volume "nesslv" created.
$ sudo mkfs.xfs /dev/datavg/nesslv
$ sudo lvremove /dev/datavg/nesslvsudo lvremove /dev/datavg/nesslv
$ sudo lvremove /dev/datavg/nesslv
Do you really want to remove active logical volume datavg/nesslv? [y/n]: y
Logical volume "nesslv" successfully removed
$ sudo lvcreate -n nesslv -L +10T datavg
Volume group "datavg" has insufficient free space (2621439 extents): 2621440 required.
$ sudo lvcreate -n nesslv -L +9.9T datavg
Rounding up size to full physical extent 9.90 TiB
Logical volume "nesslv" created.
$ sudo mkfs.xfs /dev/datavg/nesslv
meta-data=/dev/datavg/nesslv isize=512 agcount=10, agsize=268435455 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=2657511424, imaxpct=5
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=521728, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
$ sudo vi /etc/fstab
$ sudo mkdir /1opt1
$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 32G 0 32G 0% /dev
tmpfs 32G 0 32G 0% /dev/shm
tmpfs 32G 20M 32G 1% /run
tmpfs 32G 0 32G 0% /sys/fs/cgroup
/dev/mapper/vg0-root 35G 1.5G 34G 5% /
/dev/mapper/vg0-01 5.0G 100M 4.9G 2% /var/log
/dev/mapper/vg0-00 206G 3.1G 202G 2% /opt
/dev/sda2 1014M 154M 861M 16% /boot
tmpfs 6.3G 0 6.3G 0% /run/user/1001
$ sudo vgs
VG #PV #LV #SN Attr VSize VFree
datavg 1 1 0 wz--n- <10.00t 102.39g
vg0 1 4 0 wz--n- <249.00g 4.00m
$ sudo vi /etc/fstab
$ ls /opt
sc
$ cd /opt
$ sudo du -sh *
3.1G sc
$ more /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Feb 11 05:56:09 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg0-root / xfs defaults 0 0
UUID=31657a30-d845-4032-8f9b- b48fc75f23ed /boot xfs defaults 0 0
##/dev/mapper/vg0-00 /1opt1 xfs defaults 0 0
/dev/mapper/vg0-01 /var/log xfs nosuid,noexec,nodev 0 0
/dev/mapper/vg0-swap swap swap defaults 0 0
####
/dev/mapper/vg0-00 /1opt1 xfs defaults 0 0
/dev/datavg/nesslv /opt xfs defaults 0 0
$ sudo reboot
Connection to 10.85.98.40 closed by remote host.
Connection to 10.85.98.40 closed.
------------------------------ ------------------------------ ------------------------------ ------------------------------ ---------
$ ssh admin@192.168..10
$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 32G 0 32G 0% /dev
tmpfs 32G 0 32G 0% /dev/shm
tmpfs 32G 20M 32G 1% /run
tmpfs 32G 0 32G 0% /sys/fs/cgroup
/dev/mapper/vg0-root 35G 1.6G 34G 5% /
/dev/mapper/vg0-01 5.0G 92M 5.0G 2% /var/log
/dev/sda2 1014M 141M 874M 14% /boot
/dev/mapper/datavg-nesslv 9.9T 33M 9.9T 1% /opt
/dev/mapper/vg0-00 206G 3.1G 202G 2% /1opt1
tmpfs 6.3G 0 6.3G 0% /run/user/1001
$ cd /opt
$ ls
$ cd ..
$ cd /1opt1
$ ls
sc
$ tar -cf /opt/sc.tar sc
tar: /opt/sc.tar: Cannot open: Permission denied
tar: Error is not recoverable: exiting now
$ sudo tar -cf /opt/sc.tar sc
$ du -sh /opt/sc.tar
2.9G /opt/sc.tar
$ cd /opt
$ ls
sc.tar
$ tar -xvf
#!/bin/bash
if [ ! "$(whoami)" == "chante" ]; then
echo "Error: script must be run as the chante user"
exit 1
fi
No comments:
Post a Comment