Ext2 on microSD card

(Make the card to automount by system)
(typo, use {{ambox}})
 
(4 intermediate revisions not shown)
Line 1: Line 1:
-
'''DISCLAIMER: By changing system's internals like described in that article you can easily brake you device! Do at your own risk! Do not type in terminal commands you do not understand! You are fully responsible for your actions.'''
+
{{ambox|text='''DISCLAIMER: By changing system's internals like described in that article you can easily break you device!'''
 +
 
 +
Do so at your own risk! Do not type in terminal commands you do not understand! You are fully responsible for your actions.}}
'''WARNING!''' Formatting your MicroSD card to another file system will erase all data on it! Backup the data first!
'''WARNING!''' Formatting your MicroSD card to another file system will erase all data on it! Backup the data first!
Line 6: Line 8:
===Format the cart into ext2===
===Format the cart into ext2===
-
Everything have to be performed as root!
+
 
 +
Everything have to be performed [[root access|as root]]!
First make sure that you have e2fsprogs package installed
First make sure that you have e2fsprogs package installed
  apt-get install e2fsprogs
  apt-get install e2fsprogs
-
Check your MicroSD card's device name (I think it have to be the same on all n900's, but it is worth to recheck which device you are going to format anyway)
+
Check your MicroSD card's device name (I think it have to be the same on all N900's, but it is worth to recheck which device you are going to format anyway)
  mount | grep /media/mmc1
  mount | grep /media/mmc1
The output have to contain something like that:
The output have to contain something like that:
  /dev/mmcblk1p1 on /media/mmc1
  /dev/mmcblk1p1 on /media/mmc1
-
here ''/dev/mmcblk1p1'' is the MicroSD's card device name.
+
here <code>/dev/mmcblk1p1</code> is the MicroSD's card device name.
Then unmount your MicroSD card:
Then unmount your MicroSD card:
  umount /media/mmc1/
  umount /media/mmc1/
 +
 +
Mark the card partition type as Linux 83
 +
sfdisk -c /dev/mmcblk1 1 83
 +
Format the card:
Format the card:
  mkfs.ext2 /dev/mmcblk1p1
  mkfs.ext2 /dev/mmcblk1p1
Line 21: Line 28:
Now you can try to mount the card manually
Now you can try to mount the card manually
  mount -t ext2 /dev/mmcblk1p1 /media/mmc1/
  mount -t ext2 /dev/mmcblk1p1 /media/mmc1/
-
===Make the card to automount by system===
+
To fix permissions problem you can do the following:
 +
chown -R user:users /media/mmc1/
 +
 
 +
===Make the card to be automounted by system===
 +
 
As described here [http://forums.internettablettalk.com/showpost.php?p=510591&postcount=16] and here [http://forums.internettablettalk.com/showpost.php?p=510591&postcount=16] you have to do the following:
As described here [http://forums.internettablettalk.com/showpost.php?p=510591&postcount=16] and here [http://forums.internettablettalk.com/showpost.php?p=510591&postcount=16] you have to do the following:
*Become root
*Become root
-
*Back up the file /usr/sbin/osso-mmc-mount.sh
+
*Back up the file <code>/usr/sbin/osso-mmc-mount.sh</code>
-
*Use vi or your favourite editor to edit /usr/sbin/osso-mmc-mount.sh
+
*Use vi or your favourite editor to edit <code>/usr/sbin/osso-mmc-mount.sh</code>
-
*Make this change (it is line 46 on PR1.1 and PR1.2)
+
*Make this change (it is line 46 on [[Maemo 5/PR1.1|PR1.1]] and [[Maemo 5/PR1.2|PR1.2]])
Old:
Old:
  b | c | e | 4 | 6 | 14 | 16 | 1b | 1c | 1e)
  b | c | e | 4 | 6 | 14 | 16 | 1b | 1c | 1e)
Line 32: Line 43:
  b | c | e | 4 | 6 | 14 | 16 | 1b | 1c | 1e | 83)
  b | c | e | 4 | 6 | 14 | 16 | 1b | 1c | 1e | 83)
*Save the file
*Save the file
-
*Back up the file /usr/sbin/mmc-mount
+
*Back up the file <code>/usr/sbin/mmc-mount</code>
-
*Use vi or your favourite editor to edit /usr/sbin/mmc-mount
+
*Use vi or your favourite editor to edit <code>/usr/sbin/mmc-mount</code>
*Make the file to contain the following:
*Make the file to contain the following:
-
<pre>#!/bin/sh
+
<source lang="bash">#!/bin/sh
-
mount -t vfat -o $3,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir "$1" "$2" > /dev/null || mount -t ext2 -o $3,noauto,noatime,nodiratime "$1" "$2" > /dev/null </pre>
+
mount -t vfat -o $3,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir "$1" "$2" > /dev/null || mount -t ext2 -o $3,noauto,noatime,nodiratime "$1" "$2" > /dev/null
 +
</source>
'''NOTE''' Patola [http://forums.internettablettalk.com/showpost.php?p=574704&postcount=17] originally suggested to modify the file that way:
'''NOTE''' Patola [http://forums.internettablettalk.com/showpost.php?p=574704&postcount=17] originally suggested to modify the file that way:
-
<pre>#!/bin/sh
+
<source lang="bash">
-
mount -t vfat -o $3,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir "$1" "$2" > /dev/null || mount -o $3,noauto,noatime,nodiratime "$1" "$2" > /dev/null </pre>
+
#!/bin/sh
-
This way, if mmc-mount is unable to mount it as a vfat card, with all the options, it tries to mount the card with the filesystem type autodetected.
+
mount -t vfat -o $3,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir "$1" "$2" > /dev/null || mount -o $3,noauto,noatime,nodiratime "$1" "$2" > /dev/null
-
But I've mentioned that it does not work if you don't have loaded kernel module of the file system you are going to use. So if you want to use that approach you have to take care that you have ext2's kernel module loaded before the execution of that script.
+
</source>
 +
This way, if mmc-mount is unable to mount it as a vfat card, with all the options, it tries to mount the card with the filesystem type autodetected. But I've mentioned that it does not work if you don't have loaded kernel module of the file system you are going to use. So if you want to use that approach you have to take care that you have ext2's kernel module loaded before the execution of that script.
Save the file and reboot, now the card have to be mounted automatically in all cases.
Save the file and reboot, now the card have to be mounted automatically in all cases.
 +
 +
[[Category:Power users]]
 +
[[Category:N900]]

Latest revision as of 15:35, 4 March 2011

Image:Ambox_notice.png
DISCLAIMER: By changing system's internals like described in that article you can easily break you device! Do so at your own risk! Do not type in terminal commands you do not understand! You are fully responsible for your actions.

WARNING! Formatting your MicroSD card to another file system will erase all data on it! Backup the data first!

If you want to format your MicroSD card with ext2 file system to get permissions, symlink/hardlink and big files (bigger than 2 gigabytes) support you have to do the following:

[edit] Format the cart into ext2

Everything have to be performed as root! First make sure that you have e2fsprogs package installed

apt-get install e2fsprogs

Check your MicroSD card's device name (I think it have to be the same on all N900's, but it is worth to recheck which device you are going to format anyway)

mount | grep /media/mmc1

The output have to contain something like that:

/dev/mmcblk1p1 on /media/mmc1

here /dev/mmcblk1p1 is the MicroSD's card device name. Then unmount your MicroSD card:

umount /media/mmc1/

Mark the card partition type as Linux 83

sfdisk -c /dev/mmcblk1 1 83

Format the card:

mkfs.ext2 /dev/mmcblk1p1

Now you can try to mount the card manually

mount -t ext2 /dev/mmcblk1p1 /media/mmc1/

To fix permissions problem you can do the following:

chown -R user:users /media/mmc1/

[edit] Make the card to be automounted by system

As described here [1] and here [2] you have to do the following:

  • Become root
  • Back up the file /usr/sbin/osso-mmc-mount.sh
  • Use vi or your favourite editor to edit /usr/sbin/osso-mmc-mount.sh
  • Make this change (it is line 46 on PR1.1 and PR1.2)

Old:

b | c | e | 4 | 6 | 14 | 16 | 1b | 1c | 1e)

New:

b | c | e | 4 | 6 | 14 | 16 | 1b | 1c | 1e | 83)
  • Save the file
  • Back up the file /usr/sbin/mmc-mount
  • Use vi or your favourite editor to edit /usr/sbin/mmc-mount
  • Make the file to contain the following:
#!/bin/sh
mount -t vfat -o $3,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir "$1" "$2" > /dev/null || mount -t ext2 -o $3,noauto,noatime,nodiratime "$1" "$2" > /dev/null

NOTE Patola [3] originally suggested to modify the file that way:

#!/bin/sh
mount -t vfat -o $3,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir "$1" "$2" > /dev/null || mount -o $3,noauto,noatime,nodiratime "$1" "$2" > /dev/null

This way, if mmc-mount is unable to mount it as a vfat card, with all the options, it tries to mount the card with the filesystem type autodetected. But I've mentioned that it does not work if you don't have loaded kernel module of the file system you are going to use. So if you want to use that approach you have to take care that you have ext2's kernel module loaded before the execution of that script.

Save the file and reboot, now the card have to be mounted automatically in all cases.