Problem with disklabel and filesystem over iSCSI

Erik Scholtz, ArgonSoft GmbH e.scholtz at argonsoft.de
Sun Dec 28 10:09:17 UTC 2008


Hi,

I tested the default iSCSI_initiator shipped with 7.0, 7.1RC1 and 
7.1RC2. Additionally i changed it with that version from 
ftp://ftp.cs.huji.ac.il/users/danny/freebsd/iscsi-2.1.tar.gz with each 
release. The effect is with all combinations the same:

7.0 native / 7.0 + iscsi-2.1
7.1RC1 native / 7.1RC1 + iscsi-2.1
7.2RC2 native / 7.2RC2 + iscsi-2.1


Additionally info + tests:
--------------------------
1) I also checked it for ufs in dangerously dedicated mode - also the 
same effect.

2) After the reboot, the iSCSI device is back on /dev/da0 as expected.

3) The SAN system is a Hardware-SAN (iStor / GigaStor), that works 
without any problems under Ubuntu, CenOS, MacOS X, Windows and RedHat 
(all tested the last days)

4) I could get ufs to work with the following (terribly wrong) partition 
map:

          0         40         39        -     12     unused        0
         40     409600     409639    da0s1    165    FreeBSD        0
     409640 1928708016 1929117655    da0s2    165    FreeBSD        0
1929117656     262184 1929379839        -     12     unused        0

With this partition map, newfs runs without any failure. The filesystem 
is heavily damaged and can be repaired with fsck. After repairing, the 
fs can be mounted and used as normal. But when running a fsck, thousands 
of errors must be corrected and the result is an empty disk again (when 
answering all with YES - I ran it with -y flag, since there are too many 
questions to be answered manually, even when copying only three big 
files).

Greetings,
Erik

-----
ArgonSoft GmbH      | Im Ermlisgrund 3      | 76337 Waldbronn
Tel: +49 7243 71520 | Fax: +49 7243 715222  | http://www.argonsoft.de
Umsatzsteuer-Identnummer: DE205762306       | Handelsregister: HRB2372E
Geschäftsführer: Erik Scholtz

Danny Braniss wrote:
 >
 > hi,
 > Which iSCSI initiator are you using?
 >
 > 	danny
 >
 >
>> -----------------------------------
>>
>> Hi,
>>
>> the last days I tried to get a 1TB SAN to work with FreeBSD 7.x. I tried=20
>> it with the following releases:
>>
>> FreeBSD web3 7.0-RELEASE FreeBSD 7.0-RELEASE #0: i386
>> FreeBSD	     7.1-RC1 amd64
>> FreeBSD	     7.1-RC2 amd64
>>
>> Unfortunatly I could not get it to work. I think there is a problem with=20
>> the disklabels. The UFS could not be written successfully. So I tried=20
>> the same with ZFS. ZFS seems to work. After creating a pool and mounting=20
>> the FS it can be used normally. But after unmounting the FS and=20
>> rebooting the system, the FS is corrupted. Remounting the FS without=20
>> rebooting works without any problems.
>>
>> Here the "log":
>>
>> *************************************************************************=
>> **********
>>
>> (iSCSI Session successfully created, the device is known as da0)
>> (creating the partition)
>>
>> web3# fdisk /dev/da0s1
>> ******* Working on device /dev/da0s1 *******
>> parameters extracted from in-core disklabel are:
>> cylinders=3D99693 heads=3D255 sectors/track=3D63 (16065 blks/cyl)
>>
>> Figures below won't work with BIOS for partitions not in cyl 1
>> parameters to be used for BIOS calculations are:
>> cylinders=3D99693 heads=3D255 sectors/track=3D63 (16065 blks/cyl)
>>
>> fdisk: invalid fdisk partition table found
>> Media sector size is 512
>> Warning: BIOS sector numbering starts with sector 1
>> Information from DOS bootblock is:
>> The data for partition 1 is:
>> sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
>>      start 63, size 1601567982 (782015 Meg), flag 80 (active)
>> 	beg: cyl 0/ head 1/ sector 1;
>> 	end: cyl 364/ head 254/ sector 63
>> The data for partition 2 is:
>> <UNUSED>
>> The data for partition 3 is:
>> <UNUSED>
>> The data for partition 4 is:
>> <UNUSED>
>>
>> (writeout the partition table)
>> web3# dd if=3D/dev/da0 of=3D/partition1.bin bs=3D1 count=3D64 skip=3D446 =
>> seek=3D446
>>
>> *************************************************************************=
>> **********
>>
>> (write the label)
>> web3# bsdlabel -w /dev/da0s1
>>
>> web3# bsdlabel /dev/da0s1
>> bsdlabel: /dev/da0s1: no valid label found
>>
>> (writeout the partition table)
>> web3# dd if=3D/dev/da0 of=3D/partition2.bin bs=3D1 count=3D64 skip=3D446 =
>> seek=3D446
>>
>> *************************************************************************=
>> **********
>>
>> (create the filesystem)
>> newfs -O2 /dev/da0s1
>> /dev/da0s1: 782023.5MB (1601584044 sectors) block size 16384, fragment=20
>> size 2048
>> 	using 4256 cylinder groups of 183.77MB, 11761 blks, 23552 inodes.
>> super-block backups (for fsck -b #) at:
>>   160, 376512, 752864, ... ... ...
>>   1601377920
>> internal error: can't find block in cyl 0
>>
>> (writeout the partition table)
>> web3# dd if=3D/dev/da0 of=3D/partition3.bin bs=3D1 count=3D64 skip=3D446 =
>> seek=3D446
>>
>> *************************************************************************=
>> **********
>>
>> (after the ufs was not successfull, the partition is destroyed again)
>> (now trying to use a zfs)
>>
>> web3# zpool create tank da0
>>
>> web3# zpool status
>>    pool: tank
>>   state: ONLINE
>>   scrub: none requested
>> config:
>>
>> 	NAME        STATE     READ WRITE CKSUM
>> 	tank        ONLINE       0     0     0
>> 	  da0       ONLINE       0     0     0
>>
>> errors: No known data errors
>>
>> *************************************************************************=
>> **********
>>
>> (list of mounted volumes)
>>
>> web3# mount
>> /dev/ad4s1a on / (ufs, local)
>> devfs on /dev (devfs, local)
>> tank on /tank (zfs, local)
>>
>> *************************************************************************=
>> **********
>>
>> (copy a file to the zfs and check md5 before and after)
>>
>> web3# md5 /sbin/init
>> MD5 (/sbin/init) =3D 6a374bc84a8b89822964e2a73ed2af18
>> web3# cp /sbin/init /tank/.
>> web3# md5 /tank/init
>> MD5 (/tank/init) =3D 6a374bc84a8b89822964e2a73ed2af18
>>
>> (the zfs volume can be unmounted and mounted again - md5 still correct)
>>
>> *************************************************************************=
>> **********
>>
>> (system reboot)
>> (iSCSI Session reinitiated)
>>
>> web3# zpool status
>>    pool: tank
>>   state: FAULTED
>> status: One or more devices could not be used because the label is missin=
>> g
>> 	or invalid.  There are insufficient replicas for the pool to continue
>> 	functioning.
>> action: Destroy and re-create the pool from a backup source.
>>     see: http://www.sun.com/msg/ZFS-8000-5E
>>   scrub: none requested
>> config:
>>
>> 	NAME        STATE     READ WRITE CKSUM
>> 	tank        FAULTED      0     0     0  corrupted data
>> 	  da0       UNAVAIL      0     0     0  corrupted data
>>
>> (FS not useable anymore - files are lost)
>>
>> *************************************************************************=
>> **********
>>
>> In the attachment you'll find the results of the dd.
>>
>> Greetings,
>> Erik



More information about the freebsd-scsi mailing list