mounting ext sd partition - Nexus One Q&A, Help & Troubleshooting

I would like to mount an ext2 partition that is readable/writable without root privilege. My hope is to put a Debian installation on it. I figure I might as well be able to use the partition for general storage as well. Unfortunately, my current setup insists on root access to touch the partition. Is there any way my regular CM7 user privilege can read/write to the ext partition?
Update:
My last phone (before it was run over by a car) would not allow the remounting of /system as read/write. Now that I have a N1, I mounted system as rw [mount -o remount -o rw /system] and edited /system/etc/init.d/05mountsd. The $SD_EXT_DIRECTORY line formerly read "$BB chmod 771" (I think). It is editied to read "$BB chmod 777".
Linux experience tells me that this is weird; I would rather change ownership, but it appears that Android abuses the user concept. I am not a user; applications are users. I do not believe that I have a user to give SD rights. I guess as long as no one ever wants multi user Android its OK. Otherwise it will end up biting them in the ass--a la multiuser windows.

Related

How do i enable compcache on CM 3.9.2 and higher? [SOLVED]

I have been searching for a clear guide to enabling compcache on 3.9.2, but there is so much info about swap and compcache in this forum i feel like im running around like a chicken with its head cut off.
so far i have pushed 3 different userinit.sh files into my /system/sd with no change.
#free shows 0 swap , #cat /proc/ramzswap says doesnt exist , #cat /proc/swaps comes up blank.
So i searched more and ended up making a 32mb linuxswap partition on my sd and cant figure out how to get that moving either.
Im bogged down with information and have no idea where to start.
Someone point me in the right direction please. Im a swap/compcache noob...
i would like to run them both together, but as i said i need a noob setup guide
Your /system/sd is a mounted ext filesystem, correct?
Push the userinit.sh from here:
http://forum.xda-developers.com/showthread.php?t=542304
Then run it as root and report back any results:
# /system/sd/userinit.sh
i pushed userinit.sh to /system/sd/ with adb
then put in console
su
# /system/sd/userinit.sh and got /system/sd/userinit.sh: permission denied
should i be doing this in the recovery console?
and what did u mean by: is my system/sd/ a mounted ext filesystem?
i did adb remount to mount /system/ as r/w if thats what you meant.
let me apologize once again. i have almost no knowledge of linux commands. a step by step would really save some time. the only thing i hate more than not understanding something, is wasting others time while i do it.
ShatBag1105 said:
and what did u mean by: is my system/sd/ a mounted ext filesystem?
Click to expand...
Click to collapse
sounds like you did not set up a second partition (or a 3rd for that matter) on your sdcard.
there are many different ways to do this (I prefer gparted in linux), but here's one guide that uses parted in cyanogen's 1.4 recovery image:
http://forum.xda-developers.com/showthread.php?t=534714
hit me up if you hit a snag
gl
im pretty sure you are right. My mmcblk0p2 exists (of course) but when I check # /dev/block/mmcblk0p3 it says not found. And if I # ls /dev/block/mmcbl0p3 it says no such file or directory.
Im guessing i botched something in paragon partition 9. if i remember correctly i put the 32mb linuxswap partition between my fat32 and ext3.
Do u think i should create a new linuxswap partition after my ext3 with paragon9, or is there a workaround for my mistake? does the phone even recognize my poorly placed partition as anything?
thanks so much for your help. after a few hours of reading all these threads Ive come to realize you are the resident expert in swap compcache scripts. as for myself.... not so much
ext should be 2nd partition.
...and linux swap 3rd if you're using it (but it's not needed for compcache -- only as a backing swap).
I'd kill them both and readd with some variant of parted -- i've read that some are having trouble w/ paragon partitioning
Very well then. Ill reformat today and report back.
First of all! Paragon Partition Manager is a FARCE!
Gparted Live CD was awesome. Paragon had my sdcard looking pretty bad. I had 32mb of unallocated space between my FAT32 and EXT3. Even though paragon was telling me it was formatted to linuxswap.
I moved my ext3 over and created a 32mb linuxswap at the end of the sdcard with no loss of data. wow
But sadly, i pushed the userinit.sh #free shows 0 swap and #cat /proc/swaps shows nothing.
Im going to try this >> http://forum.xda-developers.com/showthread.php?t=542899 <<<WORKED!!
What ive learned:
Use Gparted to create a linuxswap partition AFTER your EXT3. Paragon is pure ****.
Get the user.conf and userinit.sh file from the link in above post.
Put them in the root of your sd card
I DID THIS WITH TERMINAL
su
mount -o remount,rw /dev/block/mtdblock3 /system
cp /sdcard/userinit.sh /system/sd
cp /sdcard/user.conf /system/sd
chmod 755 /system/sd/user.conf
chmod 755 /system/sd/userinit.sh
type #sh /system/sd/userinit.sh into console to activate the script.
type #sh /system/sd/userinit.sh -s to get a pretty well detailed report of the goings on.
OOOh being a linux noob is much headache.
Alpapa Thanks for giving me your time and pointing me in the right directions. Thanks man.
ShatBag1105 said:
Use Gparted to create a linuxswap partition AFTER your EXT3. Paragon is pure ****.
push the user.conf file (from link in above post) to /system/sd along with your userinit.sh.
type #sh /system/sd/userinit.sh into console to activate the script.
type #sh /system/sd/userinit.sh -s to get a pretty well detailed report of the goings on.
OOOh being a linux noob is much headache.
Alpapa Thanks for giving me your time and pointing me in the right directions. Thanks man.
Click to expand...
Click to collapse
I'm a newb as well... so did you chmod either of those files after moving them to ext2/3?
Yes. You have to chmod both of them.
And this works on 3.9.4.
V 0.1 files work best.
http://forum.xda-developers.com/showthread.php?t=542899
And these files come with everything disabled, so you have to edit both of them and enable what u want before putting them on your sd.
0=disabled
1=enabled

ext2 formatted ext-sd mounting

I'm attempting to format my external sdcard to ext2, just one single partition (no apps2sd magic).
The reasons are to have the ability to store >4GB files on the card, faster read times, and not needing compatibility with any M$ systems/PCs/Junk, journaling (>ext2) is not needed.
At the moment, I'm running a CM based ROM (cyanfox) and will likely try this out on a moto/stock based ROM after.
Here is my progress so far :
I'm able to mount the SD manually, though with some hoops being involved. The bionic will not mount it automatically, and is constantly telling me that it is unsupported/empty/needs to be formatted in the storage menu, and a permanent notification.
In a terminal shell, I can mount the device (/dev/block/vold/179:97) by specifying the type only as ext4. This is definitely not ideal, but I get errors when the type is specified as ext2 or ext3. (error : mount: Operation not supported on transport endpoint ).
At the moment, I've made an init script to mount the sd at /storage/sdcard1 but this doesn't cause android to think that the actual sd is mounted properly (empty sd notification still exists). Though it is at least mounted.
And I have edited the fstab file at root to change the sd type from vfat to ext2, but this file rewrites itself at boot. Unfortunately I'm not able to set an immutable bit on the file.. (android is not a type writer).
The ext2 filesystem has been checked for errors, does have files written to it, and is able to be read/written to in android after manually mounting it. Android just insists on a fat partition though.
Any help/tips would be appreciated. I'll update this thread in case anyone else would like to apply this as well.
Also, if I'm missing something blatantly obvious, please let me know

How important is unmounting rw access in linux?

If I mount a write protected system partition with a command like "mount uw /", how important is it that I end with a "mount r /" before finishing/rebooting/shutting down/whatever? I'm a linux noob clearly.
On a similar topic, with our phones in root explorer, how important is it to return to RO access after making changes with RW?
Thanks

cannot mount ext partitons (or anything) under lollipop

Yes i can't mount any partiotion of the sd card to the phone under lollipop, i tried everything, this is because i can't use link2sd or foldermount, so i tried using commands in terminal emulator like mount -t sdext4 -o rw /dev/block/vold/179:66 /data/sdext2 , the command seems to works at first but the folder is still empty, i used the directory bind commands lime mount -o bind but this isn't working either, it seem that lollipop broke something in this phone or is using another metod.
Foldermount isn't working for me either. Be aware of namespace isolation for mount as default in SuperSU. Check it here http://su.chainfire.eu/#how-mount
Same Here. I have Stock 5.0.2, root, TWRP. I can create a Mountscript with Link2SD, but after the neccessary reboot, it is impossible to move items since "/data/sdext2 could not be mounted". I think, some boot procedure from Motorola messes with the Link2SD Skript.
Okay little UPDATE: If you go into supersu and disable this namespace option, sdext2 can be mounted. Link2SD warns, that the mounting isn't possible while booting , so the apps moved by Link2SD are invisible. If you do a quick reboot from Link2SD, the apps can be seen. So it works, but is rather complicated. Also, not every app seems to be movable...

[GUIDE][ROOT] Link2SD

Link2SD GUIDE
ROOTED DEVICES ONLY
Link2SD is a good solution to save the contents of your internal memory, I know we have a lot but its a good idea in the case of saving more space on your internal memory.
Back up your external sd contents before proceeding!
STEP 1
Install these:
https://play.google.com/store/apps/details?id=stericson.busybox
https://play.google.com/store/apps/details?id=com.sylkat.AParted
https://play.google.com/store/apps/details?id=com.broodplank.initdtoggler
https://play.google.com/store/apps/details?id=jackpal.androidterm
STEP 2
If you've already installed busybox, skip this step.
Install busybox using the busybox installer into /system/xbin
STEP 3
After install, unmount your external sd card from System/Storage/Unmount SD Card
THEN, unmount your external sdcard and sdext2 partition if you have one, from terminal emulator.
Thsi varies from ROM to ROM, I'm on CM11, so I run these commands
Code:
mount -o remount,ro /storage/sdcard1
umount /storage/sdcard1
mount -o remount,ro /data/sdext2
umount /data/sdext2
If you're stock, do this...
Code:
mount -o remount,ro /storage/external_SD
umount /storage/external_SD
mount -o remount,ro /data/sdext2
umount /data/sdext2
Again, rom specific. If you don't have an sdext2 partition, no need for the BOTTOM TWO commands.
STEP 4
Open AParted and resize your external sd card's partition, then make yourself an ext4 formatted sdext partition. Mine is 8 GB in size, since I have a 16 GB card. The journal write takes a long time...usually about a minute and a half. Don't cancel it or you'll end up with a corrupt sd card.
STEP 5
Remount your sd card by your system menu, this is the easy way.
STEP 6
Toogle init.d in Init.d Toggler. Only for stock ROMs without init.d support. Skip this if you've already done init.d or have a ROM that has it baked/enabled.
STEP 7
Install Link2SD and the pro key. The pro key costs money, so if you're poor than I'm sorry. I'm really poor, it's only a few bucks. XD
https://play.google.com/store/apps/details?id=com.buak.Link2SD
https://play.google.com/store/apps/details?id=com.buak.link2sdplus
Run Link2SD after both are installed. If done correctly you'll get a prompt asking you to create your mount scripts, so select ext4 format and confirm, then CANCEL reboot. Go to Link2SD settings and enable Relink Lib files and Relink .dex files at boot. I also make my cache auto-clear every 6 hours or so. Auto link is a really bad idea. Since some system apps break when you link them. Clear the app and dalvik cache. Some of your apps may crash. Recreate your mount scripts again, then REBOOT.
STEP 8
Go into Link2SD and link all your user apps, you can use the filter at the top and serlect "User" to see which ones you installed. DO NOT link anything that modifies your system, since those apps are known to break. For example, voltage control or ROM Manager / ROM Toolbox break when you link them. Since you have the pro version you can link the internal data too!
DO NOT link any system apps. This is a likely known cause for a brick.
DO NOT link CM themes.
DO NOT link launchers.
STEP 9
You have successfully installed Link2SD and have it working! I suggest installing SD booster or making yourself an init.d script to boost your read ahead speed at boot. This helps A LOT with app execution on older sd cards.
I hope this guide helped! Remember, if you fark up you did it to yourself! I'm not responsible.
The L90 D415 is awesome!!!
~LoopyD
Donate to the PayPalz ([email protected])
Partitions with cwm can work too?
I don't use cwm, but TWRP, so wouldn't know.

Categories

Resources