Date: Fri, 5 Sep 2003 01:16:34 +0900 (JST) From: Kensaku Masuda <greg@greg.jp> To: FreeBSD-gnats-submit@FreeBSD.org Cc: greg@greg.jp Subject: bin/56472: mdmfs can not mount memory file system Message-ID: <200309041616.h84GGYwd000807@omoikane.greg.rim.or.jp> Resent-Message-ID: <200309050310.h853AEfF078624@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 56472 >Category: bin >Synopsis: mdmfs can not mount memory file system >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Sep 04 20:10:14 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Kensaku Masuda >Release: FreeBSD 5.1-CURRENT i386 >Organization: >Environment: System: FreeBSD omoikane.greg.rim.or.jp 5.1-CURRENT FreeBSD 5.1-CURRENT #4: Thu Sep 4 23:43:17 JST 2003 root@omoikane.greg.rim.or.jp:/a/uzume/export/src/system-current/src/sys/i386/compile/omoikane.greg.rim.or.jp i386 >Description: The online manua(mdmfs) say it ok to execute "mdmfs -s 32m md /tmp", So I can create and mount memory file system, But do not >How-To-Repeat: do mdmfs -s 32m md /tmp but, newfs exited with error code 1 >Fix: - --- mdmfs.c.orig Fri Sep 5 00:40:29 2003 +++ mdmfs.c Fri Sep 5 00:58:42 2003 @@ -76,6 +76,7 @@ static void do_mdconfig_detach(void); static void do_mount(const char *, const char *); static void do_mtptsetup(const char *, struct mtpt_info *); +static void do_disklabel(void); static void do_newfs(const char *); static void extract_ugid(const char *, struct mtpt_info *); static int run(int *, const char *, ...) __printflike(2, 3); @@ -264,6 +265,7 @@ do_mdconfig_attach_au(mdconfig_arg, mdtype); else do_mdconfig_attach(mdconfig_arg, mdtype); + do_disklabel(); do_newfs(newfs_arg); do_mount(mount_arg, mtpoint); do_mtptsetup(mtpoint, &mi); @@ -424,7 +426,7 @@ { int rv; - - rv = run(NULL, "%s%s /dev/%s%d %s", _PATH_MOUNT, args, + rv = run(NULL, "%s%s /dev/%s%da %s", _PATH_MOUNT, args, mdname, unit, mtpoint); if (rv) errx(1, "mount exited with error code %d", rv); @@ -473,10 +475,21 @@ do_newfs(const char *args) { int rv; - - - - rv = run(NULL, "%s%s /dev/%s%d", _PATH_NEWFS, args, mdname, unit); + rv = run(NULL, "%s%s /dev/%s%da", _PATH_NEWFS, args, mdname, unit); if (rv) errx(1, "newfs exited with error code %d", rv); +} + +/* + * Put disklabel on the memory disk + */ +static void +do_disklabel(void) +{ + int rv; + rv = run(NULL, "%s -r -w %s%d auto", "/sbin/disklabel", mdname, unit); + if (rv) + errx(1, "disklabel exited with error code %d", rv); } /* ------- End of Forwarded Message --- Fingerprint16 = 4F CC 44 F8 54 BE 45 3A 4F 9F 1C 4E 5E 3B 91 E9 Fingerprint20 = 12CA 6B2D DC50 8248 A636 992B 0292 F548 D65F 4D5B -----------------+-----------------------------------$BA}ED!!7r:n(B---+ $B;0!&O;$r<i$m$&!*(B | greg@greg.jp | $B!!$*2H$X5"$m$&!*(B | greg@fxis.fujixerox.co.jp | | http://www.greg.jp/~greg/ | -----------------+------------------------------------------------+ >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309041616.h84GGYwd000807>