Move a LUN from one server to the other

I have NetApp LUN that was presented to a Red Hat Enterprise Linux Server release 5.7 (Tikanga) machine.
But this LUN has already data, because it was being used on another server.
I can see the new LUN when running fdisk :

fdisk -l | egrep '^Disk' | egrep -v 'dm-' | grep -v identifier
Disk /dev/sda doesn't contain a valid partition table
Disk /dev/cciss/c0d0: 450.0 GB, 450064605184 bytes
Disk /dev/sda: 32.2 GB, 32212254720 bytes

so I think the new LUN is /dev/sda

But how do I go about mounting as a file system?
I cannot make a file system on it... because there is data already on it...

So, if the LUN is not connected to anything else, can you not just mount it?

mount /dev/sda /mnt

What errors do you get? You might need to try variations with the -t flag.

Why do you think it already has data on it? If it was previously an LVM Physical Volume, you might need to import it somehow. Is it the full volume group in this case?

What OS and version was the machine that was previously using it?

What is your current boot disk? Probably df -Ph /boot can tell us that. It is most usually /dev/sda2 but not necessarily. I would suggest that you really want to look at /dev/cciss/c0d0, given it is 450Gb. If this is a local RAID device, it could be that you haven't re-scanned to pick up the newly provided disk.

Sorry for just having questions at the moment,
Robin

the reason I am saying that has got data on it, its because, that LUN was used on the source/other server to store backups.
the boot disk :

 df -Ph /boot
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p1      99M   12M   82M  13% /boot

I don't think this is the same LUN because otherwise you would see the filesystems/partitions/whatever on it. Notice that LUNs have an identifier (the so-called "WWN" and you can identify it by this. Use your HBAs driver software to find out the WWNs of your attached disks.

Notice also that there is the "zoning" which has to be correct: basically zoning is somewhat analogous to firewall rules: each partner (the LUN, the HBA, the fabrics port) has an identifying WWPN (World Wide Port Number) and you create a rule that says WWPN A (your adapter) is allowed to connect to WWPN B (the LUN) and vice versa. If the LUN was part of a different system before you perhaps need to change this rule to make it visible to the new system (or, more precisely, to its FC adapter). Your storage administrator should be able to explain the intrinsics to you in more detail.

I hope this helps.

bakunin

1 Like

I beleive we dont have FC adapters on the system, or if we have apparently we are not using them, because the NetApp guy he first asked for iqn of the system, so I beleive he is using iSCSI protocol to present LUNs

Can you show us a plain fdisk -l /dev/sda so we can see what's on there - no filtering.

Thanks,
Robin

Please desccribe your setup!

What is your storage?
How is it connected to your system?
Which driver do you use? (and whichc version?)
Do you use multipathing software?

etc.....

Sorry to be blunt, but without knowing what your system looks like the chance of finding the culprit in your setup is zero.

bakunin

Hi

The output of the command is:

 fdisk -l /dev/sda

Disk /dev/sda: 32.2 GB, 32212254720 bytes
64 heads, 32 sectors/track, 30720 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sda doesn't contain a valid partition table

this is a standalone server, but we want to attach a NetApp storage using iSCSI , so no FC adapters on it.
The NetApp will only be used to store backups, because this server does not have any backup functionality attached to it.

Hi,

The device you list "/dev/cciss" is actually a HP Smart Array device, the drivers for this were removed some time ago.

I'd have a look here to start your hunt for information.

Also, normally /dev/sda would be the first disk on a standalone server, so how is the server booted at the moment?

Regards

Gull04

the sys admin of that server, have configured 450G LUN and in there it was installed the operating system. That LUN of 450G is part of internal disks of the server.

Since you had the LUN added, have you re-scanned for devices (or rebooted). This link talks about CentOS7, but it should be pretty much the same. Perhaps the command kudzu might be an option too for RHEL5.

I find I always need to re-scan to get new/enlarged LUNs reflected in the OS.

I suspect that the LUN is not yet showing up, hence the confusion of the two disks you do have. I think that they are both local, one a simple disk, one a RAID device.

Robin

Hi Robin!

thanks for your inputs, I did a test with the help of the NetApp admin, which was to remove the LUN he presented onto the server, and present a bigger LUN, and to show or see the LUN on the server, I did run the following commands:

/etc/init.d/iscsi restart
iscsiadm -m session --rescan
fdisk -l | egrep '^Disk' | egrep -v 'dm-' | grep -v identifier

in this order, and the new bigger LUN show up.

Very good. Does it show the data/filesystems you are expecting?

If you are certain that they are not is use elsewhere, can you mount them?

If you are not sure, think carefully. Trying to mount them may just refuse, but it may possible say "Are you sure?" and then force it or just try and fails with a suggestion to fsck it. All of these could be very bad for your data. When sharing a LUN/filesystem(s) between servers, there is usually a need for good HA software. There are all sorts of problems, such as the free block list which will be held in memory, so if one side uses some free blocks, the other side doesn't know about it and could just use the same blocks causing data loss.

Kind regards,
Robin

that�s the problem:
If its new LUN, like the one the NetApp admin provided me for testing purposes, yes can go through the process of creating partition, etc, etc up to creating a file system and mount it. BUT if its LUN that has already data and use to be presented on another server, how do I mounted on the new server?

Is the whole volume group on the one LUN?
Is the LUN sliced?

This is probably one for vgimport, but can you show us the output from fdisk -l /dev/sdb , or whatever it has appeared as?

Robin

Hi,

The NetApp administrator should be able to tell you if there is any I/O on the LUN, if there is I/O you'll have to find out which server already has the disk access. Otherwise if this was a LUN that was setup using LVM - you will have to export it from one server, import it on the other server and then grow the volumes to the required configuration.

But remember;

If the LUN is already mounted on one server, forcing a mount on an other server - will be bad for the disks health and possibly your future job prospects - depending what's on the LUN.

If this is any kind of HA solution, the LUN will be visible in the service groups and it may have to be scanned from inside the service group.

If this is a NEW LUN and is assigned to a server as /dev/sdb, then you should be able to use the standard admin processes to pull the disk in and use it.

Gull04