Know-How
From Tizen Wiki
How to use iSCSI
# Discover iSCSI targets > sudo iscsiadm -m discovery -t st -p 10.89.62.166 (-m, --mode op) (-t, --type=type --> st == sendtargets) (-p, --portal=ip[:port])
# List discovery records > sudo iscsiadm -m discovery
# Display all data for every discovery > sudo iscsiadm -m discovery -o show
# List node records > sudo iscsiadm -m node
# Display all data for every node > sudo iscsiadm -m node -o show
# Display data for a given target > sudo iscsiadm -m node -T iqn.2016-01.com.sec.vd:island.target-01 -p 10.89.62.166:3260 (-T, --targetname=targetname)
# Display all data for a given target > sudo iscsiadm -m node -T iqn.2016-01.com.sec.vd:island.target-01 -p 10.89.62.166:3260 -o show
# Login > sudo iscsiadm -m node -T iqn.2016-01.com.sec.vd:island.target-01 -p 10.89.62.166:3260 --login (-l, --login)
# List session records > sudo iscsiadm -m session
# Display all data for every session > sudo iscsiadm -m session -o show
# logout a session > sudo iscsiadm -m node -T iqn.2016-01.com.sec.vd:island.target-01 -p 10.89.62.166:3260 --logout
# Logout all sessions > sudo iscsiadm -m session -u > sudo iscsiadm -m node -u (-u, --logout)
# Delete node records > sudo iscsiadm -m node -p 10.89.62.166 --op delete > sudo iscsiadm -m node -p 192.168.0.2 --op delete
# Delete discovery records > sudo iscsiadm -m discovery -p 10.89.62.166 --op delete
- Extend LV and expand ext4 filesystem
- Unmount the filesystem if possible
umount /home
- Extend the LV to use all free space
lvextend -l +100%FREE /dev/vg_home/home
- Check the LV if the filesystem has already been unmounted
e2fsck -f /dev/vg_home/home
- Resize the partition to fill the LV
resize2fs -p /dev/vg_home/home
- Check the LV if the filesystem has already been unmounted
e2fsck -f /dev/vg_home/home
- Mount the LV if the filesystem has already been unmounted
mount /home
- For shrinking a LV, it is better to unmount the file system first to avoid data loss.
- Unmount the filesystem and check its' LV
umount /home e2fsck -f /dev/vg_home/home
- Shrink ext4 and then the LV to the desired size
resize2fs -p /dev/vg_home/home 40G lvreduce -L 40G /dev/vg_home/home
- Before continuing, run e2fsck. If it bails because the partition
- is too small, don't panic! The LV can still be extended with
- lvextend until e2fsck succeeds, e.g.:
- lvextend -L +1G /dev/vg_home/home
e2fsck -f /dev/vg_home/home
- Resize the filesystem to match the LVs size, check and mount it
resize2fs -p /dev/vg_home/home e2fsck -f /dev/vg_home/home
mount /home
- vgdisplay vg_srv
If you want to create an LV that uses the entire VG
- lvcreate -l 100%VG -n srv vg_srv
- lvcreate -L 128GB -n obs vg_srv
Logical volume "obs" created
If you want to create an LV that uses all free PEs in the VG
- lvcreate -l 100%FREE -n obs vg_srv
- mkfs -t ext4 /dev/vg_srv/obs