Please consider donating: https://www.corelan.be/index.php/donate/


5,021 views

How to mount an Openfiler snapshot in Windows

After playing with Openfiler for a while, I started wondering how I could get access to a snapshot that was created with Openfiler.

This is how it works (according to me, I just hope Openfiler and iSCSI Enterprise Target find another way to make this easier)

On one of my LUN’s, I have created a snapshot schedule . The original LUN is mounted as drive G: on my system.

After the snapshot was created, this is what I found on the filesystem :

[root@openfiler1 storage3]# pwd
/dev/storage3
[root@openfiler1 storage3]# ls -al
total 0
drwx------ 2 root root 80 Aug 15 13:22 .
drwxr-xr-x 11 root root 3340 Aug 15 13:22 ..
lrwxrwxrwx 1 root root 25 Aug 13 00:00 lun3 ->
             /dev/mapper/storage3-lun3
lrwxrwxrwx 1 root root 44 Aug 13 00:00 of.snapshot.lun3.sched0 ->
             /dev/mapper/storage3-of.snapshot.lun3.sched0

 

So the snapshot is stored as /dev/storage3/of.snapshot.lun3.sched0. On the original system, this drive that was snapshotted into /dev/storage3/of.snapshot.lun3.sched0 is mounted as G:

If you add this snapshot lun into the /etc/ietd.conf file, you should be able to mount it

#
# PLEASE DO NOT MODIFY THIS CONFIGURATION FILE!
# This configuration file was auto-generated
# by Openfiler. Please do not modify it.
#
# Generated at: Wed Aug 15 13:22:20 CEST 2007
# 

Target iqn.2006-01.com.openfiler:storage1.lun01
Lun 0 Path=/dev/storage1/lun01,ScsiSN=QsV92w-LCLO,Type=fileio

Target iqn.2006-01.com.openfiler:storage2.lun2
Lun 0 Path=/dev/storage2/lun2,ScsiSN=NHt8t3-ueGA,Type=fileio 

Target iqn.2006-01.com.openfiler:storage3.lun3
Lun 0 Path=/dev/storage3/lun3,ScsiSN=CZklf2-quoJ,Type=fileio 

Target iqn.2006-01.com.openfiler:storage3ss.lun3
Lun 0 Path=/dev/storage3/of.snapshot.lun3.sched0,Type=fileio 

# End of Openfiler iSCSI configuration

Now restart iSCSI Enterprise Target

[root@openfiler1 storage3]# service iscsi-target restart
Stopping iSCSI target service: [ OK ]
Starting iSCSI target service: [ OK ]
[root@openfiler1 storage3]#

Important : the snapshot will carry the same drive letter, so you won’t be able to mount the snapshot on the same machine.  Go to MS iSCSI Initiator on another Windows host and refresh the targets. You will see a new target 

Click ‘Log on’ to mount the new lun

081507_1206_Howtomounta1

If you open Disk Management on your Windows host, the new snapshot should be added as a new disk. The disk will be declared as a “Foreign Disk”. Right click and choose “Import Foreign Disk”. You should see a “Foreign Disk Group” with 1 disk. When the mount is completed, you’ll get a G: drive with the same drive name as what you have configured on the original system.

081507_1206_Howtomounta2

 

Note : Openfiler doesn’t recognize this custom lun in its administration tool. Just make sure to remove the custom entries in /etc/ietd.conf again when you’ve restored your data.

© 2007 – 2021, Peter Van Eeckhoutte (corelanc0d3r). All rights reserved.

Comments are closed.

Corelan Training

We have been teaching our win32 exploit dev classes at various security cons and private companies & organizations since 2011

Check out our schedules page here and sign up for one of our classes now!

Donate

Want to support the Corelan Team community ? Click here to go to our donations page.

Want to donate BTC to Corelan Team?



Your donation will help funding server hosting.

Corelan Team Merchandise

You can support Corelan Team by donating or purchasing items from the official Corelan Team merchandising store.

Protected by Copyscape Web Plagiarism Tool

Corelan on Slack

You can chat with us and our friends on our Slack workspace:

  • Go to our facebook page
  • Browse through the posts and find the invite to Slack
  • Use the invite to access our Slack workspace
  • Categories