Storage Administration Guide Red Hat Enterprise Linux 7 Deploying and configuring single-node storage in RHEL 7 Edited by Marek Suchanek Red Hat Customer Content Services msuchane@redhat.com Edited by Apurva Bhide Red Hat Customer Content Services abhide@redhat.com Milan Navratil Red Hat Customer Content Services Jacquelynn East Red Hat Customer Content Services Don Domingo Red Hat Customer Content Services

Commands:
Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00 11675568 6272120 4810348 57% / /dev/sda1 100691 9281 86211 10% /boot none 322856 0 322856 0% /dev/shm
Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 12G 6.0G 4.6G 57% / /dev/sda1 99M 9.1M 85M 10% /boot none 316M 0 316M 0% /dev/shm
fstrim -v /mnt/ non_discard fstrim: /mnt/ non_discard : the discard operation is not supported
mkfs.xfs block_device
meta-data=/dev/device isize=256 agcount=4, agsize=3277258 blks = sectsz=512 attr=2 data = bsize=4096 blocks=13109032, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 log =internal log bsize=4096 blocks=6400, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0
mkfs.xfs -d su=64k,sw=4 /dev/ block_device
mount /dev/ device /mount/point
mount -o nobarrier /dev/device /mount/point
xfs_quota -x
User quota on /home (/dev/blockdevice) Blocks User ID Used Soft Hard Warn/Grace ---------- --------------------------------- root 0 0 0 00 [------] testuser 103.4G 0 0 00 [------]
xfs_quota -x -c 'limit isoft=500 ihard=700 john' /home/
xfs_quota -x -c 'limit -g bsoft=1000m bhard=1200m accounting' /target/path
echo 11:/var/log >> /etc/projects
echo logfiles:11 >> /etc/projid
xfs_quota -x -c 'project -s logfiles' /var
xfs_quota -x -c 'limit -p bhard=lg logfiles' /var
xfs_growfs /mount/point -D size
xfs_repair /dev/device
xfs_freeze mount-point
xfs_freeze -f /mount/point
xfs_freeze -u /mount/point
xfsdump -l level [ -L label ] -f backup-destination path-to-xfs-filesystem
xfsdump -l 0 -f /backup-files/boot.xfsdump /boot # xfsdump -l 0 -f /backup-files/data.xfsdump /data
xfsdump -l 0 -L "backup_boot" -f /dev/ st0 /boot # xfsdump -l 0 -L "backup_data" -f /dev/ st0 /data
xfsrestore [ -r ] [ -S session-id ] [ -L session-label ] [ -i ] -f backup-location restoration-path
xfsrestore -f /backup-files/boot.xfsdump /mnt/boot/ # xfsrestore -f /backup-files/data.xfsdump /mnt/data/
xfsrestore -f /dev/st0 -L "backup_boot" /mnt/boot/ # xfsrestore -f /dev/st0 -S "45e9af35-efd2-4244-87bc-4762e476cbab" /mnt/data/
xfsrestore: preparing drive xfsrestore: examining media file 0 xfsrestore: inventory session uuid (8590224e-3c93-469c-a311-fc8f23029b2a) does not match the media header's session uuid (7eda9f86-f1e9-4dfd-b1d4-c50467912408) xfsrestore: examining media file 1 xfsrestore: inventory session uuid (8590224e-3c93-469c-a311-fc8f23029b2a) does not match the media header's session uuid (7eda9f86-f1e9-4dfd-b1d4-c50467912408) [...]
echo value > /sys/fs/xfs/ device /error/metadata/ condition /max_retries
echo value > /sys/fs/xfs/ device /error/metadata/default/max_retries
echo value > /sys/fs/xfs/ device /error/metadata/ condition /retry_timeout_seconds
echo value > /sys/fs/xfs/ device /error/metadata/default/retry_timeout_seconds
echo value > /sys/fs/xfs/ device /error/fail_at_unmount
mkfs.ext3 block_device
e2label block_device volume_label
mkfs.ext3 -U UUID device
tune2fs -j block_device
umount /dev/mapper/VolGroup00-LogVol02
tune2fs -O ^has_journal /dev/mapper/VolGroup00-LogVol02
e2fsck -y /dev/mapper/VolGroup00-LogVol02
mount -t ext2 /dev/mapper/VolGroup00-LogVol02 /mount/point
mkfs.ext4 block_device
~]# mkfs.ext4 /dev/sdb1 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 245280 inodes, 979456 blocks 48972 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=1006632960 30 block groups 32768 blocks per group, 32768 fragments per group 8176 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736 Writing inode tables: done Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: done
mkfs.ext4 -E stride=16,stripe-width=64 /dev/ block_device
mkfs.ext4 -U UUID device
mount /dev/ device /mount/point
mount -o acl,user_xattr /dev/ device /mount/point
mount -o data_err=abort / dev / device / mount / point
mount -o nobarrier /dev/ device /mount/point
resize2fs /mount/device size
resize2fs /dev/ device size
e2fsck /dev/ device
dump -0uf backup-file /dev/ device
dump -0uf /backup-files/sda1.dump /dev/sda1 # dump -0uf /backup-files/sda2.dump /dev/sda2 # dump -0uf /backup-files/sda3.dump /dev/sda3
dump -0u -f - /dev/ device | ssh root@ remoteserver.example.com dd of= backup-file
mkfs.ext4 /dev/ device
e2label /dev/ device label
mkdir /mnt/ device # mount -t ext4 /dev/ device /mnt/ device
cd /mnt/ device # restore -rf device-backup-file
ssh remote-address "cd /mnt/ device && cat backup-file | /usr/sbin/restore -r -f -"
ssh remote-machine-1 "cd /mnt/ device && RSH=/usr/bin/ssh /usr/sbin/restore -rf remote-machine-2 : backup-file "
systemctl reboot
mkfs.ext4 /dev/sda1 # mkfs.ext4 /dev/sda2 # mkfs.ext4 /dev/sda3
e2label /dev/sda1 Boot1 # e2label /dev/sda2 Root # e2label /dev/sda3 Data
mkdir /mnt/sda1 # mount -t ext4 /dev/sda1 /mnt/sda1 # mkdir /mnt/sda2 # mount -t ext4 /dev/sda2 /mnt/sda2 # mkdir /mnt/sda3 # mount -t ext4 /dev/sda3 /mnt/sda3
mkdir /backup-files # mount -t ext4 /dev/sda6 /backup-files
cd /mnt/sda1 # restore -rf /backup-files/sda1.dump # cd /mnt/sda2 # restore -rf /backup-files/sda2.dump # cd /mnt/sda3 # restore -rf /backup-files/sda3.dump
systemctl reboot
mkfs.btrfs / dev / device
mount / dev / device / mount-point
btrfs filesystem resize amount / mount-point
btrfs filesystem resize +200M /btrfssingle Resize '/btrfssingle' of '+200M'
btrfs filesystem show /mount-point
btrfs filesystem show /btrfstest Label: none uuid: 755b41b7-7a20-4a24-abb3-45fdbed1ab39 Total devices 4 FS bytes used 192.00KiB devid 1 size 1.00GiB used 224.75MiB path /dev/vdc devid 2 size 524.00MiB used 204.75MiB path /dev/vdd devid 3 size 1.00GiB used 8.00MiB path /dev/vde devid 4 size 1.00GiB used 8.00MiB path /dev/vdf Btrfs v3.16.2
btrfs filesystem resize devid : amount /mount-point
btrfs filesystem resize 2:+200M /btrfstest Resize '/btrfstest/' of '2:+200M'
btrfs filesystem resize amount / mount-point
btrfs filesystem resize -200M /btrfssingle Resize '/btrfssingle' of '-200M'
btrfs filesystem show /mount-point
btrfs filesystem show /btrfstest Label: none uuid: 755b41b7-7a20-4a24-abb3-45fdbed1ab39 Total devices 4 FS bytes used 192.00KiB devid 1 size 1.00GiB used 224.75MiB path /dev/vdc devid 2 size 524.00MiB used 204.75MiB path /dev/vdd devid 3 size 1.00GiB used 8.00MiB path /dev/vde devid 4 size 1.00GiB used 8.00MiB path /dev/vdf Btrfs v3.16.2
btrfs filesystem resize devid : amount /mount-point
btrfs filesystem resize 2:-200M /btrfstest Resize '/btrfstest' of '2:-200M'
btrfs filesystem resize amount / mount-point
btrfs filesystem resize 700M /btrfssingle Resize '/btrfssingle' of '700M'
btrfs filesystem show / mount-point
btrfs filesystem show /btrfstest Label: none uuid: 755b41b7-7a20-4a24-abb3-45fdbed1ab39 Total devices 4 FS bytes used 192.00KiB devid 1 size 1.00GiB used 224.75MiB path /dev/vdc devid 2 size 724.00MiB used 204.75MiB path /dev/vdd devid 3 size 1.00GiB used 8.00MiB path /dev/vde devid 4 size 1.00GiB used 8.00MiB path /dev/vdf Btrfs v3.16.2
btrfs filesystem resize devid : amount /mount-point
btrfs filesystem resize 2:300M /btrfstest Resize '/btrfstest' of '2:300M'
mkfs.btrfs /dev/ device1 /dev/ device2 /dev/ device3 /dev/ device4
mkfs.btrfs -m raid0 /dev/ device1 /dev/ device2
mkfs.btrfs -m raid10 -d raid10 /dev/ device1 /dev/ device2 /dev/ device3 /dev/ device4
mkfs.btrfs -m single / dev / device
mkfs.btrfs -d single /dev/ device1 /dev/ device2 /dev/ device3
btrfs device add /dev/ device1 / mount-point
btrfs device scan
btrfs device scan /dev/ device
mkfs.btrfs /dev/ device1 mount /dev/ device1
btrfs device add /dev/ device2 / mount-point
btrfs filesystem balance / mount-point
mount /dev/sdb1 /mnt btrfs device add /dev/sdc1 /mnt btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt
mkfs.btrfs /dev/sdb /dev/sdc /dev/sdd /dev/sde mount /dev/sdb /mnt
btrfs device delete /dev/sdc /mnt
mkfs.btrfs -m raid1 /dev/sdb /dev/sdc /dev/sdd /dev/sde ssd is destroyed or removed, use -o degraded to force the mount to ignore missing devices mount -o degraded /dev/sdb /mnt 'missing' is a special device name btrfs device delete missing /mnt
/dev/sdb /mnt btrfs device=/dev/sdb,device=/dev/sdc,device=/dev/sdd,device=/dev/sde 0
mount -t nfs -o options server : /remote/export /local/directory
server:/usr/local/pub /pub nfs defaults 0 0
server : /remote/export /local/directory nfs options 0 0
systemctl daemon-reload
/- /tmp/auto_dcthon /- /tmp/auto_test3_direct /- /tmp/auto_test4_direct
mount-point map-name options
/home /etc/auto.misc
mount-point [ options ] location
payroll -fstype=nfs personnel:/dev/hda3 sales -fstype=ext3 :/dev/hda4
systemctl start autofs
systemctl restart autofs
systemctl status autofs
automount: files nis
+auto.master
/home auto.home
beth fileserver.example.com:/export/home/beth joe fileserver.example.com:/export/home/joe * fileserver.example.com:/export/home/&
/home \u00ad/etc/auto.home +auto.master
* labserver.example.com:/export/home/&
mydir someserver:/export/mydir +auto.home
beth joe mydir
DEFAULT_MAP_OBJECT_CLASS="automountMap" DEFAULT_ENTRY_OBJECT_CLASS="automount" DEFAULT_MAP_ATTRIBUTE="automountMapName" DEFAULT_ENTRY_ATTRIBUTE="automountKey" DEFAULT_VALUE_ATTRIBUTE="automountInformation"
extended LDIF # LDAPv3 base <> with scope subtree filter: (&(objectclass=automountMap)(automountMapName=auto.master)) requesting: ALL # auto.master, example.com dn: automountMapName=auto.master,dc=example,dc=com objectClass: top objectClass: automountMap automountMapName: auto.master extended LDIF # LDAPv3 base <automountMapName=auto.master,dc=example,dc=com> with scope subtree filter: (objectclass=automount) requesting: ALL # /home, auto.master, example.com dn: automountMapName=auto.master,dc=example,dc=com objectClass: automount cn: /home automountKey: /home automountInformation: auto.home extended LDIF # LDAPv3 base <> with scope subtree filter: (&(objectclass=automountMap)(automountMapName=auto.home)) requesting: ALL # auto.home, example.com dn: automountMapName=auto.home,dc=example,dc=com objectClass: automountMap automountMapName: auto.home extended LDIF # LDAPv3 base <automountMapName=auto.home,dc=example,dc=com> with scope subtree filter: (objectclass=automount) requesting: ALL # foo, auto.home, example.com dn: automountKey=foo,automountMapName=auto.home,dc=example,dc=com objectClass: automount automountKey: foo automountInformation: filer.example.com:/export/foo /, auto.home, example.com dn: automountKey=/,automountMapName=auto.home,dc=example,dc=com objectClass: automount automountKey: / automountInformation: filer.example.com:/export/&
systemctl status rpcbind
systemctl start nfs-lock # systemctl enable nfs-lock
systemctl start nfs
systemctl enable nfs
systemctl stop nfs
systemctl restart nfs
systemctl restart nfs-config
systemctl try-restart nfs
systemctl reload nfs
export host ( options )
export host1 ( options1 ) host2 ( options2 ) host3 ( options3 )
/exported/directory bob.example.com
export host (anonuid= uid ,anongid= gid )
/home bob.example.com(rw) /home bob.example.com (rw)
systemctl restart nfs-config
systemctl restart nfs-server
showmount -e myserver Export list for mysever /exports/ foo /exports/ bar
mount myserver :/ /mnt/ # cd /mnt/ exports # ls exports foo bar
systemctl enable rpc-rquotad
systemctl start rpc-rquotad
systemctl restart rpc-rquotad
systemctl restart rpc-rquotad
systemctl restart nfs
Requested NFS version or transport protocol is not supported.
RPCNFSDARGS="-N 2 -N 3 -U"
RPCMOUNTDOPTS="-N 2 -N 3"
systemctl mask --now rpc-statd.service rpcbind.service rpcbind.socket
systemctl restart nfs
netstat -ltu Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:nfs 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN tcp 0 0 localhost:smtp 0.0.0.0:* LISTEN tcp6 0 0 [::]:nfs [::]:* LISTEN tcp6 0 0 [::]:12432 [::]:* LISTEN tcp6 0 0 [::]:12434 [::]:* LISTEN tcp6 0 0 localhost:7092 [::]:* LISTEN tcp6 0 0 [::]:ssh [::]:* LISTEN udp 0 0 localhost:323 0.0.0.0:* udp 0 0 0.0.0.0:bootpc 0.0.0.0:* udp6 0 0 localhost:323 [::]:*
netstat -ltu Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:nfs 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:36069 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:52364 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:sunrpc 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:mountd 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN tcp 0 0 localhost:smtp 0.0.0.0:* LISTEN tcp6 0 0 [::]:34941 [::]:* LISTEN tcp6 0 0 [::]:nfs [::]:* LISTEN tcp6 0 0 [::]:sunrpc [::]:* LISTEN tcp6 0 0 [::]:mountd [::]:* LISTEN tcp6 0 0 [::]:12432 [::]:* LISTEN tcp6 0 0 [::]:56881 [::]:* LISTEN tcp6 0 0 [::]:12434 [::]:* LISTEN tcp6 0 0 localhost:7092 [::]:* LISTEN tcp6 0 0 [::]:ssh [::]:* LISTEN udp 0 0 localhost:323 0.0.0.0:* udp 0 0 0.0.0.0:37190 0.0.0.0:* udp 0 0 0.0.0.0:876 0.0.0.0:* udp 0 0 localhost:877 0.0.0.0:* udp 0 0 0.0.0.0:mountd 0.0.0.0:* udp 0 0 0.0.0.0:38588 0.0.0.0:* udp 0 0 0.0.0.0:nfs 0.0.0.0:* udp 0 0 0.0.0.0:bootpc 0.0.0.0:* udp 0 0 0.0.0.0:sunrpc 0.0.0.0:* udp6 0 0 localhost:323 [::]:* udp6 0 0 [::]:57683 [::]:* udp6 0 0 [::]:876 [::]:* udp6 0 0 [::]:mountd [::]:* udp6 0 0 [::]:40874 [::]:* udp6 0 0 [::]:nfs [::]:* udp6 0 0 [::]:sunrpc [::]:*
/export *(sec=sys:krb5:krb5i:krb5p)
mount -o sec=krb5 server:/export /mnt
rpcinfo -p
program vers proto port service 100021 1 udp 32774 nlockmgr 100021 3 udp 32774 nlockmgr 100021 4 udp 32774 nlockmgr 100021 1 tcp 34437 nlockmgr 100021 3 tcp 34437 nlockmgr 100021 4 tcp 34437 nlockmgr 100011 1 udp 819 rquotad 100011 2 udp 819 rquotad 100011 1 tcp 822 rquotad 100011 2 tcp 822 rquotad 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100005 1 udp 836 mountd 100005 1 tcp 839 mountd 100005 2 udp 836 mountd 100005 2 tcp 839 mountd 100005 3 udp 836 mountd 100005 3 tcp 839 mountd
mount -t nfs -o v4.1 server:/remote-export /local-directory
lsmod | grep nfs_layout_nfsv41_files
mount -t nfs -o v4.2 server:/remote-export /local-directory
lsmod | grep nfs_layout_flexfiles
yum install sg3_utils
sg_persist --in --report-capabilities --verbose path-to-scsi-device
inquiry cdb: 12 00 00 00 24 00 Persistent Reservation In cmd: 5e 02 00 00 00 00 00 20 00 00 LIO-ORG block11 4.0 Peripheral device type: disk Report capabilities response: Compatible Reservation Handling(CRH): 1 Specify Initiator Ports Capable(SIP_C): 1 All Target Ports Capable(ATP_C): 1 Persist Through Power Loss Capable(PTPL_C): 1 Type Mask Valid(TMV): 1 Allow Commands: 1 Persist Through Power Loss Active(PTPL_A): 1 Support indicated in Type mask: Write Exclusive, all registrants: 1 Exclusive Access, registrants only: 1 Write Exclusive, registrants only: 1 Exclusive Access: 1 Write Exclusive: 1 Exclusive Access, all registrants: 1
[nfsd] vers4.1=y
/exported/directory allowed.example.com(pnfs)
mount -t nfs -o nfsvers=4.1 host : /remote/export /local/directory
yum install sg3_utils
sg_persist --read-reservation path-to-scsi-device
sg_persist --read-reservation /dev/sda LIO-ORG block_1 4.0 Peripheral device type: disk PR generation=0x8, Reservation follows: Key=0x100000000000000 scope: LU_SCOPE, type: Exclusive Access, registrants only
sg_persist --out --release --param-rk= reservation-key --prout-type=6 path-to-scsi-device
sg_persist --out --release --param-rk=0x100000000000000 --prout-type=6 /dev/sda LIO-ORG block_1 4.0 Peripheral device type: disk
watch --differences "nfsstat --server | egrep --after-context=1 read\|write\|layout" Every 2.0s: nfsstat --server | egrep --after-context=1 read\|write\|layout putrootfh read readdir readlink remove rename 2 0% 0 0% 1 0% 0 0% 0 0% 0 0% -- setcltidconf verify write rellockowner bc_ctl bind_conn 0 0% 0 0% 0 0% 0 0% 0 0% 0 0% -- getdevlist layoutcommit layoutget layoutreturn secinfononam sequence 0 0% 29 1% 49 1% 5 0% 0 0% 2435 86%
cat /proc/self/mountstats | awk /scsi_lun_0/,/^USD/ | egrep device\|READ\|WRITE\|LAYOUT device 192.168.122.73:/exports/scsi_lun_0 mounted on /mnt/rhel7/scsi_lun_0 with fstype nfs4 statvers=1.1 nfsv4: bm0=0xfdffbfff,bm1=0x40f9be3e,bm2=0x803,acl=0x3,sessions,pnfs=LAYOUT_SCSI READ: 0 0 0 0 0 0 0 0 WRITE: 0 0 0 0 0 0 0 0 READLINK: 0 0 0 0 0 0 0 0 READDIR: 0 0 0 0 0 0 0 0 LAYOUTGET: 49 49 0 11172 9604 2 19448 19454 LAYOUTCOMMIT: 28 28 0 7776 4808 0 24719 24722 LAYOUTRETURN: 0 0 0 0 0 0 0 0 LAYOUTSTATS: 0 0 0 0 0 0 0 0
yum install cifs-utils
mount -t cifs -o vers=1.0 ,username= user_name //server_name/share_name /mnt/
mount // server / share on /mnt type cifs (..., unix ,...)
mount -t cifs -o username= user_name // server_name / share_name /mnt/ Password for user_name @// server_name / share_name : ********
mount -t cifs -o username= DOMAIN \ Administrator ,seal,vers=3.0 // server / example /mnt/ Password for user_name @// server_name / share_name : ********
// server_name / share_name /mnt cifs credentials= /root/smb.cred 0 0
mount /mnt/
username= user_name password= password domain= domain_name
chown user_name ~/smb.cred # chmod 600 ~/smb.cred
// server_name / share_name /mnt cifs multiuser,sec=ntlmssp, credentials= /root/smb.cred 0 0
mount /mnt/
mount // server_name / share_name on /mnt type cifs (sec=ntlmssp, multiuser ,...)
cifscreds add -u SMB_user_name server_name Password: ********
dir /path/to/cache
dir /var/cache/fscache
semanage fcontext -a -e /var/cache/fscache /path/to/cache # restorecon -Rv /path/to/cache
semanage permissive -a cachefilesd_t # semanage permissive -a cachefiles_kernel_t
tune2fs -o user_xattr /dev/ device
mount /dev/ device /path/to/cache -o user_xattr
systemctl start cachefilesd
systemctl enable cachefilesd
mount nfs-share :/ /mount/point -o fsc
cat /proc/fs/fscache/stats
dmraid -r -E / device /
parted /dev/sda
partx --update --nr partition-number disk
(parted) print
Model: ATA ST3160812AS (scsi) Disk /dev/sda: 160GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 107MB 107MB primary ext3 boot 2 107MB 105GB 105GB primary ext3 3 105GB 107GB 2147MB primary linux-swap 4 107GB 160GB 52.9GB extended root 5 107GB 133GB 26.2GB logical ext3 6 133GB 133GB 107MB logical ext3 7 133GB 160GB 26.6GB logical lvm
(parted) select /dev/sda
parted /dev/sda
(parted) print
(parted) mkpart part-type name fs-type start end
(parted) mkpart primary 1024 2048
(parted) print
(parted) quit
cat /proc/partitions
mkfs.ext4 /dev/ sda6
e2label /dev/sda6 "Work"
systemctl daemon-reload
mount /work
parted device
(parted) print
(parted) rm 3
(parted) print
(parted) quit
cat /proc/partitions
systemctl daemon-reload
fdisk /dev/sdc Command (m for help): t Selected partition 1 Partition type (type L to list all types): 83 Changed type of partition 'Linux LVM' to 'Linux'.
parted /dev/sdc 'set 1 lvm off'
umount /dev/vda
fdisk /dev/vda Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help):
Command (m for help): p Disk /dev/vda: 16.1 GB, 16106127360 bytes, 31457280 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: dos Disk identifier: 0x0006d09a Device Boot Start End Blocks Id System /dev/vda1 * 2048 1026047 512000 83 Linux /dev/vda2 1026048 31457279 15215616 8e Linux LVM
Command (m for help): d Partition number (1,2, default 2): 2 Partition 2 is deleted
Command (m for help): n Partition type: p primary (1 primary, 0 extended, 3 free) e extended Select (default p): *Enter* Using default response p Partition number (2-4, default 2): *Enter* First sector (1026048-31457279, default 1026048): *Enter* Using default value 1026048 Last sector, +sectors or +size{K,M,G} (1026048-31457279, default 31457279): +500M Partition 2 of type Linux and of size 500 MiB is set
Command (m for help): t Partition number (1,2, default 2): *Enter* Hex code (type L to list all codes): 8e Changed type of partition 'Linux' to 'Linux LVM'
e2fsck /dev/vda e2fsck 1.41.12 (17-May-2010) Pass 1:Checking inodes, blocks, and sizes Pass 2:Checking directory structure Pass 3:Checking directory connectivity Pass 4:Checking reference counts Pass 5:Checking group summary information ext4-1:11/131072 files (0.0% non-contiguous),27050/524128 blocks
mount /dev/vda
snapper -c config_name create-config -f "lvm( fs_type )" /mount-point
snapper -c lvm_config create-config -f "lvm(ext4)" /lvm_mount
snapper -c config_name create-config -f btrfs /mount-point
snapper -c btrfs_config create-config -f btrfs /btrfs_mount
snapper -c config_name create -t pre
snapper -c SnapperExample create -t pre -p 1
snapper -c config_name list
snapper -c lvm_config list Type | # | Pre # | Date | User | Cleanup | Description | Userdata -------+---+-------+-------------------+------+----------+-------------+--------- single | 0 | | | root | | current | pre | 1 | | Mon 06<...> | root | | |
snapper -c config_file create -t post --pre-num pre_snapshot_number
snapper -c lvm_config create -t post --pre-num 1 -p 2
snapper -c lvm_config list Type | # | Pre # | Date | User | Cleanup | Description | Userdata -------+---+-------+-------------------+------+----------+-------------+--------- single | 0 | | | root | | current | pre | 1 | | Mon 06<...> | root | | | post | 2 | 1 | Mon 06<...> | root | | |
snapper -c lvm_config create --command " command_to_be_tracked "
snapper -c lvm_config create --command "echo Hello > /lvm_mount/hello_file"
snapper -c config_file status first_snapshot_number .. second_snapshot_number
snapper -c lvm_config status 3..4 +..... /lvm_mount/hello_file
snapper -c config_name create -t single
snapper -c lvm_config create -t single
snapper -c config_file status first_snapshot_number .. second_snapshot_number
snapper -c lvm_config status 1..2 tp.... /lvm_mount/dir1 -..... /lvm_mount/dir1/file_a c.ug.. /lvm_mount/file2 +..... /lvm_mount/file3 ....x. /lvm_mount/file4 cp..xa /lvm_mount/file5
+..... /lvm_mount/file3 |||||| 123456
snapper -c config_name diff first_snapshot_number .. second_snapshot_number
snapper -c lvm_config diff 1..2 --- /lvm_mount/.snapshots/13/snapshot/file4 19<...> +++ /lvm_mount/.snapshots/14/snapshot/file4 20<...> @@ -0,0 +1 @@ +words
snapper -c config_name xadiff first_snapshot_number .. second_snapshot_number
snapper -c lvm_config xadiff 1..2
snapper -c config_name undochange 1 .. 2
snapper -c config_name delete snapshot_number
swapoff -v /dev/VolGroup00/LogVol01
lvresize /dev/VolGroup00/LogVol01 -L +2G
mkswap /dev/VolGroup00/LogVol01
swapon -v /dev/VolGroup00/LogVol01
cat /proc/swaps free -h
lvcreate VolGroup00 -n LogVol02 -L 2G
mkswap /dev/VolGroup00/LogVol02
/dev/VolGroup00/LogVol02 swap swap defaults 0 0
systemctl daemon-reload
swapon -v /dev/VolGroup00/LogVol02
cat /proc/swaps free -h
dd if=/dev/zero of=/swapfile bs=1024 count= 65536
mkswap /swapfile
chmod 0600 /swapfile
/swapfile swap swap defaults 0 0
systemctl daemon-reload
swapon /swapfile
cat /proc/swaps free -h
swapoff -v /dev/VolGroup00/LogVol01
lvreduce /dev/VolGroup00/LogVol01 -L -512M
mkswap /dev/VolGroup00/LogVol01
swapon -v /dev/VolGroup00/LogVol01
cat /proc/swaps free -h
swapoff -v /dev/VolGroup00/LogVol02
lvremove /dev/VolGroup00/LogVol02
/dev/VolGroup00/LogVol02 swap swap defaults 0 0
systemctl daemon-reload
vi /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
cat /proc/swaps free -h
swapoff -v /swapfile
systemctl daemon-reload
rm /swapfile
yum install system-storage-manager
ssm list ---------------------------------------------------------- Device Free Used Total Pool Mount point ---------------------------------------------------------- /dev/sda 2.00 GB PARTITIONED /dev/sda1 47.83 MB /test /dev/vda 15.00 GB PARTITIONED /dev/vda1 500.00 MB /boot /dev/vda2 0.00 KB 14.51 GB 14.51 GB rhel ---------------------------------------------------------- ------------------------------------------------ Pool Type Devices Free Used Total ------------------------------------------------ rhel lvm 1 0.00 KB 14.51 GB 14.51 GB ------------------------------------------------ --------------------------------------------------------------------------------- Volume Pool Volume size FS FS size Free Type Mount point --------------------------------------------------------------------------------- /dev/rhel/root rhel 13.53 GB xfs 13.52 GB 9.64 GB linear / /dev/rhel/swap rhel 1000.00 MB linear /dev/sda1 47.83 MB xfs 44.50 MB 44.41 MB part /test /dev/vda1 500.00 MB xfs 496.67 MB 403.56 MB part /boot ---------------------------------------------------------------------------------
ssm create --fs xfs -s 1G /dev/vdb /dev/vdc Physical volume "/dev/vdb" successfully created Physical volume "/dev/vdc" successfully created Volume group "lvm_pool" successfully created Logical volume "lvol001" created
ssm create --fs xfs -p new_pool -n XFS_Volume /dev/vdd Volume group "new_pool" successfully created Logical volume "XFS_Volume" created
ssm check /dev/lvm_pool/lvol001 Checking xfs file system on '/dev/mapper/lvm_pool-lvol001'. Phase 1 - find and verify superblock Phase 2 - using internal log - scan filesystem freespace and inode maps - found root inode chunk Phase 3 - for each AG - scan (but don't clear) agi unlinked lists - process known inodes and perform inode discovery - agno = 0 - agno = 1 - agno = 2 - agno = 3 - agno = 4 - agno = 5 - agno = 6 - process newly discovered inodes Phase 4 - check for duplicate blocks - setting up duplicate extent list - check for inodes claiming duplicate blocks - agno = 0 - agno = 1 - agno = 2 - agno = 3 - agno = 4 - agno = 5 - agno = 6 No modify flag set, skipping phase 5 Phase 6 - check inode connectivity - traversing filesystem - traversal finished - moving disconnected inodes to lost+found Phase 7 - verify link counts No modify flag set, skipping filesystem flush and exiting.
ssm list ----------------------------------------------------------------- Device Free Used Total Pool Mount point ----------------------------------------------------------------- /dev/vda 15.00 GB PARTITIONED /dev/vda1 500.00 MB /boot /dev/vda2 0.00 KB 14.51 GB 14.51 GB rhel /dev/vdb 120.00 MB 900.00 MB 1.00 GB lvm_pool /dev/vdc 1.00 GB ----------------------------------------------------------------- --------------------------------------------------------- Pool Type Devices Free Used Total --------------------------------------------------------- lvm_pool lvm 1 120.00 MB 900.00 MB 1020.00 MB rhel lvm 1 0.00 KB 14.51 GB 14.51 GB --------------------------------------------------------- -------------------------------------------------------------------------------------------- Volume Pool Volume size FS FS size Free Type Mount point -------------------------------------------------------------------------------------------- /dev/rhel/root rhel 13.53 GB xfs 13.52 GB 9.64 GB linear / /dev/rhel/swap rhel 1000.00 MB linear /dev/lvm_pool/lvol001 lvm_pool 900.00 MB xfs 896.67 MB 896.54 MB linear /dev/vda1 500.00 MB xfs 496.67 MB 403.56 MB part /boot --------------------------------------------------------------------------------------------
~]# ssm resize -s +500M /dev/lvm_pool/lvol001 /dev/vdc Physical volume "/dev/vdc" successfully created Volume group "lvm_pool" successfully extended Phase 1 - find and verify superblock Phase 2 - using internal log - scan filesystem freespace and inode maps - found root inode chunk Phase 3 - for each AG - scan (but don't clear) agi unlinked lists - process known inodes and perform inode discovery - agno = 0 - agno = 1 - agno = 2 - agno = 3 - process newly discovered inodes Phase 4 - check for duplicate blocks - setting up duplicate extent list - check for inodes claiming duplicate blocks - agno = 0 - agno = 1 - agno = 2 - agno = 3 No modify flag set, skipping phase 5 Phase 6 - check inode connectivity - traversing filesystem - traversal finished - moving disconnected inodes to lost+found Phase 7 - verify link counts No modify flag set, skipping filesystem flush and exiting. Extending logical volume lvol001 to 1.37 GiB Logical volume lvol001 successfully resized meta-data=/dev/mapper/lvm_pool-lvol001 isize=256 agcount=4, agsize=57600 blks = sectsz=512 attr=2, projid32bit=1 = crc=0 data = bsize=4096 blocks=230400, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=0 log =internal bsize=4096 blocks=853, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 data blocks changed from 230400 to 358400
ssm list ------------------------------------------------------------------ Device Free Used Total Pool Mount point ------------------------------------------------------------------ /dev/vda 15.00 GB PARTITIONED /dev/vda1 500.00 MB /boot /dev/vda2 0.00 KB 14.51 GB 14.51 GB rhel /dev/vdb 0.00 KB 1020.00 MB 1.00 GB lvm_pool /dev/vdc 640.00 MB 380.00 MB 1.00 GB lvm_pool ------------------------------------------------------------------ ------------------------------------------------------ Pool Type Devices Free Used Total ------------------------------------------------------ lvm_pool lvm 2 640.00 MB 1.37 GB 1.99 GB rhel lvm 1 0.00 KB 14.51 GB 14.51 GB ------------------------------------------------------ ---------------------------------------------------------------------------------------------- Volume Pool Volume size FS FS size Free Type Mount point ---------------------------------------------------------------------------------------------- /dev/rhel/root rhel 13.53 GB xfs 13.52 GB 9.64 GB linear / /dev/rhel/swap rhel 1000.00 MB linear /dev/lvm_pool/lvol001 lvm_pool 1.37 GB xfs 1.36 GB 1.36 GB linear /dev/vda1 500.00 MB xfs 496.67 MB 403.56 MB part /boot ----------------------------------------------------------------------------------------------
ssm resize -s-50M /dev/lvm_pool/lvol002 Rounding size to boundary between physical extents: 972.00 MiB WARNING: Reducing active logical volume to 972.00 MiB THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce lvol002? [y/n]: y Reducing logical volume lvol002 to 972.00 MiB Logical volume lvol002 successfully resized
ssm snapshot /dev/lvm_pool/lvol001 Logical volume "snap20150519T130900" created
ssm list ---------------------------------------------------------------- Device Free Used Total Pool Mount point ---------------------------------------------------------------- /dev/vda 15.00 GB PARTITIONED /dev/vda1 500.00 MB /boot /dev/vda2 0.00 KB 14.51 GB 14.51 GB rhel /dev/vdb 0.00 KB 1020.00 MB 1.00 GB lvm_pool /dev/vdc 1.00 GB ---------------------------------------------------------------- -------------------------------------------------------- Pool Type Devices Free Used Total -------------------------------------------------------- lvm_pool lvm 1 0.00 KB 1020.00 MB 1020.00 MB rhel lvm 1 0.00 KB 14.51 GB 14.51 GB -------------------------------------------------------- ---------------------------------------------------------------------------------------------- Volume Pool Volume size FS FS size Free Type Mount point ---------------------------------------------------------------------------------------------- /dev/rhel/root rhel 13.53 GB xfs 13.52 GB 9.64 GB linear / /dev/rhel/swap rhel 1000.00 MB linear /dev/lvm_pool/lvol001 lvm_pool 900.00 MB xfs 896.67 MB 896.54 MB linear /dev/vda1 500.00 MB xfs 496.67 MB 403.56 MB part /boot ---------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------- Snapshot Origin Pool Volume size Size Type ---------------------------------------------------------------------------------- /dev/lvm_pool/snap20150519T130900 lvol001 lvm_pool 120.00 MB 0.00 KB linear ----------------------------------------------------------------------------------
ssm remove lvm_pool Do you really want to remove volume group "lvm_pool" containing 2 logical volumes? [y/n]: y Do you really want to remove active logical volume snap20150519T130900? [y/n]: y Logical volume "snap20150519T130900" successfully removed Do you really want to remove active logical volume lvol001? [y/n]: y Logical volume "lvol001" successfully removed Volume group "lvm_pool" successfully removed
vim /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 none /dev/pts devpts gid=5,mode=620 0 0 none /dev/shm tmpfs defaults 0 0 none /proc proc defaults 0 0 none /sys sysfs defaults 0 0 /dev/VolGroup00/LogVol02 /home ext3 defaults,usrquota,grpquota 1 2 /dev/VolGroup00/LogVol01 swap swap defaults 0 0 . . .
quotacheck -cug / file system
quotacheck -avug
edquota username
quota username
Disk quotas for user testuser (uid 501): Filesystem blocks soft hard inodes soft hard /dev/VolGroup00/LogVol02 440436 0 0 37418 0 0
Disk quotas for user testuser (uid 501): Filesystem blocks soft hard inodes soft hard /dev/VolGroup00/LogVol02 440436 500000 550000 37418 0 0
quota testuser Disk quotas for user username (uid 501): Filesystem blocks quota limit grace files quota limit grace /dev/sdb 1000* 1000 1000 0 0 0
edquota -g groupname
quota -g groupname
edquota -g devel
Disk quotas for group devel (gid 505): Filesystem blocks soft hard inodes soft hard /dev/VolGroup00/LogVol02 440400 0 0 37418 0 0
quota -g devel
edquota -t
quotaoff -vaug
quotaon
quotaon -vaug
quotaon -vug /home
*** Report for user quotas on device /dev/mapper/VolGroup00-LogVol02 Block grace time: 7days; Inode grace time: 7days Block limits File limits User used soft hard grace used soft hard grace ---------------------------------------------------------------------- root -- 36 0 0 4 0 0 kristin -- 540 0 0 125 0 0 testuser -- 440400 500000 550000 37418 0 0
repquota -a
quotacheck
crontab -e
quotaoff -vug / file_system
quotacheck -vug / file_system
quotaon -vug / file_system
dd if=/dev/sda1 of=/dev/sdb1
parted /dev/sda set 1 prep on USD parted /dev/sda set 1 boot on USD parted /dev/sdb set 1 prep on USD parted /dev/sdb set 1 boot on
mount
findmnt
mount -t type
findmnt -t type
mount -t ext4 /dev/sda2 on / type ext4 (rw) /dev/sda1 on /boot type ext4 (rw)
findmnt -t ext4 TARGET SOURCE FSTYPE OPTIONS / /dev/sda2 ext4 rw,realtime,seclabel,barrier=1,data=ordered /boot /dev/sda1 ext4 rw,realtime,seclabel,barrier=1,data=ordered
mount [ option ... ] device directory
findmnt directory ; echo USD?
mount [ option ... ] directory mount [ option ... ] device
blkid device
blkid /dev/sda3 /dev/sda3: LABEL="home" UUID="34795a28-ca6d-4fd8-a347-73671d0c19cb" TYPE="ext3"
mount -t type device directory
~]# mount -t vfat /dev/sdc1 /media/flashdisk
mount -o options device directory
mount -o ro,loop Fedora-14-x86_64-Live-Desktop.iso /media/cdrom
mount --bind old_directory new_directory
mount --rbind old_directory new_directory
mount --make-shared mount_point
mount --make-rshared mount_point
mount --bind /media /media # mount --make-shared /media
mount --bind /media /mnt
mount /dev/cdrom /media/cdrom # ls /media/cdrom EFI GPL isolinux LiveOS # ls /mnt/cdrom EFI GPL isolinux LiveOS
# mount /dev/sdc1 /mnt/flashdisk # ls /media/flashdisk en-US publican.cfg # ls /mnt/flashdisk en-US publican.cfg
mount --make-slave mount_point
mount --make-rslave mount_point
~]# mount --bind /media /media ~]# mount --make-shared /media
~]# mount --bind /media /mnt ~]# mount --make-slave /mnt
~]# mount /dev/cdrom /media/cdrom ~]# ls /media/cdrom EFI GPL isolinux LiveOS ~]# ls /mnt/cdrom EFI GPL isolinux LiveOS
~]# mount /dev/sdc1 /mnt/flashdisk ~]# ls /media/flashdisk ~]# ls /mnt/flashdisk en-US publican.cfg
mount --make-private mount_point
mount --make-rprivate mount_point
~]# mount --bind /media /media ~]# mount --make-shared /media ~]# mount --bind /media /mnt
~]# mount --make-private /mnt
~]# mount /dev/cdrom /media/cdrom ~]# ls /media/cdrom EFI GPL isolinux LiveOS ~]# ls /mnt/cdrom ~]#
~]# mount /dev/sdc1 /mnt/flashdisk ~]# ls /media/flashdisk ~]# ls /mnt/flashdisk en-US publican.cfg
mount --make-unbindable mount_point
mount --make-runbindable mount_point
mount --bind /media /media # mount --make-unbindable /media
mount --bind /media /mnt mount: wrong fs type, bad option, bad superblock on /media, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so
mount --move old_directory new_directory
mount --move /mnt/userdirs /home
ls /mnt/userdirs # ls /home jill joe
Set to 'yes' to mount the file systems as read-only. READONLY=yes [output truncated]
/dev/mapper/luks-c376919e... / ext4 ro ,x-systemd.device-timeout=0 1 1
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet ro "
grub2-mkconfig -o /boot/grub2/grub.cfg
files /etc/example/file
mount -o remount,rw /
mount -o remount,ro /
dirs /var/cache/man dirs /var/gdm [output truncated] empty /tmp empty /var/cache/foomatic [output truncated] files /etc/adjtime files /etc/ntp.conf [output truncated]
how the file or directory is copied to tmpfs path to the file or directory
umount directory USD umount device
fuser -m directory
fuser -m /media/cdrom /media/cdrom: 1793 2013 2022 2435 10532c 10672c
umount /media/cdrom
volume_key [OPTION]... OPERAND
volume_key --save /path/to/volume -o escrow-packet
volume_key --restore /path/to/volume escrow-packet
certutil -d /the/nss/directory -N
pk12util -d /the/nss/directory -i the-pkcs12-file
volume_key --save /path/to/volume -c /path/to/cert escrow-packet
volume_key --reencrypt -d /the/nss/directory escrow-packet-in -o escrow-packet-out
volume_key --restore /path/to/volume escrow-packet-out
volume_key --save /path/to/volume -c /path/to/ert --create-random-passphrase passphrase-packet
volume_key --secrets -d /your/nss/directory passphrase-packet
hdparm -I /dev/sda | grep TRIM Data Set Management TRIM supported (limit 8 block) Deterministic read data after TRIM
cat /sys/block/ disk-name /queue/discard_zeroes_data
options raid456 devices_handle_discard_safely=Y
cat /sys/block/ disk-name /queue/discard_zeroes_data
raid456.devices_handle_discard_safely=Y
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
mount -t ext4 -o discard /dev/sda2 /mnt
hdparm -W0 / device /
MegaCli64 -LDGetProp -DskCache -LAll -aALL
MegaCli64 -LDSetProp -DisDskCache -Lall -aALL
alignment_offset: 0 physical_block_size: 512 logical_block_size: 512 minimum_io_size: 512 optimal_io_size: 0
sg_inq -p 0xb0 disk
add_dracutmodules+=" nfs"
systemctl enable --now tftp
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
mkdir -p /var/lib/tftpboot/pxelinux.cfg/
allow booting; allow bootp; class "pxeclients" { match if substring(option vendor-class-identifier, 0, 9) = "PXEClient"; next-server server-ip ; filename "pxelinux.0"; }
rsync -a -e ssh --exclude='/proc/*' --exclude='/sys/*' hostname.com :/ exported-root-directory
yum install @Base kernel dracut-network nfs-utils --installroot= exported-root-directory --releasever=/
cp /boot/vmlinuz- kernel-version /var/lib/tftpboot/
dracut --add nfs initramfs- kernel-version .img kernel-version
chmod 644 initramfs- kernel-version .img
default rhel7 label rhel7 kernel vmlinuz- kernel-version append initrd=initramfs- kernel-version .img root=nfs: server-ip : /exported/root/directory rw
systemctl start target # systemctl enable target
yum install targetcli
systemctl start target
systemctl enable target
firewall-cmd --permanent --add-port=3260/tcp Success # firewall-cmd --reload Success
targetcli : /> ls o- /........................................[...] o- backstores.............................[...] | o- block.................[Storage Objects: 0] | o- fileio................[Storage Objects: 0] | o- pscsi.................[Storage Objects: 0] | o- ramdisk...............[Storage Ojbects: 0] o- iscsi...........................[Targets: 0] o- loopback........................[Targets: 0]
/> /backstores/fileio create file1 /tmp/disk1.img 200M write_back=false Created fileio file1 with size 209715200
fdisk /dev/ vdb Welcome to fdisk (util-linux 2.23.2). 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 Building a new DOS disklabel with disk identifier 0x39dc48fb. Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): *Enter* Using default response p Partition number (1-4, default 1): *Enter* First sector (2048-2097151, default 2048): *Enter* Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151): +250M Partition 1 of type Linux and of size 250 MiB is set Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
/> /backstores/block create name=block_backend dev=/dev/ vdb Generating a wwn serial. Created block storage object block_backend using /dev/ vdb .
/> backstores/pscsi/ create name=pscsi_backend dev=/dev/sr0 Generating a wwn serial. Created pscsi storage object pscsi_backend using /dev/sr0
/> backstores/ramdisk/ create name=rd_backend size=1GB Generating a wwn serial. Created rd_mcp ramdisk rd_backend with size 1GB.
/> iscsi/
/iscsi> create Created target iqn.2003-01.org.linux-iscsi.hostname.x8664:sn.78b473f296ff Created TPG1
/iscsi > create iqn.2006-04.com.example:444 Created target iqn.2006-04.com.example:444 Created TPG1
/iscsi > ls o- iscsi.......................................[1 Target] o- iqn.2006-04.com.example:444................[1 TPG] o- tpg1...........................[enabled, auth] o- acls...............................[0 ACL] o- luns...............................[0 LUN] o- portals.........................[0 Portal]
/iscsi> iqn.2006-04.example:444/tpg1/
/iscsi/iqn.20...mple:444/tpg1> portals/ create Using default IP port 3260 Binding to INADDR_Any (0.0.0.0) Created network portal 0.0.0.0:3260
/iscsi/iqn.20...mple:444/tpg1> portals/ create 192.168.122.137 Using default IP port 3260 Created network portal 192.168.122.137:3260
/iscsi/iqn.20...mple:444/tpg1> ls o- tpg.................................. [enambled, auth] o- acls ......................................[0 ACL] o- luns ......................................[0 LUN] o- portals ................................[1 Portal] o- 192.168.122.137:3260......................[OK]
/iscsi/iqn.20...mple:444/tpg1> luns/ create /backstores/ramdisk/rd_backend Created LUN 0. /iscsi/iqn.20...mple:444/tpg1> luns/ create /backstores/block/block_backend Created LUN 1. /iscsi/iqn.20...mple:444/tpg1> luns/ create /backstores/fileio/file1 Created LUN 2.
/iscsi/iqn.20...mple:444/tpg1> ls o- tpg.................................. [enambled, auth] o- acls ......................................[0 ACL] o- luns .....................................[3 LUNs] | o- lun0.........................[ramdisk/ramdisk1] | o- lun1.................[block/block1 (/dev/vdb1)] | o- lun2...................[fileio/file1 (/foo.img)] o- portals ................................[1 Portal] o- 192.168.122.137:3260......................[OK]
/> set global auto_add_mapped_luns=false Parameter auto_add_mapped_luns is now 'false'.
/> iscsi/iqn.2015-06.com.redhat:target/tpg1/acls/iqn.2015-06.com.redhat:initiator/ create mapped_lun=1 tpg_lun_or_backstore=/backstores/block/block2 write_protect=1 Created LUN 1. Created Mapped LUN 1. /> ls o- / ...................................................... [...] o- backstores ........................................... [...] <snip> o- iscsi ......................................... [Targets: 1] | o- iqn.2015-06.com.redhat:target .................. [TPGs: 1] | o- tpg1 ............................ [no-gen-acls, no-auth] | o- acls ....................................... [ACLs: 2] | | o- iqn.2015-06.com.redhat:initiator .. [Mapped LUNs: 2] | | | o- mapped_lun0 .............. [lun0 block/disk1 (rw)] | | | o- mapped_lun1 .............. [lun1 block/disk2 (ro)] | o- luns ....................................... [LUNs: 2] | | o- lun0 ...................... [block/disk1 (/dev/vdb)] | | o- lun1 ...................... [block/disk2 (/dev/vdc)] <snip>
/iscsi/iqn.20...mple:444/tpg1> acls/
/iscsi/iqn.20...444/tpg1/acls> create iqn.2006-04.com.example.foo:888 Created Node ACL for iqn.2006-04.com.example.foo:888 Created mapped LUN 2. Created mapped LUN 1. Created mapped LUN 0.
/iscsi/iqn.20...scsi:444/tpg1> set attribute generate_node_acls=1
/iscsi/iqn.20...444/tpg1/acls> ls o- acls .................................................[1 ACL] o- iqn.2006-04.com.example.foo:888 ....[3 Mapped LUNs, auth] o- mapped_lun0 .............[lun0 ramdisk/ramdisk1 (rw)] o- mapped_lun1 .................[lun1 block/block1 (rw)] o- mapped_lun2 .................[lun2 fileio/file1 (rw)]
/> tcm_fc/ create 00:11:22:33:44:55:66:77
/> tcm_fc/ 00:11:22:33:44:55:66:77
/> luns/ create /backstores/fileio/ example2
/> acls/ create 00:99:88:77:66:55:44:33
/> /backstores/ backstore-type / backstore-name
/> /iscsi/ iqn-name /tpg/ acls / delete iqn-name
/> /iscsi delete iqn-name
yum install iscsi-initiator-utils -y
cat /etc/iscsi/initiatorname.iscsi InitiatorName=iqn.2006-04.com.example.node1 # vi /etc/iscsi/initiatorname.iscsi
iscsiadm -m discovery -t st -p target-ip-address 10.64.24.179:3260,1 iqn.2006-04.com.example:3260
iscsiadm -m node -T iqn.2006-04.com.example:3260 -l Logging in to [iface: default, target: iqn.2006-04.com.example:3260, portal: 10.64.24.179,3260] (multiple) Login to [iface: default, target: iqn.2006-04.com.example:3260, portal: 10.64.24.179,3260] successful.
grep "Attached SCSI" /var/log/messages # mkfs.ext4 /dev/ disk_name
mkdir /mount/point # mount /dev/ disk_name /mount/point
vim /etc/fstab /dev/ disk_name /mount/point ext4 _netdev 0 0
iscsiadm -m node -T iqn.2006-04.com.example:3260 -u
/iscsi/iqn.20...mple:444/tpg1> set attribute authentication=1 Parameter authentication is now '1'.
/iscsi/iqn.20...mple:444/tpg1> set auth userid= redhat Parameter userid is now 'redhat'. /iscsi/iqn.20...mple:444/tpg1> set auth password= redhat_passwd Parameter password is now 'redhat_passwd'.
vi /etc/iscsi/iscsid.conf node.session.auth.authmethod = CHAP
node.session.auth.username = redhat node.session.auth.password = redhat_passwd
systemctl restart iscsid.service
options qla2xxx qlini_mode=disabled
cp /etc/fcoe/cfg-ethx /etc/fcoe/cfg-eth X
systemctl start lldpad
dcbtool sc eth X dcb on
dcbtool sc eth X app:fcoe e:1
ip link set dev eth X up
systemctl start fcoe
fcoeadm -i
systemctl enable lldpad
systemctl enable fcoe
mount_fcoe_disks_from_fstab() { local timeout=20 local done=1 local fcoe_disks=(USD(egrep 'by-path\/fc-.*_netdev' /etc/fstab | cut -d ' ' -f1)) test -z USDfcoe_disks && return 0 echo -n "Waiting for fcoe disks . " while [ USDtimeout -gt 0 ]; do for disk in USD{fcoe_disks[*]}; do if ! test -b USDdisk; then done=0 break fi done test USDdone -eq 1 && break; sleep 1 echo -n ". " done=1 let timeout-- done if test USDtimeout -eq 0; then echo "timeout!" else echo "done!" fi # mount any newly discovered disk mount -a 2>/dev/null }
/dev/disk/by-path/fc-0xXX:0xXX /mnt/fcoe-disk1 ext3 defaults,_netdev 0 0 /dev/disk/by-path/fc-0xYY:0xYY /mnt/fcoe-disk2 ext3 defaults,_netdev 0 0
iscsiadm -m session -P 3
iscsiadm -m session -P 0
iscsiadm -m session
driver [ sid ] target_ip:port,target_portal_group_tag proper_target_name
iscsiadm -m session tcp [2] 10.15.84.19:3260,2 iqn.1992-08.com.netapp:sn.33615311 tcp [3] 10.15.85.19:3260,3 iqn.1992-08.com.netapp:sn.33615311
scsi-3600508b400105e210000900000490000 -> ../../sda
scsi-SSEAGATE_ST373453LW_3HW1RHM6 -> ../../sda
3600508b400105df70000e00000ac0000 dm-2 vendor,product [size=20G][features=1 queue_if_no_path][hwhandler=0][rw] \_ round-robin 0 [prio=0][active] \_ 5:0:1:1 sdc 8:32 [active][undef] \_ 6:0:1:1 sdg 8:96 [active][undef] \_ round-robin 0 [prio=0][enabled] \_ 5:0:0:1 sdb 8:16 [active][undef] \_ 6:0:0:1 sdf 8:80 [active][undef]
/dev/disk/by-label/Boot
LABEL=Boot
UUID=3e6be9de-8139-11d1-9106-a43f08d823a6
/dev/disk/by-id/scsi-3600508e000000000ce506dc50ab0ad05
/dev/disk/by-id/wwn-0x600508e000000000ce506dc50ab0ad05
/dev/disk/by-id/scsi-3600508e000000000ce506dc50ab0ad05-part1
/dev/disk/by-id/wwn-0x600508e000000000ce506dc50ab0ad05-part1
/dev/disk/by-path/pci-0000:03:00.0-scsi-0:1:0:0
/dev/disk/by-path/pci-0000:03:00.0-scsi-0:1:0:0-part1
umount /dev/ device # xfs_admin [ -U new_uuid ] [ -L new_label ] /dev/ device # udevadm settle
tune2fs [ -U new_uuid ] [ -L new_label ] /dev/ device # udevadm settle
blockdev --flushbufs device
echo " c t l " > /sys/class/scsi_host/host h /scan
grep 5006016090203181 /sys/class/fc_transport/*/node_name
/sys/class/fc_transport/target5:0:2/node_name:0x5006016090203181 /sys/class/fc_transport/target5:0:3/node_name:0x5006016090203181 /sys/class/fc_transport/target6:0:2/node_name:0x5006016090203181 /sys/class/fc_transport/target6:0:3/node_name:0x5006016090203181
echo "0 2 56" > /sys/class/scsi_host/host5/scan
iscsiadm -m discovery -t discovery_type -p target_IP : port -o delete
iscsiadm -m discovery -t discovery_type -p target_IP : port
iscsiadm -m discovery -t discovery_type -p target_IP : port -o update -n setting -v % value
ping -I eth X target_IP
iface_name transport_name , hardware_address , ip_address , net_ifacename , initiator_name
iface0 qla4xxx,00:c0:dd:08:63:e8,20.15.0.7,default,iqn.2005-06.com.redhat:madmax iface1 qla4xxx,00:c0:dd:08:63:ea,20.15.0.9,default,iqn.2005-06.com.redhat:madmax
default tcp,<empty>,<empty>,<empty>,<empty> iser iser,<empty>,<empty>,<empty>,<empty> cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty>
iface. setting = value
BEGIN RECORD 2.0-871 iface.iscsi_ifacename = cxgb3i.00:07:43:05:97:07 iface.net_ifacename = <empty> iface.ipaddress = <empty> iface.hwaddress = 00:07:43:05:97:07 iface.transport_name = cxgb3i iface.initiatorname = <empty> END RECORD
iscsiadm -m iface -I iface_name --op=new
iscsiadm -m iface -I iface_name --op=update -n iface. setting -v hw_address
iscsiadm -m iface -I iface0 --op=update -n iface.hwaddress -v 00:0F:1F:92:6B:BF
iscsiadm -m iface -I iface_name -o update -n iface.ipaddress -v initiator_ip_address
iscsiadm -m iface -I cxgb3i.00:07:43:05:97:07 -o update -n iface.ipaddress -v 20.15.0.66
iscsiadm -m discovery -t st -p target_IP:port -I iface_name -P 1 [5]
iscsiadm -m discovery -t st -p IP:port -I default -P 1
iscsiadm -m node -targetname proper_target_name -I iface0 --op=delete [6]
iscsiadm -m node -I iface_name --op=delete
iscsiadm -m node -p IP:port -I iface_name --op=delete
iscsiadm -m discovery -t sendtargets -p target_IP:port [5]
target_IP:port , target_portal_group_tag proper_target_name
10.15.84.19:3260,2 iqn.1992-08.com.netapp:sn.33615311 10.15.85.19:3260,3 iqn.1992-08.com.netapp:sn.33615311
Target: proper_target_name Portal: target_IP:port , target_portal_group_tag Iface Name: iface_name
Target: iqn.1992-08.com.netapp:sn.33615311 Portal: 10.15.84.19:3260,2 Iface Name: iface2 Portal: 10.15.85.19:3260,3 Iface Name: iface2
iscsiadm -m session --rescan
iscsiadm -m session -r SID --rescan [7]
iscsiadm -m discovery -t st -p target_IP -o new
iscsiadm -m discovery -t st -p target_IP -o delete
iscsiadm -m discovery -t st -p target_IP -o delete -o new
ip:port,target_portal_group_tag proper_target_name
10.16.41.155:3260,0 iqn.2001-05.com.equallogic:6-8a0900-ac3fe0101-63aff113e344a4a2-dl585-03-1
iscsiadm --mode node --targetname proper_target_name --portal ip:port,target_portal_group_tag \ --login [8]
iscsiadm --mode node --targetname \ iqn.2001-05.com.equallogic:6-8a0900-ac3fe0101-63aff113e344a4a2-dl585-03-1 \ --portal 10.16.41.155:3260,0 --login [8]
systemctl start iscsi
iscsiadm -m node --targetname proper_target_name -p target_IP:port -o update -n node.startup -v manual
iscsiadm -m node --targetname proper_target_name -p target_IP:port -o delete
/dev/sdb /mnt/iscsi ext3 _netdev 0 0
iscsiadm -m node --targetname proper_target_name -p target_IP:port -l
echo 1 > /sys/block/sd X /device/rescan
iscsiadm -m node --targetname target_name -R [5]
iscsiadm -m node -R -I interface
multipathd -k"resize map multipath_device "
blockdev --getro /dev/sd XYZ
cat /sys/block/sd XYZ /ro 1 = read-only 0 = read-write
36001438005deb4710000500000640000 dm-8 GZ,GZ500 [size=20G][features=0][hwhandler=0][ro] \_ round-robin 0 [prio=200][active] \_ 6:0:4:1 sdax 67:16 [active][ready] \_ 6:0:5:1 sday 67:32 [active][ready] \_ round-robin 0 [prio=40][enabled] \_ 6:0:6:1 sdaz 67:48 [active][ready] \_ 6:0:7:1 sdba 67:64 [active][ready]
blockdev --flushbufs /dev/ device
echo 1 > /sys/block/sd X /device/rescan
echo 1 > /sys/block/sd ax /device/rescan # echo 1 > /sys/block/sd ay /device/rescan # echo 1 > /sys/block/sd az /device/rescan # echo 1 > /sys/block/sd ba /device/rescan
multipath -r
cat /sys/block/ device /device/state
cat /sys/class/fc_remote_port/rport- H : B : R /port_state
echo 30 > /sys/class/fc_remote_port/rport- H : B : R /dev_loss_tmo
features "1 queue_if_no_path"
node.conn[0].timeo.noop_out_interval = [interval value]
node.conn[0].timeo.noop_out_timeout = [timeout value]
iscsiadm -m session -P 3
node.session.timeo.replacement_timeout = [replacement_timeout]
node.conn[0].timeo.noop_out_interval = 0 node.conn[0].timeo.noop_out_timeout = 0
node.session.timeo.replacement_timeout = replacement_timeout
iscsiadm -m node -T target_name -p target_IP : port -o update -n node.session.timeo.replacement_timeout -v USD timeout_value
cat /sys/block/ device-name /device/state
echo running > /sys/block/ device-name /device/state
echo value > /sys/block/ device-name /device/timeout
ls -l /dev/mpath | grep stale-logical-unit
lrwxrwxrwx 1 root root 7 Aug 2 10:33 /3600d0230003414f30000203a7bc41a00 -> ../dm-4 lrwxrwxrwx 1 root root 7 Aug 2 10:33 /3600d0230003414f30000203a7bc41a00p1 -> ../dm-5
/dev/dm-4 /dev/dm-5 /dev/mapper/3600d0230003414f30000203a7bc41a00 /dev/mapper/3600d0230003414f30000203a7bc41a00p1 /dev/mpath/3600d0230003414f30000203a7bc41a00 /dev/mpath/3600d0230003414f30000203a7bc41a00p1
yum install libstoragemgmt libstoragemgmt-python
yum install libstoragemgmt-devel
yum install libstoragemgmt- name -plugin
systemctl status libstoragemgmt
systemctl stop libstoragemgmt
systemctl start libstoragemgmt
lsmcli -u sim://
export LSMCLI_URI=sim://
lsmcli list --type SYSTEMS ID | Name | Status -------+-------------------------------+-------- sim-01 | LSM simulated storage plug-in | OK
lsmcli list --type POOLS -H ID | Name | Total space | Free space | System ID -----+---------------+----------------------+----------------------+----------- POO2 | Pool 2 | 18446744073709551616 | 18446744073709551616 | sim-01 POO3 | Pool 3 | 18446744073709551616 | 18446744073709551616 | sim-01 POO1 | Pool 1 | 18446744073709551616 | 18446744073709551616 | sim-01 POO4 | lsm_test_aggr | 18446744073709551616 | 18446744073709551616 | sim-01
lsmcli volume-create --name volume_name --size 20G --pool POO1 -H ID | Name | vpd83 | bs | #blocks | status | -----+-------------+----------------------------------+-----+----------+--------+---- Vol1 | volume_name | F7DDF7CA945C66238F593BC38137BD2F | 512 | 41943040 | OK |
lsmcli --create-access-group example_ag --id iqn.1994-05.com.domain:01.89bd01 --type ISCSI --system sim-01 ID | Name | Initiator ID |SystemID ---------------------------------+------------+----------------------------------+-------- 782d00c8ac63819d6cca7069282e03a0 | example_ag | iqn.1994-05.com.domain:01.89bd01 |sim-01
lsmcli access-group-create --name example_ag --init iqn.1994-05.com.domain:01.89bd01 --init-type ISCSI --sys sim-01 ID | Name | Initiator IDs | System ID ---------------------------------+------------+----------------------------------+----------- 782d00c8ac63819d6cca7069282e03a0 | example_ag | iqn.1994-05.com.domain:01.89bd01 | sim-01
lsmcli access-group-grant --ag 782d00c8ac63819d6cca7069282e03a0 --vol Vol1 --access RW
lsmcli volume-create --name async_created --size 20G --pool POO1 -b JOB_3
echo USD? 7
lsmcli job-status --job JOB_3 33
echo USD? 7
lsmcli job-status --job JOB_3 ID | Name | vpd83 | Block Size | -----+---------------+----------------------------------+-------------+----- Vol2 | async_created | 855C9BA51991B0CC122A3791996F6B15 | 512 |
lsmcli list --type volumes -t# Vol1#volume_name#049167B5D09EC0A173E92A63F6C3EA2A#512#41943040#21474836480#OK#sim-01#POO1 Vol2#async_created#3E771A2E807F68A32FA5E15C235B60CC#512#41943040#21474836480#OK#sim-01#POO1
lsmcli list --type volumes -t " | " Vol1 | volume_name | 049167B5D09EC0A173E92A63F6C3EA2A | 512 | 41943040 | 21474836480 | OK | 21474836480 | sim-01 | POO1 Vol2 | async_created | 3E771A2E807F68A32FA5E15C235B60CC | 512 | 41943040 | 21474836480 | OK | sim-01 | POO1
lsmcli list --type volumes -s --------------------------------------------- ID | Vol1 Name | volume_name VPD83 | 049167B5D09EC0A173E92A63F6C3EA2A Block Size | 512 #blocks | 41943040 Size | 21474836480 Status | OK System ID | sim-01 Pool ID | POO1 --------------------------------------------- ID | Vol2 Name | async_created VPD83 | 3E771A2E807F68A32FA5E15C235B60CC Block Size | 512 #blocks | 41943040 Size | 21474836480 Status | OK System ID | sim-01 Pool ID | POO1 ---------------------------------------------
yum install ndctl
ndctl list --regions [ { "dev":" region1 ", "size": 34359738368 , "available_size":0, "type":"pmem" }, { "dev":" region0 ", "size": 34359738368 , "available_size":0, "type":"pmem" } ]
ndctl list --namespaces --idle [ { "dev":" namespace1.0 ", "mode":"raw", "size": 34359738368 , "state":"disabled", "numa_node": 1 }, { "dev":" namespace0.0 ", "mode":"raw", "size": 34359738368 , "state":"disabled", "numa_node": 0 } ]
ndctl create-namespace --force --reconfig= namespace0.0 --mode=fsdax --map=mem { "dev":" namespace0.0 ", "mode":"fsdax", "size":" 32.00 GiB (34.36 GB) ", "uuid":" ab91cc8f-4c3e-482e-a86f-78d177ac655d ", "blockdev":" pmem0 ", "numa_node": 0 }
ndctl list --regions [ { "dev":" region5 ", "size": 270582939648 , "available_size": 270582939648 , "type":"pmem", "iset_id": -7337419320239190016 }, { "dev":" region4 ", "size": 270582939648 , "available_size": 270582939648 , "type":"pmem", "iset_id": -137289417188962304 } ]
ndctl create-namespace --region= region4 --mode=fsdax --map=dev --size= 36G { "dev":" namespace4.0 ", "mode":"fsdax", "size":" 35.44 GiB (38.05 GB) ", "uuid":" 9c5330b5-dc90-4f7a-bccd-5b558fa881fe ", "blockdev":"pmem4", "numa_node": 0 }
ndctl create-namespace --region= region4 --mode=fsdax --map=dev --size= 36G { "dev":" namespace4.1 ", "mode":"fsdax", "size":" 35.44 GiB (38.05 GB) ", "uuid":" 91868e21-830c-4b8f-a472-353bf482a26d ", "blockdev":"pmem4.1", "numa_node": 0 }
ndctl create-namespace --region= region4 --mode=devdax --align= 2M --size= 36G { "dev":" namespace4.2 ", "mode":"devdax", "size":" 35.44 GiB (38.05 GB) ", "uuid":" a188c847-4153-4477-81bb-7143e32ffc5c ", "daxregion": { "id": 4 , "size":" 35.44 GiB (38.05 GB) ", "align": 2097152 , "devices":[ { "chardev":" dax4.2 ", "size":" 35.44 GiB (38.05 GB) " }] }, "numa_node": 0 }
ndctl create-namespace --force --reconfig= namespace1.0 --mode=sector { "dev":" namespace1.0 ", "mode":"sector", "size": 17162027008 , "uuid":" 029caa76-7be3-4439-8890-9c2e374bcc76 ", "sector_size":4096, "blockdev":" pmem1s " }
ndctl create-namespace --force --reconfig= namespace0.0 --mode=fsdax --map=mem { "dev":" namespace0.0 ", "mode":"fsdax", "size": 17177772032 , "uuid":" e6944638-46aa-4e06-a722-0b3f16a5acbf ", "blockdev":" pmem0 " }
mkfs -t xfs /dev/ pmem0 # mount -o dax /dev/ pmem0 /mnt/ pmem /
ndctl create-namespace --force --reconfig= namespace0.0 --mode=devdax --align= 2M
modprobe acpi_ipmi
ndctl list --dimms --health { "dev":" nmem0 ", "id":" 802c-01-1513-b3009166 ", "handle": 1 , "phys_id": 22 , "health": { "health_state":" ok ", "temperature_celsius": 25.000000 , "spares_percentage": 99 , "alarm_temperature": false , "alarm_spares": false , "temperature_threshold": 50.000000 , "spares_threshold": 20 , "life_used_percentage": 1 , "shutdown_state":" clean " } }
ndctl list --dimms --regions --health --media-errors --human
ndctl list --dimms --regions --health --media-errors --human "regions":[ { "dev":"region0", "size":"250.00 GiB (268.44 GB)", "available_size":0, "type":"pmem", "numa_node":0, "iset_id":"0xXXXXXXXXXXXXXXXX", "mappings":[ { "dimm":"nmem1", "offset":"0x10000000", "length":"0x1f40000000", "position":1 }, { "dimm":"nmem0", "offset":"0x10000000", "length":"0x1f40000000", "position":0 } ], "badblock_count":1, "badblocks":[ { "offset":65536, "length":1, "dimms":[ "nmem0" ] } ] , "persistence_domain":"memory_controller" } ] }
ndctl list --dimms --human
ndctl list --dimms --human [ { "dev":"nmem1", "id":"XXXX-XX-XXXX-XXXXXXXX", "handle":"0x120", "phys_id":"0x1c" }, { "dev":"nmem0" , "id":"XXXX-XX-XXXX-XXXXXXXX", "handle":"0x20", "phys_id":"0x10" , "flag_failed_flush":true, "flag_smart_event":true } ]
dmidecode
dmidecode Handle 0x0010, DMI type 17, 40 bytes Memory Device Array Handle: 0x0004 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 125 GB Form Factor: DIMM Set: 1 Locator: DIMM-XXX-YYYY Bank Locator: Bank0 Type: Other Type Detail: Non-Volatile Registered (Buffered)
ndctl list --namespaces --dimm= DIMM-ID-number
ndctl list --namespaces --dimm=0 [ { "dev":"namespace0.2" , "mode":"sector", "size":67042312192, "uuid":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "raw_uuid":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "sector_size":4096, "blockdev":"pmem0.2s", "numa_node":0 }, { "dev":"namespace0.0" , "mode":"sector", "size":67042312192, "uuid":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "raw_uuid":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "sector_size":4096, "blockdev":"pmem0s", "numa_node":0 } ]
yum install nvme-cli
modprobe nvme-rdma
nvme discover -t rdma -a 172.31.0.202 -s 4420 Discovery Log Number of Records 1, Generation counter 2 =====Discovery Log Entry 0====== trtype: rdma adrfam: ipv4 subtype: nvme subsystem treq: not specified, sq flow control disable supported portid: 1 trsvcid: 4420 subnqn: testnqn traddr: 172.31.0.202 rdma_prtype: not specified rdma_qptype: connected rdma_cms: rdma-cm rdma_pkey: 0x0000
nvme connect -t rdma -n testnqn -a 172.31.0.202 -s 4420 # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 465.8G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 464.8G 0 part ├─rhel_rdma--virt--03-root 253:0 0 50G 0 lvm / ├─rhel_rdma--virt--03-swap 253:1 0 4G 0 lvm [SWAP] └─rhel_rdma--virt--03-home 253:2 0 410.8G 0 lvm /home nvme0n1 # cat /sys/class/nvme/nvme0/transport rdma
nvme list
nvme disconnect -n testnqn NQN:testnqn disconnected 1 controller(s) # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 465.8G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 464.8G 0 part ├─rhel_rdma--virt--03-root 253:0 0 50G 0 lvm / ├─rhel_rdma--virt--03-swap 253:1 0 4G 0 lvm [SWAP] └─rhel_rdma--virt--03-home 253:2 0 410.8G 0 lvm /home
yum install nvme-cli
nvme gen-hostnqn
options lpfc lpfc_enable_fc4_type=3
dracut --force
systemctl reboot
cat /sys/class/scsi_host/host*/nvme_info NVME Initiator Enabled XRI Dist lpfc0 Total 6144 IO 5894 ELS 250 NVME LPORT lpfc0 WWPN x10000090fae0b5f5 WWNN x20000090fae0b5f5 DID x010f00 ONLINE NVME RPORT WWPN x204700a098cbcac6 WWNN x204600a098cbcac6 DID x01050e TARGET DISCSRVC ONLINE NVME Statistics LS: Xmt 000000000e Cmpl 000000000e Abort 00000000 LS XMIT: Err 00000000 CMPL: xb 00000000 Err 00000000 Total FCP Cmpl 00000000000008ea Issue 00000000000008ec OutIO 0000000000000002 abort 00000000 noxri 00000000 nondlp 00000000 qdepth 00000000 wqerr 00000000 err 00000000 FCP CMPL: xb 00000000 Err 00000000
nvme discover --transport fc \ --traddr nn-0x204600a098cbcac6:pn-0x204700a098cbcac6 \ --host-traddr nn-0x20000090fae0b5f5:pn-0x10000090fae0b5f5 Discovery Log Number of Records 2, Generation counter 49530 =====Discovery Log Entry 0====== trtype: fc adrfam: fibre-channel subtype: nvme subsystem treq: not specified portid: 0 trsvcid: none subnqn: nqn.1992-08.com.netapp:sn.e18bfca87d5e11e98c0800a098cbcac6:subsystem.st14_nvme_ss_1_1 traddr: nn-0x204600a098cbcac6:pn-0x204700a098cbcac6
nvme connect --transport fc --traddr nn-0x204600a098cbcac6:pn-0x204700a098cbcac6 --host-traddr nn-0x20000090fae0b5f5:pn-0x10000090fae0b5f5 -n nqn.1992-08.com.netapp:sn.e18bfca87d5e11e98c0800a098cbcac6:subsystem.st14_nvme_ss_1_1
nvme list Node SN Model Namespace Usage Format FW Rev ---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- -------- /dev/nvme0n1 80BgLFM7xMJbAAAAAAAC NetApp ONTAP Controller 1 107.37 GB / 107.37 GB 4 KiB + 0 B FFFFFFFF # lsblk |grep nvme nvme0n1 259:0 0 100G 0 disk
yum install nvme-cli
nvme gen-hostnqn
rmmod qla2xxx # modprobe qla2xxx
dmesg |grep traddr [ 6.139862] qla2xxx [0000:04:00.0]-ffff:0: register_localport: host-traddr=nn-0x20000024ff19bb62:pn-0x21000024ff19bb62 on portID:10700 [ 6.241762] qla2xxx [0000:04:00.0]-2102:0: qla_nvme_register_remote: traddr=nn-0x203b00a098cbcac6:pn-0x203d00a098cbcac6 PortID:01050d
nvme discover --transport fc --traddr nn-0x203b00a098cbcac6:pn-0x203d00a098cbcac6 --host-traddr nn-0x20000024ff19bb62:pn-0x21000024ff19bb62 Discovery Log Number of Records 2, Generation counter 49530 =====Discovery Log Entry 0====== trtype: fc adrfam: fibre-channel subtype: nvme subsystem treq: not specified portid: 0 trsvcid: none subnqn: nqn.1992-08.com.netapp:sn.c9ecc9187b1111e98c0800a098cbcac6:subsystem.vs_nvme_multipath_1_subsystem_468 traddr: nn-0x203b00a098cbcac6:pn-0x203d00a098cbcac6
nvme connect --transport fc --traddr nn-0x203b00a098cbcac6:pn-0x203d00a098cbcac6 --host_traddr nn-0x20000024ff19bb62:pn-0x21000024ff19bb62 -n nqn.1992-08.com.netapp:sn.c9ecc9187b1111e98c0800a098cbcac6:subsystem.vs_nvme_multipath_1_subsystem_468
nvme list Node SN Model Namespace Usage Format FW Rev ---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- -------- /dev/nvme0n1 80BgLFM7xMJbAAAAAAAC NetApp ONTAP Controller 1 107.37 GB / 107.37 GB 4 KiB + 0 B FFFFFFFF # lsblk |grep nvme nvme0n1 259:0 0 100G 0 disk
yum install vdo kmod-kvdo
vdo create --name= vdo_name --device= block_device --vdoLogicalSize= logical_size [ --vdoSlabSize= slab_size ]
vdo: ERROR - vdoformat: formatVDO failed on '/dev/ device ': VDO Status: Exceeds maximum number of slabs supported
vdo create --name=vdo1 --device=/dev/disk/by-id/scsi-3600508b1001c264ad2af21e903ad031f --vdoLogicalSize=10T
mkfs.xfs -K /dev/mapper/ vdo_name
mkfs.ext4 -E nodiscard /dev/mapper/ vdo_name
mkdir -m 1777 /mnt/ vdo_name # mount /dev/mapper/ vdo_name /mnt/ vdo_name
/dev/mapper/ vdo_name /mnt/ vdo_name xfs defaults,_netdev,x-systemd.device-timeout=0,x-systemd.requires=vdo.service 0 0
/dev/mapper/ vdo_name /mnt/ vdo_name ext4 defaults,_netdev,x-systemd.device-timeout=0,x-systemd.requires=vdo.service 0 0
[Unit] Description = VDO unit file to mount file system name = vdo_name .mount Requires = vdo.service After = multi-user.target Conflicts = umount.target [Mount] What = /dev/mapper/ vdo_name Where = /mnt/ vdo_name Type = xfs [Install] WantedBy = multi-user.target
vdostats --human-readable Device 1K-blocks Used Available Use% Space saving% /dev/mapper/node1osd1 926.5G 21.0G 905.5G 2% 73% /dev/mapper/node1osd2 926.5G 28.2G 898.3G 3% 64%
Oct 2 17:13:39 system lvm[13863]: Monitoring VDO pool vdo_name. Oct 2 17:27:39 system lvm[13863]: WARNING: VDO pool vdo_name is now 80.69% full. Oct 2 17:28:19 system lvm[13863]: WARNING: VDO pool vdo_name is now 85.25% full. Oct 2 17:29:39 system lvm[13863]: WARNING: VDO pool vdo_name is now 90.64% full. Oct 2 17:30:29 system lvm[13863]: WARNING: VDO pool vdo_name is now 96.07% full.
vdo start --name= my_vdo # vdo start --all
vdo stop --name= my_vdo # vdo stop --all
vdo changeWritePolicy --writePolicy= sync|async|auto --name= vdo_name
cat '/sys/block/sda/device/scsi_disk/7:0:0:0/cache_type' write back
cat '/sys/block/sdb/device/scsi_disk/1:2:0:0/cache_type' None
sd 7:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 1:2:0:0: [sdb] Write cache: disabled, read cache: disabled, supports DPO and FUA
vdo remove --name= my_vdo
vdo remove --force --name= my_vdo
[...] A previous operation failed. Recovery from the failure either failed or was interrupted. Add '--force' to 'remove' to perform the following cleanup. Steps to clean up VDO my_vdo : umount -f /dev/mapper/ my_vdo udevadm settle dmsetup remove my_vdo vdo: ERROR - VDO volume my_vdo previous operation (create) is incomplete
vdo stop --name= my_vdo
vdo start --name= my_vdo --forceRebuild
vdo deactivate --name= my_vdo
vdo deactivate --all
vdo activate --name= my_vdo
vdo activate --all
vdo disableDeduplication --name= my_vdo
vdo enableDeduplication --name= my_vdo
vdo disableCompression --name= my_vdo
vdo enableCompression --name= my_vdo
Device 1K-blocks Used Available Use% /dev/mapper/ my_vdo 211812352 105906176 105906176 50%
Oct 2 17:13:39 system lvm[13863]: Monitoring VDO pool my_vdo. Oct 2 17:27:39 system lvm[13863]: WARNING: VDO pool my_vdo is now 80.69% full. Oct 2 17:28:19 system lvm[13863]: WARNING: VDO pool my_vdo is now 85.25% full. Oct 2 17:29:39 system lvm[13863]: WARNING: VDO pool my_vdo is now 90.64% full. Oct 2 17:30:29 system lvm[13863]: WARNING: VDO pool my_vdo is now 96.07% full.
sg_vpd --page=0xb0 /dev/ device
vdo growLogical --name= my_vdo --vdoLogicalSize= new_logical_size
vdo growPhysical --name= my_vdo
vdo { activate | changeWritePolicy | create | deactivate | disableCompression | disableDeduplication | enableCompression | enableDeduplication | growLogical | growPhysical | list | modify | printConfigFile | remove | start | status | stop } [ options... ]
vdostats [ --verbose | --human-readable | --si | --all ] [ --version ] [ device ...]
Device 1K-blocks Used Available Use% Space Saving% /dev/mapper/my_vdo 1932562432 427698104 1504864328 22% 21%
Device Size Used Available Use% Space Saving% /dev/mapper/my_vdo 1.8T 407.9G 1.4T 22% 21%
Device Size Used Available Use% Space Saving% /dev/mapper/my_vdo 2.0T 438G 1.5T 22% 21%
echo "deadline" > /sys/block/ device /queue/scheduler
echo "noop" > /sys/block/ device /queue/scheduler
vdo status --name= my_vdo
vdo create --name=vdo0 --device= /dev/sdb --vdoLogicalSize=1T --writePolicy=async --verbose
vdo create --name=vdo0 --device= /dev/sdb --vdoLogicalSize=1T --writePolicy=sync --verbose
mkfs.xfs -K /dev/mapper/vdo0
mkfs.ext4 -E nodiscard /dev/mapper/vdo0
mkdir /mnt/VDOVolume mount /dev/mapper/vdo0 /mnt/VDOVolume && chmod a+rwx /mnt/VDOVolume
dd if=/dev/urandom of=/mnt/VDOVolume/testfile bs=4096 count=8388608
dd if=/mnt/VDOVolume/testfile of=/home/user/testfile bs=4096
diff -s /mnt/VDOVolume/testfile /home/user/testfile
dd if=/home/user/testfile of=/mnt/VDOVolume/testfile2 bs=4096
diff -s /mnt/VDOVolume/testfile2 /home/user/testfile
umount /mnt/VDOVolume
vdo remove --name=vdo0
vdo list --all | grep vdo
mkdir /mnt/VDOVolume/vdo{01..10}
df -h /mnt/VDOVolume Filesystem Size Used Avail Use% Mounted on /dev/mapper/vdo0 1.5T 198M 1.4T 1% /mnt/VDOVolume
vdostats --verbose | grep "blocks used" data blocks used : 1090 overhead blocks used : 538846 logical blocks used : 6059434
dd if=/dev/urandom of=/mnt/VDOVolume/sourcefile bs=4096 count=1048576 4294967296 bytes (4.3 GB) copied, 540.538 s, 7.9 MB/s
df -h /mnt/VDOVolume Filesystem Size Used Avail Use% Mounted on /dev/mapper/vdo0 1.5T 4.2G 1.4T 1% /mnt/VDOVolume
vdostats --verbose | grep "blocks used" data blocks used : 1050093 (increased by 4GB) overhead blocks used : 538846 (Did not change) logical blocks used : 7108036 (increased by 4GB)
for i in {01..10}; do cp /mnt/VDOVolume/sourcefile /mnt/VDOVolume/vdoUSDi done
df -h /mnt/VDOVolume Filesystem Size Used Avail Use% Mounted on /dev/mapper/vdo0 1.5T 45G 1.3T 4% /mnt/VDOVolume
vdostats --verbose | grep "blocks used" data blocks used : 1050836 (increased by 3M) overhead blocks used : 538846 logical blocks used : 17594127 (increased by 41G)
vdo create --name=vdo0 --device= /dev/sdb --vdoLogicalSize= 10G --verbose --deduplication=disabled --compression=enabled
vdostats --verbose | grep "blocks used"
mkfs.xfs -K /dev/mapper/vdo0
mkfs.ext4 -E nodiscard /dev/mapper/vdo0
mkdir /mnt/VDOVolume mount /dev/mapper/vdo0 /mnt/VDOVolume && chmod a+rwx /mnt/VDOVolume
sync && dmsetup message vdo0 0 sync-dedupe
vdostats --verbose | grep "blocks used"
cp -vR /lib /mnt/VDOVolume sent 152508960 bytes received 60448 bytes 61027763.20 bytes/sec total size is 152293104 speedup is 1.00
sync && dmsetup message vdo0 0 sync-dedupe
vdostats --verbose | grep "blocks used"
umount /mnt/VDOVolume && vdo remove --name=vdo0
fstrim /mnt/VDOVolume
df -m /mnt/VDOVolume
dd if=/dev/urandom of=/mnt/VDOVolume/file bs=1M count=1K
rm /mnt/VDOVolume/file
for depth in 1 2 4 8 16 32 64 128 256 512 1024 2048; do fio --rw=write --bs=4096 --name=vdo --filename=/dev/mapper/vdo0 --ioengine=libaio --numjobs=1 --thread --norandommap --runtime=300 --direct=1 --iodepth=USDdepth --scramble_buffers=1 --offset=0 --size=100g done
z= [see previous step] for iosize in 4 8 16 32 64 128 256 512 1024; do fio --rw=write --bs=USDiosize\k --name=vdo --filename=/dev/mapper/vdo0 --ioengine=libaio --numjobs=1 --thread --norandommap --runtime=300 --direct=1 --iodepth=USDz --scramble_buffers=1 --offset=0 --size=100g done
z= [see previous step] for readmix in 0 10 20 30 40 50 60 70 80 90 100; do for iosize in 4 8 16 32 64 128 256 512 1024; do fio --rw=rw --rwmixread=USDreadmix --bs=USDiosize\k --name=vdo --filename=/dev/mapper/vdo0 --ioengine=libaio --numjobs=1 --thread --norandommap --runtime=300 --direct=0 --iodepth=USDz --scramble_buffers=1 --offset=0 --size=100g done done
for readmix in 20 50 80; do for iosize in 4 8 16 32 64 128 256 512 1024; do fio --rw=rw --rwmixread=USDreadmix --bsrange=4k-256k --name=vdo --filename=/dev/mapper/vdo0 --ioengine=libaio --numjobs=1 --thread --norandommap --runtime=300 --direct=0 --iodepth=USDiosize --scramble_buffers=1 --offset=0 --size=100g done done