[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#526586: marked as done (mkfs.ufs: could not find special device)



Your message dated Thu, 21 May 2009 18:47:21 +0000
with message-id <E1M7DIX-0000p5-2O@ries.debian.org>
and subject line Bug#526586: fixed in ufsutils 7.2-1
has caused the Debian Bug report #526586,
regarding mkfs.ufs: could not find special device
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
526586: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526586
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: ufsutils
Version: 7.1-2
Severity: important
Tags: patch


Currently mkfs.ufs is not working in a Linux environment and is just
returning an error message when used:

> # mkfs.ufs /dev/md0
> mkfs.ufs: /dev/md0: could not find special device

This has been outlined in great detail by Dmitriy Kryuk before[0]. Attached
to his report is a diff to libufs/type.c; a dpatch will be attached to this
report later on. After applying the patch, I was able to successfully create,
mount and read/write from/to the newly created filesystem.


Thanks,
Christian.

[0] http://www.mail-archive.com/debian-bsd@lists.debian.org/msg04275.html

# mkfs.ufs /dev/md0
/dev/md0: 3812.1MB (7807104 sectors) block size 16384, fragment size 2048
        using 21 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
super-block backups (for fsck -b #) at:
 160, 376416, 752672, 1128928, 1505184, 1881440, 2257696, 2633952, 3010208,
 3386464, 3762720, 4138976, 4515232, 4891488, 5267744, 5644000, 6020256, 
 6396512, 6772768, 7149024, 7525280
# mount -t ufs -o ufstype=ufs2 /dev/md0 /mnt/md0   
# grep md0 /proc/mounts 
/dev/md0 /mnt/md0 ufs rw,relatime,ufstype=ufs2,onerror=lock 0 0


-- System Information:
Debian Release: squeeze/sid
  APT prefers experimental
  APT policy: (900, 'experimental'), (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-rc4
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/dash

Versions of packages ufsutils depends on:
ii  libbsd0                  0.0.1-2         utility functions from BSD systems
ii  libc6                    2.9-9           GNU C Library: Shared libraries
ii  libedit2                 2.11~20080614-1 BSD editline and history libraries
ii  libncurses5              5.7+20090411-1  shared libraries for terminal hand
ii  libufs2                  7.1-2           UFS filesystem shared library

ufsutils recommends no packages.

ufsutils suggests no packages.

-- no debconf information
#DPATCHLEVEL=1
Index: ufsutils/libufs/type.c
===================================================================
--- ufsutils.orig/libufs/type.c
+++ ufsutils/libufs/type.c
@@ -23,6 +23,9 @@
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Modified by Dmitriy Kryuk <motoprogger@users.sourceforge.net> to 
+ * port libufs to Linux.
  */
 
 #include <sys/cdefs.h>
@@ -108,32 +111,19 @@ again:	if ((ret = stat(name, &st)) < 0) 
 		 */
 		name = oname;
 	}
-	if (ret >= 0 && S_ISCHR(st.st_mode)) {
+	/* There is a portability issue between BSD and Linux in that Linux
+	 * mounts filesystems from block devices, not the character ones. I
+	 * also consider it unlikely to format a device a filesystem is mounted
+	 * from
+	 */
+	if (ret >= 0 && S_ISBLK(st.st_mode)) {
 		/* This is what we need, do nothing. */
 		;
-	} else if ((fs = getfsfile(name)) != NULL) {
-		/*
-		 * The given mount point is listed in /etc/fstab.
-		 * It is possible that someone unmounted file system by hand
-		 * and different file system is mounted on this mount point,
-		 * but we still prefer /etc/fstab entry, because on the other
-		 * hand, there could be /etc/fstab entry for this mount
-		 * point, but file system is not mounted yet (eg. noauto) and
-		 * statfs(2) will point us at different file system.
-		 */
-		name = fs->fs_spec;
-	} else if (ret >= 0 && S_ISDIR(st.st_mode)) {
-		/*
-		 * The mount point is not listed in /etc/fstab, so it may be
-		 * file system mounted by hand.
-		 */
-		if (statfs(name, &sfs) < 0) {
-			ERROR(disk, "could not find special device");
-			return (-1);
-		}
-		strlcpy(dev, sfs.f_mntfromname, sizeof(dev));
-		name = dev;
 	} else {
+		/* I consider adding a more detailed analysis on the root of
+		 * the problem - in particular, if a file doesn't exist or is
+		 * not a block special device
+		 */
 		ERROR(disk, "could not find special device");
 		return (-1);
 	}
Index: ufsutils/include/ufs/ffs/fs.h
===================================================================
--- ufsutils.orig/include/ufs/ffs/fs.h
+++ ufsutils/include/ufs/ffs/fs.h
@@ -33,6 +33,9 @@
 #ifndef _UFS_FFS_FS_H_
 #define _UFS_FFS_FS_H_
 
+#include <sys/types.h>
+#include <stdint.h>
+
 /*
  * Each disk drive contains some number of filesystems.
  * A filesystem consists of a number of cylinder groups.
Index: ufsutils/include/ufs/ufs/dinode.h
===================================================================
--- ufsutils.orig/include/ufs/ufs/dinode.h
+++ ufsutils/include/ufs/ufs/dinode.h
@@ -68,6 +68,8 @@
 #ifndef _UFS_UFS_DINODE_H_
 #define	_UFS_UFS_DINODE_H_
 
+#include <sys/types.h>
+
 /*
  * The root inode is the root of the filesystem.  Inode 0 can't be used for
  * normal purposes and historically bad blocks were linked to inode 1, thus
Index: ufsutils/include/ufs/ufs/dir.h
===================================================================
--- ufsutils.orig/include/ufs/ufs/dir.h
+++ ufsutils/include/ufs/ufs/dir.h
@@ -38,6 +38,8 @@
 #ifndef _UFS_UFS_DIR_H_
 #define	_UFS_UFS_DIR_H_
 
+#include <sys/types.h>
+
 /*
  * Theoretically, directories can be more than 2Gb in length, however, in
  * practice this seems unlikely. So, we define the type doff_t as a 32-bit
Index: ufsutils/libufs/Makefile
===================================================================
--- ufsutils.orig/libufs/Makefile
+++ ufsutils/libufs/Makefile
@@ -1,26 +1,16 @@
 # $FreeBSD: src/lib/libufs/Makefile,v 1.14 2006/10/31 21:21:48 pjd Exp $
 
 LIB=	ufs
-SHLIBDIR?= /lib
+SHLIB_MAJOR= 2
 
-SRCS=	block.c cgroup.c inode.c sblock.c type.c
+LIBSRCS=	block.c cgroup.c inode.c sblock.c type.c
 INCS=	libufs.h
 
-MAN=	bread.3 cgread.3 libufs.3 sbread.3 ufs_disk_close.3
-MLINKS+= bread.3 bwrite.3
-MLINKS+= cgread.3 cgread1.3
-MLINKS+= cgread.3 cgwrite1.3
-MLINKS+= sbread.3 sbwrite.3
-MLINKS+= ufs_disk_close.3 ufs_disk_fillout.3
-MLINKS+= ufs_disk_close.3 ufs_disk_fillout_blank.3
-MLINKS+= ufs_disk_close.3 ufs_disk_write.3
+ALL_CFLAGS+= -D_LIBUFS
+ifdef LIBUFS_DEBUG
+ALL_CFLAGS+= -D_LIBUFS_DEBUGGING
+endif
+LDADD += -lbsd
+INCLUDES = -I.
 
-WARNS?=	2
-
-CFLAGS+= -D_LIBUFS
-.if defined(LIBUFS_DEBUG)
-CFLAGS+= -D_LIBUFS_DEBUGGING
-.endif
-CFLAGS+= -I${.CURDIR}
-
-.include <bsd.lib.mk>
+include ../Makefile.common

--- End Message ---
--- Begin Message ---
Source: ufsutils
Source-Version: 7.2-1

We believe that the bug you reported is fixed in the latest version of
ufsutils, which is due to be installed in the Debian FTP archive:

libufs2_7.2-1_amd64.deb
  to pool/main/u/ufsutils/libufs2_7.2-1_amd64.deb
ufsutils_7.2-1.diff.gz
  to pool/main/u/ufsutils/ufsutils_7.2-1.diff.gz
ufsutils_7.2-1.dsc
  to pool/main/u/ufsutils/ufsutils_7.2-1.dsc
ufsutils_7.2-1_amd64.deb
  to pool/main/u/ufsutils/ufsutils_7.2-1_amd64.deb
ufsutils_7.2.orig.tar.gz
  to pool/main/u/ufsutils/ufsutils_7.2.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 526586@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Aurelien Jarno <aurel32@debian.org> (supplier of updated ufsutils package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Thu, 21 May 2009 20:25:46 +0200
Source: ufsutils
Binary: ufsutils libufs2
Architecture: source amd64
Version: 7.2-1
Distribution: unstable
Urgency: low
Maintainer: Aurelien Jarno <aurel32@debian.org>
Changed-By: Aurelien Jarno <aurel32@debian.org>
Description: 
 libufs2    - UFS filesystem shared library
 ufsutils   - UFS filesystems utilities
Closes: 526586
Changes: 
 ufsutils (7.2-1) unstable; urgency=low
 .
   [ Guillem Jover ]
   * Use $(filter ...) instead of $(findstring ...) to extract space separated
     options from DEB_BUILD_OPTIONS in debian/rules.
   * Remove commented out lines in debian/rules.
   * Do not set unused INSTALL_PROGRAM.
   * Line wrap Build-Depends fields for lines longer than 80 chars.
   * Use asterisks for bulleted lists in package description.
   * Remove DPATCHLEVEL variable from patches.
   * Switch to debhelper compatibility level 7.
   * Use dh_prep instead of "dh_clean -k".
   * Do not use stamp files for build.
   * Include quilt.make snippet instead of using ad-hoc code.
   * Remove unused ufsutils variable and rename libufs to lib in debian/rules.
 .
   [ Petr Salinger ]
   * New upstream version (RELENG_7_2_0_RELEASE)
   * Allow mkfs.ufs not only on character devices (GNU/kFreeBSD), but also
     on block devices (Linux) and plain files (i.e. loopback). (Closes: #526586)
 .
   [ Aurelien Jarno ]
   * Bump Standard-Versions to 3.8.1 (no changes).
Checksums-Sha1: 
 e5113e11cd4f49fec6cc52d3f7aea193b81d8d0e 1261 ufsutils_7.2-1.dsc
 184ac45f682841def824402a428ccc2dd054dde2 466506 ufsutils_7.2.orig.tar.gz
 4807e7fb1438a8041de11b97500a7e843e6e982e 17920 ufsutils_7.2-1.diff.gz
 22369174efe4380bc9de761a3efd77a8de2df12f 132858 ufsutils_7.2-1_amd64.deb
 02a199636b7222f7d6a138170394b66370c128b0 9198 libufs2_7.2-1_amd64.deb
Checksums-Sha256: 
 79cee3e3d2aa3fe3bafd196424c4cf97939e3043befe1d0e45c0db9db0fc9a42 1261 ufsutils_7.2-1.dsc
 9a3cbec48a0aca611f8dc32a76d888f2e4fde041828ee19ccde21a1d285edbf4 466506 ufsutils_7.2.orig.tar.gz
 40c1fb6ab25178d42208f1584ae24399e1150d90b90f5efba8ef78715c363a47 17920 ufsutils_7.2-1.diff.gz
 aadcf76462bcbb372f6c33e30cd0eb7a9b4b17e9fbf321bc60ecbdc12867b10c 132858 ufsutils_7.2-1_amd64.deb
 189c40c391cf18f8c66fe609040ca6fd74ee356c08a5ab422462be843498e96a 9198 libufs2_7.2-1_amd64.deb
Files: 
 a8cac26815842cf57b509b53076fb934 1261 utils optional ufsutils_7.2-1.dsc
 b81156946c0fb680f2d1175607079ca9 466506 utils optional ufsutils_7.2.orig.tar.gz
 c816261b8e3f52e3926269130b03d8b0 17920 utils optional ufsutils_7.2-1.diff.gz
 518fc6e0989de08e533258628a268f21 132858 utils optional ufsutils_7.2-1_amd64.deb
 a0cbf5f0ec01d7a63cffd181f865532a 9198 libs optional libufs2_7.2-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFKFZ0kw3ao2vG823MRAtW1AJwLgyA+yI7w9YT0/ikEy6ICLAQkigCfahoQ
+NjEyMlo7OJxEn4Qcxe0PYA=
=aeCl
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: