View Single Post
Posts: 594 | Thanked: 1,094 times | Joined on Aug 2012 @ Rhine
#24
Well, that's really strange... i know i had this problem a week ago, but now i can't reproduce it.
I played around a lot with the configuration and also reformatted the sdcard several times with different FS, so maybe the problem was present, when the sdcard was on FAT32 (don't want to reformat for testing, because now there's a lot of data on it), ATM it's on ext4.

So i guess, javispedro is right and i mixed something up, while playing around with the sdcard... so i removed my own mountpoint and use the standard mountpoint instead.

Now my mount-sd.sh looks like this:
Code:
#!/bin/bash

SDCARD=/dev/sdcard
DEF_UID=$(grep "^UID_MIN" /etc/login.defs |  tr -s " " | cut -d " " -f2)
DEF_GID=$(grep "^GID_MIN" /etc/login.defs |  tr -s " " | cut -d " " -f2)
DEVICEUSER=$(getent passwd $DEF_UID | sed 's/:.*//')
MNT=/run/user/$DEF_UID/media/sdcard

if [ "$ACTION" = "add" ]; then
	if [ -b /dev/mmcblk1p1 ]; then
		ln -sf /dev/mmcblk1p1 $SDCARD
	elif [ -b /dev/mmcblk1 ]; then
		ln -sf /dev/mmcblk1 $SDCARD
	else
		exit $?
	fi
	su $DEVICEUSER -c "mkdir -p $MNT"
  mount $SDCARD $MNT
  mount -o bind ${MNT}/.home /home/nemo
  mount -o bind ${MNT}/.android /data/sdcard
else
  umount /data/sdcard
  umount /home/nemo
	umount $SDCARD

	if [ $? = 0 ]; then
		rm -f $SDCARD
	else
		umount -l $MNT
		rm -f $SDCARD
	fi
fi
and my df output looks like this:
Code:
[nemo@localhost ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
rootfs                 14G  4.1G  9.2G  31% /
/dev/mmcblk0p28        14G  4.1G  9.2G  31% /
devtmpfs              406M   64K  406M   1% /dev
tmpfs                 407M   72K  407M   1% /dev/shm
tmpfs                 407M   20M  387M   5% /run
tmpfs                 407M     0  407M   0% /sys/fs/cgroup
tmpfs                 407M  8.0K  407M   1% /tmp
/dev/mmcblk0p25       8.0M  4.2M  3.8M  54% /persist
/dev/mmcblk0p18        64M   45M   20M  70% /firmware
/dev/mmcblk0p19       8.0M  4.1M  3.9M  52% /drm
/dev/mmcblk0p28        14G  4.1G  9.2G  31% /swap
/dev/mmcblk0p28        14G  4.1G  9.2G  31% /home
/dev/mmcblk0p9         48M  6.6M   41M  14% /var/systemlog
tmpfs                 407M     0  407M   0% /mnt/asec
tmpfs                 407M     0  407M   0% /mnt/obb
/dev/mmcblk1p1         60G  2.6G   54G   5% /run/user/100000/media/sdcard
/dev/mmcblk1p1         60G  2.6G   54G   5% /home/nemo
/dev/mmcblk1p1         60G  2.6G   54G   5% /data/sdcard
...looks good to me

i think, now it's time to rewrite first post to "noob-proof" receipe, or are there any problems with this conf? on my device, it works without problems.