The Following User Says Thank You to javispedro For This Useful Post: | ||
![]() |
2014-01-22
, 22:10
|
Posts: 594 |
Thanked: 1,094 times |
Joined on Aug 2012
@ Rhine
|
#22
|
![]() |
2014-01-22
, 23:03
|
Posts: 539 |
Thanked: 518 times |
Joined on May 2010
@ nanaurbusiness
|
#23
|
[root@Jolla nemo]# df -h Filesystem Size Used Avail Use% Mounted on rootfs 14G 5.0G 8.3G 38% / /dev/mmcblk0p28 14G 5.0G 8.3G 38% / devtmpfs 406M 64K 406M 1% /dev tmpfs 407M 72K 407M 1% /dev/shm tmpfs 407M 34M 373M 9% /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/mmcblk0p19 8.0M 4.1M 3.9M 52% /drm /dev/mmcblk0p9 48M 8.3M 40M 18% /var/systemlog /dev/mmcblk0p18 64M 45M 20M 70% /firmware /dev/mmcblk0p28 14G 5.0G 8.3G 38% /swap /dev/mmcblk0p28 14G 5.0G 8.3G 38% /home tmpfs 407M 0 407M 0% /mnt/asec tmpfs 407M 0 407M 0% /mnt/obb /dev/mmcblk1 60G 288K 56G 1% /run/user/100000/media/sdcard [root@Jolla nemo]#
#!/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" case "${ID_FS_TYPE}" in vfat|ntfs|exfat) mount $SDCARD $MNT -o uid=$DEF_UID,gid=$DEF_GID ;; *) mount $SDCARD $MNT chown $DEVICEUSER: $MNT ;; esac else umount $SDCARD if [ $? = 0 ]; then rm -f $SDCARD else umount -l $MNT rm -f $SDCARD fi fi
The Following 2 Users Say Thank You to J4ZZ For This Useful Post: | ||
![]() |
2014-01-24
, 11:11
|
Posts: 594 |
Thanked: 1,094 times |
Joined on Aug 2012
@ Rhine
|
#24
|
#!/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
[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
![]() |
2014-01-24
, 11:57
|
|
Posts: 2,355 |
Thanked: 5,249 times |
Joined on Jan 2009
@ Barcelona
|
#25
|
The Following User Says Thank You to javispedro For This Useful Post: | ||
![]() |
2014-01-24
, 12:00
|
Posts: 204 |
Thanked: 443 times |
Joined on Jul 2012
@ Germany - Potsdam
|
#26
|
... cut done by meemorph ...
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.
The Following User Says Thank You to meemorph For This Useful Post: | ||
![]() |
2014-01-25
, 12:03
|
Posts: 594 |
Thanked: 1,094 times |
Joined on Aug 2012
@ Rhine
|
#27
|
1. If I create an ambience from a picture on the sd-card, this ambience is gone after reboot. Thats why I think, the mount-sd.sh is executed too late. If I copy the picture to the picture folder (tempfs) and create the ambience, it is persistent. You should try, If an ambience if persistent with your conf.
2. I advise to use the .android subdirectory for the /data/sdcard rebind, like you did in your script. Because: I did an uninstall of the android support an all android apps. Then I did a new install of the android support. After that the /data/sdcard folder was *completly* empty. The android support deleted the hole folder, I think. I had some pictures before uninstalling and installing the androis support in that folder, but everything was gone, not only the folders of the android apps. If someone binds the root of the sdcard to /data/sdcard, do not uninstall and install android support, before you have a backup.
if [ "$ACTION" = "add" ]; then mount /dev/mmcblk1p1 /mnt/sdcard2 mount -o bind /mnt/sdcard2/.home /home/nemo mount -o bind /mnt/sdcard2/.android /data/sdcard else umount /data/sdcard umount /home/nemo umount /mnt/sdcard2 fi
[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 268K 406M 1% /dev/shm tmpfs 407M 23M 384M 6% /run tmpfs 407M 0 407M 0% /sys/fs/cgroup tmpfs 407M 24K 407M 1% /tmp /dev/mmcblk0p25 8.0M 4.2M 3.8M 54% /persist /dev/mmcblk0p19 8.0M 4.1M 3.9M 52% /drm /dev/mmcblk0p18 64M 45M 20M 70% /firmware /dev/mmcblk0p28 14G 4.1G 9.2G 31% /swap /dev/mmcblk0p28 14G 4.1G 9.2G 31% /home /dev/mmcblk0p9 48M 7.5M 40M 16% /var/systemlog /dev/mmcblk1p1 60G 2.6G 54G 5% /mnt/sdcard2 /dev/mmcblk1p1 60G 2.6G 54G 5% /home/nemo /dev/mmcblk1p1 60G 2.6G 54G 5% /data/sdcard 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
if [ "$ACTION" = "add" ]; then if [ $(mount | grep -c /mnt/sdcard2) != 1 ]; then mount /dev/mmcblk1p1 /mnt/sdcard2 mount -o bind /mnt/sdcard2/.home /home/nemo mount -o bind /mnt/sdcard2/.android /data/sdcard fi else umount /data/sdcard umount /home/nemo umount /mnt/sdcard2 fi
[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 204K 406M 1% /dev/shm tmpfs 407M 33M 374M 9% /run tmpfs 407M 0 407M 0% /sys/fs/cgroup tmpfs 407M 8.0K 407M 1% /tmp /dev/mmcblk0p19 8.0M 4.1M 3.9M 52% /drm /dev/mmcblk0p25 8.0M 4.2M 3.8M 54% /persist /dev/mmcblk0p9 48M 6.6M 41M 14% /var/systemlog /dev/mmcblk0p18 64M 45M 20M 70% /firmware /dev/mmcblk0p28 14G 4.1G 9.2G 31% /swap /dev/mmcblk0p28 14G 4.1G 9.2G 31% /home /dev/mmcblk1p1 60G 2.7G 54G 5% /mnt/sdcard2 /dev/mmcblk1p1 60G 2.7G 54G 5% /home/nemo /dev/mmcblk1p1 60G 2.7G 54G 5% /data/sdcard tmpfs 407M 0 407M 0% /mnt/asec tmpfs 407M 0 407M 0% /mnt/obb /dev/mmcblk1p1 60G 2.7G 54G 5% /run/user/100000/media/sdcard
The Following User Says Thank You to Leinad For This Useful Post: | ||
![]() |
2014-01-25
, 13:45
|
Posts: 33 |
Thanked: 25 times |
Joined on Sep 2011
@ grenoble
|
#28
|
/dev/mmcblk0p28 on / type btrfs (rw,noatime,thread_pool=4,ssd,noacl,space_cache,autodefrag) devtmpfs on /dev type devtmpfs (rw,relatime,size=415332k,nr_inodes=103833,mode=755) none on /proc type proc (rw,relatime) none on /sys type sysfs (rw,relatime) tmpfs on /dev/shm type tmpfs (rw,relatime) devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620) tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755) tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,mode=755) cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd) cgroup on /sys/fs/cgroup/debug type cgroup (rw,nosuid,nodev,noexec,relatime,debug) cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu) cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer) debugfs on /sys/kernel/debug type debugfs (rw,relatime) fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime) tmpfs on /tmp type tmpfs (rw) mtp on /dev/mtp type functionfs (rw,relatime) /dev/mmcblk0p25 on /persist type ext4 (ro,nosuid,nodev,relatime,data=ordered) /dev/mmcblk0p19 on /drm type ext4 (rw,nosuid,nodev,relatime,data=ordered) /dev/mmcblk0p9 on /var/systemlog type ext4 (rw,nosuid,nodev,relatime,data=ordered) /dev/mmcblk0p18 on /firmware type vfat (ro,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=cp437,iocharset=iso8859-1,shortname=lower,errors=remount-ro) /dev/mmcblk0p28 on /swap type btrfs (rw,relatime,thread_pool=4,ssd,noacl,space_cache,autodefrag) /dev/mmcblk0p28 on /home type btrfs (rw,relatime,thread_pool=4,ssd,noacl,space_cache,autodefrag) tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000) tmpfs on /mnt/obb type tmpfs (rw,relatime,mode=755,gid=1000) statefs on /run/state type fuse.statefs (rw,nosuid,nodev,relatime,user_id=0,group_id=100,default_permissions,allow_other) statefs on /run/user/100000/state type fuse.statefs (rw,nosuid,nodev,relatime,user_id=100000,group_id=100000,default_permissions,allow_other) /dev/mmcblk1 on /data/sdcard type btrfs (rw,relatime,thread_pool=4,compress=zlib,ssd,noacl,space_cache) /dev/mmcblk1 on /home/nemo/Videos type btrfs (rw,relatime,thread_pool=4,compress=zlib,ssd,noacl,space_cache) /dev/mmcblk1 on /home/nemo/Desktop type btrfs (rw,relatime,thread_pool=4,compress=zlib,ssd,noacl,space_cache) /dev/mmcblk1 on /home/nemo/Documents type btrfs (rw,relatime,thread_pool=4,compress=zlib,ssd,noacl,space_cache) /dev/mmcblk1 on /home/nemo/Downloads type btrfs (rw,relatime,thread_pool=4,compress=zlib,ssd,noacl,space_cache) /dev/mmcblk1 on /home/nemo/Music type btrfs (rw,relatime,thread_pool=4,compress=zlib,ssd,noacl,space_cache) /dev/mmcblk1 on /home/nemo/Pictures type btrfs (rw,relatime,thread_pool=4,compress=zlib,ssd,noacl,space_cache) /dev/mmcblk1 on /home/nemo/Public type btrfs (rw,relatime,thread_pool=4,compress=zlib,ssd,noacl,space_cache) /dev/mmcblk1 on /home/nemo/Templates type btrfs (rw,relatime,thread_pool=4,compress=zlib,ssd,noacl,space_cache)
![]() |
2014-01-25
, 14:24
|
Posts: 33 |
Thanked: 25 times |
Joined on Sep 2011
@ grenoble
|
#29
|
![]() |
2014-01-25
, 18:16
|
Posts: 284 |
Thanked: 661 times |
Joined on Aug 2013
@ Finland
|
#30
|
ok, so someone here asked me how i have made all these subvolume ****, here is a exact copy of the pm i replied to:
[...]
mkfs.btrfs -f /dev/mmcblk1
yeah right, WITHOUT any p1. direct from the block
(the "-f" is not mandatory, it useful when you have problem because the device don't want to release it or something, whatever. try first without, if it works congrats, if you need it, use it)
[...]
btrfs subvolume create /mnt/microsd/Desktop
btrfs subvolume create /mnt/microsd/Documents
btrfs subvolume create /mnt/microsd/Downloads
btrfs subvolume create /mnt/microsd/Music
btrfs subvolume create /mnt/microsd/Public
btrfs subvolume create /mnt/microsd/Templates
btrfs subvolume create /mnt/microsd/Videos
btrfs subvolume create /mnt/microsd/sdcard
btrfs subvolume create /mnt/microsd/Pictures
[...]
cp -r -a -v /home/nemo/sdcard/ /mnt/microsd/sdcard
cp /home/nemo/Pictures/Jolla/* /mnt/microsd/Pictures/Jolla/
cp /home/nemo/Video/Jolla/* /mnt/microsd/Videos/Jolla/
cp /home/nemo/Videos/Jolla/* /mnt/microsd/Videos/
(if you already have any music or something to those old directory:
cp /home/nemo/Music/*
etc ....)
then, we can mount
as you can see, the compress argument is here. btrfs is able to compress "on the fly", and, more, if the data is incompressible, it remain the same. afterward, btrfs as a flaw, it's "compress all the volume/subvolume or nothing" that why i mantioned it only time
mount -o subvol=sdcard,compress /dev/mmcblk1 /home/nemo/sdcard/ [?]
mount -o subvol=Videos /dev/mmcblk1 /home/nemo/Videos/
mount -o subvol=Desktop /dev/mmcblk1 /home/nemo/Desktop/
mount -o subvol=Documents /dev/mmcblk1 /home/nemo/Documents/
mount -o subvol=Downloads /dev/mmcblk1 /home/nemo/Downloads/
mount -o subvol=Music /dev/mmcblk1 /home/nemo/Music/
mount -o subvol=Pictures /dev/mmcblk1 /home/nemo/Pictures/
mount -o subvol=Pictures /dev/Public /home/nemo/Public/
mount -o subvol=Public /dev/mmcblk1 /home/nemo/Public/
mount -o subvol=Templates /dev/mmcblk1 /home/nemo/Templates/
The Following User Says Thank You to Thoke For This Useful Post: | ||
You would not be able to use an SD card if your internal memory was full!
Obviously, it does not work this way. Something is wrong and I suggest you carefully verify your setup.