Active Topics

 


Reply
Thread Tools
Posts: 486 | Thanked: 251 times | Joined on Oct 2009
#11
Originally Posted by greenfly View Post
Did you change the partition type of the microSD to be type 83 (used for Linux partitions) or did you leave it as a FAT partition type and just change the format of the file system on that microSD partition?
Who are you asking? It happens that I repartitioned my microSD in the n900 and documented it in post http://talk.maemo.org/showthread.php...224#post425224

Relevant section:
Code:
sfdisk --change-id /dev/mmcblk1 1 83
mke2fs -t ext2 -m 0 /dev/mmcblk1p1
I have to manually mount this card after every boot.
 
Posts: 4 | Thanked: 1 time | Joined on Dec 2009 @ Berlin/Germany
#12
Originally Posted by greenfly View Post
Did you change the partition type of the microSD to be type 83 (used for Linux partitions) or did you leave it as a FAT partition type and just change the format of the file system on that microSD partition?
I hadn't done it but now I have and it doesn't work either.
 
Lord Raiden's Avatar
Posts: 1,562 | Thanked: 349 times | Joined on Jun 2008
#13
ROFL! What are you guys doing wrong? I'm using ext3 on at least one of my cards, and it auto mounts without even batting an eye!
__________________
Popular Sci-Fi author and creator of the Earthfleet Series.
www.realmsofimagination.net
 
Posts: 5 | Thanked: 2 times | Joined on Jul 2007
#14
Well my ext3 didn't automount either :-)
This is how I make it.
Usual disclaimers, if this doesn't make sense to you, you probably shouldn't be trying it ...

add these 4 lines to the bottom of /usr/sbin/mmc-mount
if [ $? -ne 0 ]
then
mount -o $3,noatime,nodiratime "$1" "$2" > /dev/null
fi
 
Posts: 50 | Thanked: 36 times | Joined on Feb 2010
#15
Originally Posted by offthefront View Post
Well my ext3 didn't automount either :-)
This is how I make it.
Usual disclaimers, if this doesn't make sense to you, you probably shouldn't be trying it ...

add these 4 lines to the bottom of /usr/sbin/mmc-mount
if [ $? -ne 0 ]
then
mount -o $3,noatime,nodiratime "$1" "$2" > /dev/null
fi
I just done this. I also edited out the code in rcS-whatever to keep from re-writing my /etc/fstab everyboot.

So far.

1. I can use "mount" to mount my sd card.
2. /etc/fstab doesn't wipe on boot.

I need to automount it on boot, lets say to /test. What am I missing??
 
Posts: 1 | Thanked: 6 times | Joined on Feb 2010
#16
I've managed to make the automount work for ext2 or ext3 on my N900 (PR1.1)

As usual any changes are at your own risk.....

The script /usr/sbin/osso-mmc-mount.sh is the one which seems to be responsible for doing the mounting for all partitions on MMC devices. It does some checks and then calls /usr/sbin/mmc-mount for each partition.

Looking at /usr/sbin/osso-mmc-mount.sh I found this section of code:

case "$PID" in
b | c | e | 4 | 6 | 14 | 16 | 1b | 1c | 1e)
logger "$0: $PDEV partition type is '$PID'"
;;
*)
logger "$0: $PDEV type '$PID' is not FAT32 or FAT16"
exit 1
;;
esac


What this is doing is looking at the Partition ID number (in hex) and checking it against a list of allowed values. If it is not an allowed value it falls through to the second case block and exit is called - meaning that the partition is not mounted.

The hex Partition ID for ext2 and ext3 is 83 - as you can see it is not on the list, and so this script will never attempt to mount ext2 or ext3 partitions. To fix this we simply need to add 83 to the list of allowed partition IDs in the case.

As normal - be very careful making changes as root. Having said that, here's how to change it:
1) Become root
2) Back up the file /usr/sbin/osso-mmc-mount.sh
3) Use vi or your favourite editor to edit /usr/sbin/osso-mmc-mount.sh
4) Make this change (it is line 46 for me on PR1.1)
Old:
b | c | e | 4 | 6 | 14 | 16 | 1b | 1c | 1e)
New:
b | c | e | 4 | 6 | 14 | 16 | 1b | 1c | 1e | 83)
5) Save the file
6) Reboot


You should now find that ext2 or ext3 partitions automount correctly.
 

The Following 6 Users Say Thank You to stair For This Useful Post:
Posts: 267 | Thanked: 183 times | Joined on Jan 2010 @ Campinas, SP, Brazil
#17
Thanks for your recipe, stair. But I found that it didn't work quite correctly on mine. I did the following extra step:

I modified /usr/sbin/mmc-mount which is in fact a shell script. It contains:

Code:
#!/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
That is, it tries to forcibly mount the mmc as a vfat filesystem. As this script is run everytime the back cover is attached to the phone (and its counterpart /usr/bin/mmc-unmount is run every time the back cover is opened -- yes, the path is different and it's a binary file!), I find it safer to modify it this way:

Code:
#!/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, mmc-mount first tries to mount it as a vfat card, with all the options. If it is unable to do it, it tries to mount the card with the filesystem type autodetected. It works best because this setup allows you to insert other types of MMC (vfat, ext2, ext3, whatever the N900 kernel supports) and also works correctly with the internal MMC card, which is vfat. I verified by plugging it with the USB cable and also removing the back cover and putting it back. It worked right in all these occasions and also unmounted and mounted the internal MMC correctly.
 

The Following 7 Users Say Thank You to Patola For This Useful Post:
Posts: 11 | Thanked: 11 times | Joined on May 2008
#18
I've made a wiki page containing the information found in that thread, you can check it here: http://wiki.maemo.org/Ext2_on_microSD_card
 

The Following User Says Thank You to angrycore For This Useful Post:
int_ua's Avatar
Posts: 676 | Thanked: 1,067 times | Joined on Jul 2010 @ Kyiv, Ukraine
#19
just wrote this script while travelling by the subway:
Code:
#!/bin/sh
# mmc-mounter 0.1
# Licence: GPLv3
# The script was written for Maemo 5 on Nokia N900
# to ease mounting multiple microSD partitions
# since the system wasn't able to recognise them.
# I hope it can help on other devices or OSes too.
# (c) 2010 Serhiy Zagoriya (int_ua)
# *please* mail bugs and feature requests to xintx.ua@gmail.com

if [ "$1" == "mount" ]; then
for partition in `ls /dev/mmcblk1p* | grep -o "[0-9]$"`; do
 echo "Partition "$partition
 mkdir -p /home/user/mmc/$partition
 sudo mount /dev/mmcblk1p$partition /home/user/mmc/$partition
 mountresponse=$?
 if [[ $mountresponse != 0 ]]; then
  if [[ $mountresponse == 255 ]]; then 
   echo "Already mounted"
   continue
  fi
  echo "Failed to mount /dev/mmcblk1p$partition automatically."
  read -p "If you know it's filesystem type, type it, ortherwise just press Enter: " fstype
  if [ "$fstype" != "" ]; then
   echo "mounting /dev/mmcblk1p$partition with '-t $fstype' option"
   sudo mount -t $fstype /dev/mmcblk1p$partition /home/user/mmc/$partition
  fi
 fi
done
#read -p "press Enter to close" None
exit 0
fi

if [ "$1" == "unmount" ]; then
for mountpoint in `cat /etc/mtab | grep -o "/dev/mmcblk1p[0-9]*"`; do 
 echo "Unmounting $mountpoint"
 sudo umount $mountpoint -f
 if [[ $? != 0 ]]; then
  lsof | grep /home/user/mmc/`echo $mountpoint | grep -o "[0-9]*"`
  echo -e "---\nCannot unmount partition $mountpoint. If it was mounted using mmc-mount script and there was opened files on it they are listed above (with lsof command)."
 fi
done
#read -p "press Enter to close" None
exit 0
fi

echo "usage: mmc-mounter.sh {mount|unmount}"
exit 1
Tomorrow I will try to enhance it with all your advices, especially Patola's one
I hope it will become alternative for those who don't want to mess with system files
 
Posts: 432 | Thanked: 917 times | Joined on Jun 2011
#20
Originally Posted by angrycore View Post
I've made a wiki page containing the information found in that thread, you can check it here: http://wiki.maemo.org/Ext2_on_microSD_card
Does anybody knows if it works on PR 1.3 and/or ext3 ? If yes (and if i do everything right) does the system could be restored from SD card using backupMenu ?
I'm asking just because i culdn't backing up rootfs and optfs to SD (ext3) since it wasn't automounted.
Hope someone understand what i mean...
Thanks.

Last edited by saponga; 2012-05-10 at 01:04.
 
Reply


 
Forum Jump


All times are GMT. The time now is 05:09.