Problem with disklabel and filesystem over iSCSI

Danny Braniss danny at cs.huji.ac.il
Sun Dec 28 09:46:59 UTC 2008


> This is a multi-part message in MIME format.
> --------------040502050705080206050206
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: quoted-printable
> 
> 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

hi,
Which iSCSI initiator are you using?

	danny




More information about the freebsd-scsi mailing list