Following I want to remove an unused disk, in our example it is "backups":
root@pluto:~# iscsiadm -m discovery -t sendtargets -p 192.168.69.1
192.168.69.1:3260,1 iqn.2014-07.ro.gz.sun:backups
192.168.69.1:3260,1 iqn.2014-07.ro.gz.sun:swap-pluto
192.168.69.1:3260,1 iqn.2014-07.ro.gz.sun:backups-file
root@pluto:~# fdisk -l /dev/sdc
Disk /dev/sdc: 375.8 GB, 375809638400 bytes
255 heads, 63 sectors/track, 45689 cylinders, total 734003200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
Disk identifier: 0x00000000
Disk /dev/sdc doesn't contain a valid partition table
So you know the disk, all you have to do is to use the option -u
against it:
-uiscsiadm -m node --targetname iqn.2014-07.ro.gz.sun:backups -u
The command output should look as follows:
root@pluto:~# iscsiadm -m node --targetname iqn.2014-07.ro.gz.sun:backups -u
Logging out of session [sid: 2, target: iqn.2014-07.ro.gz.sun:backups, portal: 192.168.69.1,3260]
Logout of [sid: 2, target: iqn.2014-07.ro.gz.sun:backups, portal: 192.168.69.1,3260] successful.
root@pluto:~# fdisk -l /dev/sdc
root@pluto:~#
Note: no output on fdisk command is exactly what we wanted.
END!
- Log in to post comments
- 17552 views