From owner-freebsd-questions Tue Jun 11 16:23: 3 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id F0CF737B409; Tue, 11 Jun 2002 16:22:39 -0700 (PDT) Received: from hades.hell.gr (patr530-b171.otenet.gr [212.205.244.179]) by mailsrv.otenet.gr (8.12.3/8.12.3) with ESMTP id g5BNMaZN005815; Wed, 12 Jun 2002 02:22:37 +0300 (EEST) Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.3/8.12.3) with ESMTP id g5BNMMeb047849; Wed, 12 Jun 2002 02:22:35 +0300 (EEST) (envelope-from keramida@FreeBSD.ORG) Received: (from charon@localhost) by hades.hell.gr (8.12.3/8.12.3/Submit) id g5BLxjtF047050; Wed, 12 Jun 2002 00:59:45 +0300 (EEST) (envelope-from keramida@FreeBSD.org) Date: Wed, 12 Jun 2002 00:59:45 +0300 From: Giorgos Keramidas To: "Greg 'groggy' Lehey" Cc: Akthar Hussain , questions@FreeBSD.ORG Subject: Re: Mounting Freebsd part in Linux Message-ID: <20020611215945.GD45825@hades.hell.gr> References: <20020611051421.GD3644@wantadilla.lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020611051421.GD3644@wantadilla.lemis.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2002-06-11 14:44 +0930, Greg 'groggy' Lehey wrote: > On Tuesday, 11 June 2002 at 10:29:03 +0530, Akthar Hussain wrote: > > Hi, > > > > I had compiled new kernel in Linux to mount NTFS and UFS.Also able > > to read BSD disk label. > > > > in kernel >>fileSYSTEM options I had selected ,create modules for > > NTFS ,UFS,and read BSD disk label. > > > > if I boot my system with new kennel I can able to mount only ntfs > > partitions.but if I try to mount my FreeBSD partitions it gives error > > "unable to mount or invalid superbalck" > > > > also ufs and ntfs modules are available in > > /lib/modules/..8.-cus/kernel/fs/. > > > my partitions are > > > > hda1 = /boot (Linux) > > hda2 or ad0s2 = freebsd > > hda3 = / for Linux > > > > hdb1 = ntfs > > hdb2 = ntfs > > > > they way i tried to mount freebsd is > > > > mount -t ufs /dev/hda2 /mnt > > > > or > > > > mount -t ufs -o ufstype=44bsd /dev/hda2 /mnt > > > > also some time it gives your kernel support only read only > > options.but i tried with -r , no improvement. > > > > if any one can help me ? > > > > do i have to do any extra changes in my kernet to mount ufs (freebsd > > partitions) > > > > is it my way of mounting is right ?? > > > > my linux kernel is 2.4.18. redhat 7.3. > > This appears to be a Linux problem. It's possible that the Linux ufs > implementation doesn't correctly recognize modern FreeBSD file > systems. One of the modern 2.4.x kernels that a friend was using, had a strange `bug' that required patching the Linux kernel to solve. It appears that the Linux kernel uses a list of block & fragment sizes to check against the values stored within the filesystem, and aborts the mount if the block or fragment sizes of the filesystem can't be matched with one of the ``valid sizes'' of its list. When this is the case, then the Linux kernel prints a message to its logs, similar to: > ufs_read_super: fs_bsize 16384 != {4096, 8192, 32768} > ufs_read_super: bad magic number Recent FreeBSD releases autosize block & fragment sizes to values more proper for the total partition size (I think the first time this reached a -RELEASE of FreeBSD was with 4.5-RELEASE), and might end up using a block size of 16384 or a block size larger than 32768 for some partition sizes. Since the resulting block size is not listed in the valid block sizes of the Linux ufs support module code, all attempts to mount the partition with Linux's ufs support will fail. It is relatively easy to add a single line of C code in the file /usr/src/linux/fs/ufs/super.c, near line 655 that checks for a valid block size. All it takes is an additional ``&& uspi->s_bsize != 16384'' and then the Linux kernel will accept 16384 as a valid block size too. This is a relatively ugly hack to make the Linux kernel `just work', but don't ask me how I managed to find this out, and why I do remember it after a few months. [ The original post, that triggered the discussion of this in a Greek Linux users list, was sent in Feb 27. ] If this is the case, I hope this helps to solve the problems :-) - Giorgos To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message