Anyone successfully mounted the Minix3 filesystem from Linux? - Minix

This is a discussion on Anyone successfully mounted the Minix3 filesystem from Linux? - Minix ; I can mount the Minix2 filesystem whether it resides on a primary disk partition or in a bochs image file, but cannot mount Minix 3 when it is on primary disk partition. Has anybody succeeded in doing it?...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Anyone successfully mounted the Minix3 filesystem from Linux?

  1. Anyone successfully mounted the Minix3 filesystem from Linux?

    I can mount the Minix2 filesystem whether it resides on a primary disk
    partition or in a bochs image file, but cannot mount Minix 3 when it is
    on primary disk partition. Has anybody succeeded in doing it?

  2. Re: Anyone successfully mounted the Minix3 filesystem from Linux?

    DogWalker wrote:
    > I can mount the Minix2 filesystem whether it resides on a primary disk
    > partition or in a bochs image file, but cannot mount Minix 3 when it is
    > on primary disk partition. Has anybody succeeded in doing it?


    No. Also, Linux doesn't support the new filesystem format.

    also, there is a BUG in FS in Minix 3 which prevents it from mounting v2
    and v1 1filesystems. It does check for these things, though...

  3. Re: Anyone successfully mounted the Minix3 filesystem from Linux?

    I have half succeeded. Read Only by now. I am working on the patch.
    Here it is:

    diff -ur linux-2.6.14.5/fs/minix/inode.c
    modified_linux-2.6.14.5/fs/minix/inode.c
    --- linux-2.6.14.5/fs/minix/inode.c 2005-12-27 01:26:33.000000000 +0100
    +++ modified_linux-2.6.14.5/fs/minix/inode.c 2006-01-05
    14:57:25.000000000 +0100
    @@ -7,6 +7,7 @@
    * Minix V2 fs support.
    *
    * Modified for 680x0 by Andreas Schwab
    + * Wrongly updated to version V3 by Daniel. January 5 2006
    */

    #include
    @@ -24,7 +25,6 @@

    static void minix_delete_inode(struct inode *inode)
    {
    - truncate_inode_pages(&inode->i_data, 0);
    inode->i_size = 0;
    minix_truncate(inode);
    minix_free_inode(inode);
    @@ -35,7 +35,7 @@
    int i;
    struct minix_sb_info *sbi = minix_sb(sb);

    - if (!(sb->s_flags & MS_RDONLY)) {
    + if (!(sb->s_flags & MS_RDONLY) && (sbi->s_version != MINIX_V3)) {
    sbi->s_ms->s_state = sbi->s_mount_state;
    mark_buffer_dirty(sbi->s_sbh);
    }
    @@ -118,19 +118,22 @@
    return 0;
    /* Mounting a rw partition read-only. */
    ms->s_state = sbi->s_mount_state;
    - mark_buffer_dirty(sbi->s_sbh);
    + if (sbi->s_version != MINIX_V3)
    + mark_buffer_dirty(sbi->s_sbh);
    } else {
    /* Mount a partition which is read-only, read-write. */
    sbi->s_mount_state = ms->s_state;
    ms->s_state &= ~MINIX_VALID_FS;
    - mark_buffer_dirty(sbi->s_sbh);
    + if (sbi->s_version != MINIX_V3)
    + mark_buffer_dirty(sbi->s_sbh);
    +
    + if (!(sbi->s_mount_state & MINIX_VALID_FS) && (sbi->s_version !=
    MINIX_V3))
    + printk ("MINIX-fs warning: remounting unchecked V%i fs, "
    + "running fsck is recommended.\n", sbi->s_version);
    + else if ((sbi->s_mount_state & MINIX_ERROR_FS) && (sbi->s_version !=
    MINIX_V3))
    + printk ("MINIX-fs warning: remounting V%i fs with errors, "
    + "running fsck is recommended.\n", sbi->s_version);

    - if (!(sbi->s_mount_state & MINIX_VALID_FS))
    - printk ("MINIX-fs warning: remounting unchecked fs, "
    - "running fsck is recommended.\n");
    - else if ((sbi->s_mount_state & MINIX_ERROR_FS))
    - printk ("MINIX-fs warning: remounting fs with errors, "
    - "running fsck is recommended.\n");
    }
    return 0;
    }
    @@ -197,6 +200,23 @@
    sbi->s_dirsize = 32;
    sbi->s_namelen = 30;
    sbi->s_link_max = MINIX2_LINK_MAX;
    + } else if ( *(__u16 *)(bh->b_data + 24) == MINIX3_SUPER_MAGIC) {
    +
    + s->s_magic = MINIX3_SUPER_MAGIC;
    + sbi->s_imap_blocks = *(__u16 *)(bh->b_data + 6);
    + sbi->s_zmap_blocks = *(__u16 *)(bh->b_data + 8);
    + sbi->s_firstdatazone = *(__u16 *)(bh->b_data + 10);
    + sbi->s_log_zone_size = *(__u16 *)(bh->b_data + 12);
    + sbi->s_max_size = *(__u32 *)(bh->b_data + 16);
    + sbi->s_nzones = *(__u32 *)(bh->b_data + 20);
    + sbi->s_dirsize = 64;
    + sbi->s_namelen = 60;
    + sbi->s_version = MINIX_V3;
    + sbi->s_link_max = MINIX2_LINK_MAX;
    + if ( *(__u16 *)(bh->b_data + 28) != 1024) {
    + if (!sb_set_blocksize(s,( *(__u16 *)(bh->b_data + 28))))
    + goto out_bad_hblock;
    + }
    } else
    goto out_no_fs;

    @@ -239,16 +259,16 @@
    if (!NO_TRUNCATE)
    s->s_root->d_op = &minix_dentry_operations;

    - if (!(s->s_flags & MS_RDONLY)) {
    + if (!(s->s_flags & MS_RDONLY) && (sbi->s_version != MINIX_V3)) {
    ms->s_state &= ~MINIX_VALID_FS;
    mark_buffer_dirty(bh);
    }
    - if (!(sbi->s_mount_state & MINIX_VALID_FS))
    - printk ("MINIX-fs: mounting unchecked file system, "
    - "running fsck is recommended.\n");
    - else if (sbi->s_mount_state & MINIX_ERROR_FS)
    - printk ("MINIX-fs: mounting file system with errors, "
    - "running fsck is recommended.\n");
    + if (!(sbi->s_mount_state & MINIX_VALID_FS) && (sbi->s_version !=
    MINIX_V3))
    + printk ("MINIX-fs: mounting unchecked V%i file system, "
    + "running fsck is recommended.\n", sbi->s_version);
    + else if ((sbi->s_mount_state & MINIX_ERROR_FS) && (sbi->s_version !=
    MINIX_V3))
    + printk ("MINIX-fs: mounting V%i file system with errors, "
    + "running fsck is recommended.\n", sbi->s_version);
    return 0;

    out_iput:
    @@ -277,7 +297,7 @@

    out_no_fs:
    if (!silent)
    - printk("VFS: Can't find a Minix or Minix V2 filesystem on device "
    + printk("VFS: Can't find a Minix V1|V2|V3 filesystem on device "
    "%s.\n", s->s_id);
    out_release:
    brelse(bh);
    diff -ur linux-2.6.14.5/fs/minix/minix.h
    modified_linux-2.6.14.5/fs/minix/minix.h
    --- linux-2.6.14.5/fs/minix/minix.h 2005-12-27 01:26:33.000000000 +0100
    +++ modified_linux-2.6.14.5/fs/minix/minix.h 2006-01-05
    14:55:00.000000000 +0100
    @@ -12,6 +12,7 @@

    #define MINIX_V1 0x0001 /* original minix fs */
    #define MINIX_V2 0x0002 /* minix V2 fs */
    +#define MINIX_V3 0x0003 /* minix V3 fs */

    /*
    * minix fs inode data in memory
    diff -ur linux-2.6.14.5/include/linux/minix_fs.h
    modified_linux-2.6.14.5/include/linux/minix_fs.h
    --- linux-2.6.14.5/include/linux/minix_fs.h 2005-12-27
    01:26:33.000000000 +0100
    +++ modified_linux-2.6.14.5/include/linux/minix_fs.h 2006-01-05
    14:54:06.000000000 +0100
    @@ -23,6 +23,7 @@
    #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
    #define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */
    #define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */
    +#define MINIX3_SUPER_MAGIC 0x4d5a /* minix V3 fs */
    #define MINIX_VALID_FS 0x0001 /* Clean fs. */
    #define MINIX_ERROR_FS 0x0002 /* fs has errors. */

    @@ -78,7 +79,7 @@
    };

    struct minix_dir_entry {
    - __u16 inode;
    + __u32 inode;
    char name[0];
    };


    The remaining work is just here at the end in the structure
    minix_dir_entry: How to merge the 16 bit pointers to the directories in
    the old version with the 32 bit pointers in the new one.

    Something will have to be patched also in dir.c


  4. Re: Anyone successfully mounted the Minix3 filesystem from Linux?

    Segin wrote:

    > DogWalker wrote:
    >> I can mount the Minix2 filesystem whether it resides on a primary disk
    >> partition or in a bochs image file, but cannot mount Minix 3 when it is
    >> on primary disk partition. Has anybody succeeded in doing it?

    >
    > No. Also, Linux doesn't support the new filesystem format.
    >
    > also, there is a BUG in FS in Minix 3 which prevents it from mounting v2
    > and v1 1filesystems. It does check for these things, though...


    In "Exchanging Data with Other Operating Systems" (<http://www.minix3.org
    doc/datxchng.html>) is stated under the heading "Linux Access to MINIX File
    Systems": "This category is a no-brainer. Linus used the then-current MINIX
    file system as the basis for Linux , and although Linux hard drives usually
    use the Linux ext3 or another newer file system now, support for the MINIX
    file system is usually included if floppy disk access is required -- newer
    file systems are not suited for floppy disks, and the MINIX fs is used for
    floppy disks by default. Just be sure when you configure Linux that you
    include support for the MINIX file system." Perhaps this declaration needs
    to be changed.


  5. Re: Anyone successfully mounted the Minix3 filesystem from Linux?

    DogWalker wrote:

    : In "Exchanging Data with Other Operating Systems" (<http://www.minix3.org
    : doc/datxchng.html>) is stated under the heading "Linux Access to MINIX File
    : Systems": "This category is a no-brainer. Linus used the then-current MINIX
    : file system as the basis for Linux , and although Linux hard drives usually
    : use the Linux ext3 or another newer file system now, support for the MINIX
    : file system is usually included if floppy disk access is required -- newer
    : file systems are not suited for floppy disks, and the MINIX fs is used for
    : floppy disks by default. Just be sure when you configure Linux that you
    : include support for the MINIX file system." Perhaps this declaration needs
    : to be changed.

    I wrote that and it was originally posted on my website at
    http://minix1.hampshire.edu/faq/datxchng.html. My site still supports only
    Minix 2.

    If you look at that page you will see it was last revised in March 2004,
    more than a year before the release of Minix 3. At that time I had only
    heard of the Minix 3 project, I had not seen even a preliminary release.
    And I had no idea that the file system was going to be changed in a way
    that would make it incompatible with earlier Minix file systems, including
    the Linux implementation.

    It is unfortunate that much documentation from Minix 2 was included in
    Minix 3 or posted on the Minix 3 website without being updated. It would
    have been helpful, perhaps, if the revision dates of documentation files
    had been preserved when files were copied to the Minix 3 site; that would
    at least have helped with recognition that files might not reflect the
    state of Minix 3.

    The Minix 3 project needs help. Obviously fixing both the Minix 3 file system
    and the Linux implementation of the Minix file system would be valuable
    contributions. There were also Windows/MS-DOS utilities to access Minix 2
    files; an update of those would also be a valuable contribution. Another
    useful contribution would be checking and updating documentation.

    --
    Note: to reply to me about Minix-related topics please use the address
    below, even if I have posted or e-mailed from another address.
    +----------------------------------+
    | Albert S. Woodhull |
    | awoodhull@hampshire.edu |
    | http://minix1.hampshire.edu/asw/ |
    +----------------------------------+


+ Reply to Thread