How to create a SFTP reop on your ESX host
Present a new LUN (or delete a datastore), and make note of its SCSI address (as seen in the VIC under the host's configuration tab->Storage Adapters after HBA rescan).
We will need to SSH to the host that will have this LUN and become root (su -).
Once at prompt type:cat /proc/scsi/scsi
Now count how many Direct Access SCSI devices down in the list this new LUN is.
For example,
Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: DELLModel: PERC 5/iRev: 1.00
Type:Direct-AccessANSI SCSI revision: 05
Host: scsi2 Channel: 00 Id: 00 Lun: 00
Vendor: DGCModel: RAID 5Rev: 0220
Type:Direct-AccessANSI SCSI revision: 04
Host: scsi2 Channel: 00 Id: 00 Lun: 01
Vendor: DGCModel: RAID 5Rev: 0220
Type:Direct-AccessANSI SCSI revision: 04
The first is the internal disk (/dev/sda), the 2nd was an iSCSI VMFS volume , and the third was the new LUN to use for backups.Counting in letters starting at ‘a’ makes this disk ‘c’, or /dev/sdc.To verify this is the correct lun use fdisk in SSH session:
fdisk /dev/sdc
Hit ‘p’ to print the partition table.It should be empty.If you see any partitions then this may not be the right LUN, for example, a VMFS lun will show 1 full size partition of type fb Unknown.If this is the case, try another disk (‘q’ to quit without saving).Once you have the right, empty LUN we can create a new partition.
Hit ‘n’ for new partition.
‘p’ for primary
‘1’ for the first partition
Hit enter/return and take all defaults
Hit ‘p’ again to see our new partition.Note it’s type is 83 Linux.
Hit ‘w’ to write the changes to the disk.**Be sure you want to do this**‘q’ will quit and discard.
We can now create our filesystem, I will be using ext3.Ext2 can also be used.
Note:This will take a while for large luns.
mkfs.ext3 /dev/sdc1
Next we need to mount this LUN somewhere, I will be using /mnt/backup:
mkdir /mnt/backup
Verify it mounts OK:
mount /dev/sdc1 /mnt/backup
Once complete, edit /etc/fstab so that this will mount again upon reboot.This will need to be tested to be sure that the LUN is available that early on during boot otherwise a manual mount after reboot may be necessary.
nano /etc/fstab
add the following line changing to suit your disk/mount point.
/dev/sdc1/mnt/backupdefaults0 2
CTRL+x to quit, y to save and enter to keep the same filename.
A reboot should be done to confirm whether or not this LUN is available and thus mounted on boot.If not, a manual mount can be done:
mount /mnt/backup (short command can be used since there is now a reference in /etc/fstab)
You should now be able to create and use an SFTP repository to write to a local/SAN LUN that is connected to your ESX host.
© 2021 Quest Software Inc. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy