Create an EXT2 filesystem with mke2fs or mkfs.ext2

Hardware, coding, music, graphic and various applications

Moderators: Mug UK, moondog/.tSCc., [ProToS], lp, Moderator Team

User avatar
Crash
Captain Atari
Captain Atari
Posts: 285
Joined: Tue May 17, 2005 1:12 pm

Create an EXT2 filesystem with mke2fs or mkfs.ext2

Postby Crash » Thu Aug 16, 2007 4:06 am

Greetings,

I'm trying to make another one of my partitions into EXT2 format in MiNT. I previously used HDdriver to make this a LNX partition, but now I have no idea what the proper usage is for mke2fs or mkfs.ext2

The usage information contains no example of syntax, and I don't even know what all of these mean:

mke2fs Usage: %s [-c|-t|-l filename] [-b block-size] [-f fragment-size]
[-i bytes-per-inode] [-N number-of-inodes]
[-m reserved-blocks-percentage] [-o creator-os] [-g blocks-per-group]
[-L volume-label] [-M last-mounted-directory] [-O feature[,...]]
[-r fs-revision] [-R raid_opts] [-s sparse-super-flag]
[-qvSV] device [blocks-count]

Help!
Last edited by Crash on Sat Aug 18, 2007 5:22 am, edited 1 time in total.

Lautreamont
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 103
Joined: Fri Jan 27, 2006 9:11 pm
Location: Friceland

Postby Lautreamont » Fri Aug 17, 2007 9:35 pm

I'm not the appropriate person to answer that, I don't use Atari/Mint (not even a real Atari these times). But I know Linux.

mke2fs and mkfs.ext2 should be exactly the same program with two names.

Code: Select all

mke2fs Usage: %s ...
The "usage" display looks broken, it should say:

Code: Select all

 Usage: mke2fs ...


Use it without option, the default should be ok (connect as root):

Code: Select all

mke2fs device
Where "device" is the device name of your partition. You'll have to find its name.
If the tool you used to create that partition displayed something like "/dev/hd<letter><number>" or "/dev/sd<letter><number>" as its name, you've found it. Otherwise, you can take a look at the '/etc/fstab' text file (if you have it) on the line which describes the root (ie mounted on "/") partition of your MiNT kernel. Your new partition will have the same name prefix with another number.

When you have formatted it, you'll have to "mount" it to use it, i.e you must associate a directory (I'll use "/home/p2") to the device:

Code: Select all

mkdir /home/p2
mount -t ext2 -o rw /dev/hd<letter><number> /home/p2
Find a better directory name than /home/p2.

If you want your partition to be automatically mounted at boot time (otherwise you'll have to type the mount command as root everytime you boot), add a line in the '/etc/fstab' file: copy the line that describes the root partition (ie "/"), change the device number to the one of your new partition, the mount point to the directory you created and maybe the options to "rw" (read/write)

This is what the new '/etc/fstab' line would look like on Linux:

Code: Select all

# /etc/fstab
#
# <device>      <mount point>   <type>  <options>               <dump>  <pass>
/dev/hda8       /home/p2        ext2    rw                      0       2
"dump" and "pass" are for the Linux kernel. MiNT may not have them, that's why you should copy the line describing "/" as mount point, change "device", "mount point" and "options" and keep the rest.

User avatar
Knezzen
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 147
Joined: Thu Apr 27, 2006 8:58 pm
Location: Sweden, Next to my Falcon 060
Contact:

Postby Knezzen » Fri Aug 17, 2007 11:08 pm

I just use for example:

Code: Select all

mke2fs e:


To make drive "e:" ext2.

//Knezzen

User avatar
Crash
Captain Atari
Captain Atari
Posts: 285
Joined: Tue May 17, 2005 1:12 pm

Postby Crash » Sat Aug 18, 2007 5:25 am

Hmmm...

I tried this, with the command:

mkfs.ext2 r:

It seemed to work, but when I tried to copy files to that drive, the file manager crashes (either Teradesk or Kobold). I tried to repair the drive using:

fsck -a r:

and lots of duplicate/bad blocks, illegal block numbers, and other problems were found and apparently fixed, but it still doesn't work. On bootup, the system says:

The filesystem size according to the superblock is 2577660 blocks.
The physical size of the device is 25777628 blocks
Either the superblock or the partition table is likely to be corrupt
Unexpected inconsistency; run fsck manually

All the same problems are found. It seems that I must need to specify some parameters when making the filesystem, but I have no idea what.

Thanks

User avatar
Knezzen
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 147
Joined: Thu Apr 27, 2006 8:58 pm
Location: Sweden, Next to my Falcon 060
Contact:

Postby Knezzen » Sat Aug 18, 2007 9:29 am

I have no idea really, i have allways used that syntax... I can have a look at it today.

//Knezzen


Social Media

     

Return to “Professionals”

Who is online

Users browsing this forum: No registered users and 4 guests