NAS iSCSI to USB local copy

StorCenter ix2-200 Network Storage
tetra19
Posts: 9
Joined: Thu Dec 04, 2014 6:33 pm

NAS iSCSI to USB local copy

Post by tetra19 » Thu Dec 04, 2014 6:37 pm

Hi All,

I am trying to figure out how to make the NAS copy to a connected USB drive locally instead of going through the network. I have enabled SSH access and starting fooling around with it.. I can't seem to get the iSCSI mounted so that I can view the data and then copy to the USB.

I see the iSCSI in: /mnt/pools/A/A0/iSCSI/NAS1

Has anybody ever successfully done this?

Cheers!

Mijzelf
Posts: 6251
Joined: Mon Jun 16, 2008 10:45 am

Re: NAS iSCSI to USB local copy

Post by Mijzelf » Fri Dec 05, 2014 9:28 am

AFAIK iSCSI is a way of 'sharing' a blockdevice over the network. I put quotes around sharing, because it's not really sharing, as only one device can use the share simultaneously.
The main difference between iSCSI and -for instance- Samba, is that Samba shares files, while iSCSI shares sectors. This means that the filesystem on iSCSI exists in the perception of the client, while the filesystem of samba exists in the perception of the server.

Seeing your path I guess the iSCSI implementation on an ix2 is based on files. Right? That NAS1 is a big file? In that case you should loopmount it (make sure the client is not connected!):

Code: Select all

mkdir -p /mnt/NAS1
mount -o loop -t filesystem /mnt/pools/A/A0/iSCSI/NAS1 /mnt/NAS1
The tricky part is the filesystem. As the filesystem is maintained by the client, it is not necessary that the server supports it at all.

tetra19
Posts: 9
Joined: Thu Dec 04, 2014 6:33 pm

Re: NAS iSCSI to USB local copy

Post by tetra19 » Fri Dec 05, 2014 1:24 pm

Thanks for your reply. I had tried mounting it the exact same way you described but the filesystem was indeed the problem.
The host that has it connected has an ntfs filesystem, but it appears this thing doesn't support NTFS by default? Not sure how that's possible because if I connect a USB drive it recognizes it as NTFS.

If I try using ext4 or any other Linux filesystem I get:

mount: wrong fs type, bad option, bad superblock on /dev/loop3,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so


If I try with ntfs I get:

mount: unknown filesystem type 'ntfs'


a df shows:

/dev/mapper/5335603b_vg-lv5293c48b 940626672 68364104 872262568 8% /mnt/pools/A/A0

Looks like that /dev/mapper is ext4 but still won't mount..

/dev/mapper/5335603b_vg-lv5293c48b on /mnt/pools/A/A0 type ext4 (rw,noatime,barrier=0,data=ordered)

Mijzelf
Posts: 6251
Joined: Mon Jun 16, 2008 10:45 am

Re: NAS iSCSI to USB local copy

Post by Mijzelf » Fri Dec 05, 2014 2:08 pm

mount: unknown filesystem type 'ntfs'
I guess the nas uses ntfs-3g, which is a user-space filesystem (using fuse). Maybe you can specify this type, depending on the existence of an mount.ntfs-3g helper program.

If that helper program is not available, you'll have to mount using

Code: Select all

ntfs-3g device mountpoint
In that case you'll have to create the loop device first, and then mount:

Code: Select all

losetup /dev/loop3 /mnt/pools/A/A0/iSCSI/NAS1
mkdir -p /mnt/NAS1
ntfs-3g /dev/loop3 /mnt/NAS1
And when you are done, delete the loopdevice

Code: Select all

losetup -d /dev/loop3

tetra19
Posts: 9
Joined: Thu Dec 04, 2014 6:33 pm

Re: NAS iSCSI to USB local copy

Post by tetra19 » Fri Dec 05, 2014 3:27 pm

No dice.. man why would they make this device copy over the network when the USB is attached right to it.. Wow.

Mijzelf
Posts: 6251
Joined: Mon Jun 16, 2008 10:45 am

Re: NAS iSCSI to USB local copy

Post by Mijzelf » Fri Dec 05, 2014 8:29 pm

Is it possible that there is a partition table on the 'disk'? Try

Code: Select all

fdisk -l /mnt/pools/A/A0/iSCSI/NAS1
why would they make this device copy over the network when the USB is attached right to it.. Wow.
There is no 'they'. You are using iSCSI, and part of the contract is that the shared space is 'just a file' for the server. You can copy the file to USB, if you like.

tetra19
Posts: 9
Joined: Thu Dec 04, 2014 6:33 pm

Re: NAS iSCSI to USB local copy

Post by tetra19 » Mon Dec 08, 2014 1:41 pm

Here is the output from the fdisk command:


Disk /mnt/pools/A/A0/iSCSI/NAS1: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders, total 209715200 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 identifier: 0x10be3f89

Device Boot Start End Blocks Id System
/mnt/pools/A/A0/iSCSI/NAS1p1 63 209712509 104856223+ 7 HPFS/NTFS/exFAT

tetra19
Posts: 9
Joined: Thu Dec 04, 2014 6:33 pm

Re: NAS iSCSI to USB local copy

Post by tetra19 » Mon Dec 08, 2014 1:44 pm

You can copy the file to USB, if you like.
I could copy the NAS1 iSCSI file to the USB drive, but then I can't access the files on it. It wouldn't be much of a good backup, unless there is a way to remount that NAS1 iSCSI backup and have the files show properly on the target server using the drive. I will do some testing with this.

Mijzelf
Posts: 6251
Joined: Mon Jun 16, 2008 10:45 am

Re: NAS iSCSI to USB local copy

Post by Mijzelf » Mon Dec 08, 2014 4:42 pm

tetra19 wrote:Here is the output from the fdisk command:
<snip>
OK, so the file clearly contains a partition table. The loop device has to start at the beginning of the internal partition, not at the file itself.
Units = sectors of 1 * 512 = 512 bytes
<snip>/mnt/pools/A/A0/iSCSI/NAS1p1 63 209712509 104856223+ 7 HPFS/NTFS/exFAT
So the partition starts at sector 63, and a sector is 512 bytes. That means the offset is 32256 (or 31744. Cannot remember if the disk starts at sector 0 or 1).

So create a loopdevice with an offset:

Code: Select all

losetup -o 31744 /dev/loop3 /mnt/pools/A/A0/iSCSI/NAS1 
and try to mount that.

tetra19
Posts: 9
Joined: Thu Dec 04, 2014 6:33 pm

Re: NAS iSCSI to USB local copy

Post by tetra19 » Mon Dec 08, 2014 6:19 pm

That command seemed to work. I see it when I run: losetup -a
/dev/loop3: [fd02]:37486596 (/mnt/pools/A/A0/iSCSI/NAS1), offset 31744

It still complains when trying to mount it:

mount: wrong fs type, bad option, bad superblock on /dev/loop3,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

Mijzelf
Posts: 6251
Joined: Mon Jun 16, 2008 10:45 am

Re: NAS iSCSI to USB local copy

Post by Mijzelf » Mon Dec 08, 2014 7:33 pm

Have you tried to mount with ntfs-3g? If yes, delete the loopdevice, and retry with the other offset.

tetra19
Posts: 9
Joined: Thu Dec 04, 2014 6:33 pm

Re: NAS iSCSI to USB local copy

Post by tetra19 » Mon Dec 15, 2014 8:19 pm

I have had no luck getting ntfs-3g installed.
I am able to run apt-update and aptitude update after some tweaking.

If I try: aptitude install ntfs-3g.. it lists packages, tries to install and I get:

root@NAS:/# aptitude install ntfs-3g
The following NEW packages will be installed:
adduser{a} apt-utils{a} coreutils{a} debconf{a} debconf-i18n{a} debianutils{a} dpkg{a} e2fslibs{a} e2fsprogs{a} fuse{a} gcc-4.7-base{a} initscripts{a} insserv{a} libacl1{a} libapt-inst1.5{a} libapt-pkg4.12{a} libattr1{a}
libblkid1{a} libbz2-1.0{a} libc-bin{a} libc6{a} libcomerr2{a} libdb5.1{a} libfuse2{a} libgcc1{a} libgcrypt11{a} libgnutls26{a} libgpg-error0{a} libgpm2{a} liblocale-gettext-perl{a} liblzma5{a} libmount1{a} libncurses5{a}
libncursesw5{a} libp11-kit0{a} libpam-modules{a} libpam-modules-bin{a} libpam0g{a} libpci3{a} libpng12-0{a} libprocps0{a} libselinux1{a} libsemanage-common{a} libsemanage1{a} libsepol1{a} libslang2{a} libss2{a} libstdc++6{a}
libtasn1-3{a} libtext-charwidth-perl{a} libtext-iconv-perl{a} libtext-wrapi18n-perl{a} libtinfo5{a} libudev0{a} libusb-1.0-0{a} libustr-1.0-1{a} libuuid1{a} lsb-base{a} mount{a} multiarch-support{a} ntfs-3g passwd{a} pciutils{a}
perl-base{a} procps{a} psmisc{a} sed{a} sensible-utils{a} sysv-rc{a} sysvinit-utils{a} tar{a} tzdata{a} udev{a} usbutils{a} util-linux{a} uuid-runtime{a} zlib1g{a}
0 packages upgraded, 77 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/30.2 MB of archives. After unpacking 76.6 MB will be used.
Do you want to continue? [Y/n/?] y
E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 38%E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 77%E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 100%
Selecting previously unselected package libc-bin.
(Reading database ... 0 files and directories currently installed.)
Unpacking libc-bin (from .../libc-bin_2.13-38+deb7u6_armel.deb) ...
dpkg: error processing /var/cache/apt/archives/libc-bin_2.13-38+deb7u6_armel.deb (--unpack):
unable to securely remove '/usr/sbin/zic.dpkg-new': Read-only file system
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libc-bin_2.13-38+deb7u6_armel.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:

tetra19
Posts: 9
Joined: Thu Dec 04, 2014 6:33 pm

Re: NAS iSCSI to USB local copy

Post by tetra19 » Tue Dec 16, 2014 2:33 pm

Hmm, I tried troubleshooting and whatever I do I get the dpkg error when trying to install a package.
Any ideas on how to resolve this?

Mijzelf
Posts: 6251
Joined: Mon Jun 16, 2008 10:45 am

Re: NAS iSCSI to USB local copy

Post by Mijzelf » Tue Dec 16, 2014 7:11 pm

While the apt system is available, the database isn't there. So for each package all dependencies are installed, and parts of the filesystem are read-only, so that can't be done.

Are you sure ntfs-3g isn't there? How does the box mount an external ntfs device?

tetra19
Posts: 9
Joined: Thu Dec 04, 2014 6:33 pm

Re: NAS iSCSI to USB local copy

Post by tetra19 » Tue Dec 16, 2014 7:22 pm

I agree completely.. I don't think it is installed.
If I try to mount using -t ntfs or ntfs-3g it says it doesn't recognized the file system. Yet if I plug in an external USB with NTFS on it, it comes up and lists it as NTFS.

Not sure how it is doing this.

Post Reply