Magical Module Request - Nintendo Switch Questions & Answers

I'd like if someone who knows how to write Magisk modules to create one to mount Switch fat32 storage on boot.

dracinn said:
I'd like if someone who knows how to write Magisk modules to create one to mount Switch fat32 storage on boot.
Click to expand...
Click to collapse
I'm pretty sure the FAT32 partition is already automatically mounted.

Jdbye said:
I'm pretty sure the FAT32 partition is already automatically mounted.
Click to expand...
Click to collapse
Where to thought ? FX.nextapp sees... nothing.
(In TWRP, yes, there it is)
dracinn said:
mount Switch fat32 storage on boot.
Click to expand...
Click to collapse
Nevermind,
su - mm
mkdir /mnt/extsd
chmod 777 /mnt/extsd
mount -o bind /dev/block/mmcblk0p1 /mnt/extsd
mount -o remount,rw /dev/block/mmcblk0p1 /mnt/extsd
#[Make sure global namespaces is ON in magisk!!!]

Related

wipe doesnt wipe

I am using cyanogen recovery, but when I wipe to factory reset from the boot, deletes messages, settings but no the applications, so after boot, I have to set it up like new but has icons and even broken icons from old apps unininstalled. Maybe I messed up the recovery, any suggestion to wipe whole thing?
Thanks in advance
To do a complete wipe, you'll need to format the ext partition. Wiping the phone's memory doesn't completely remove everything.
Can I do it from the phone? or do I have to do it on the PC
You can do it from your phone
In recovery, go to the console:
mount -o rw,remount /dev/block/mmcblk0p2 /system/sd
rm -r /system/sd/*
reboot
AdrianK said:
You can do it from your phone
In recovery, go to the console:
mount -o rw,remount /dev/block/mmcblk0p2 /system/sd
rm -r /system/sd/*
reboot
Click to expand...
Click to collapse
after the first line I get
mount: mounting /dev/block/mmcblk0p2 on /system/sd failed: Invalid argument
/#
I noticed that after a wipe, I still had loccy's modified browser. Does wiping only delete information that wasn't part of the original flash?
looks like I dont have mmcblk0p2 in block
rodeohat said:
after the first line I get
mount: mounting /dev/block/mmcblk0p2 on /system/sd failed: Invalid argument
/#
Click to expand...
Click to collapse
Epic fail on my part guys >< T
hat line should be
Code:
mount -o rw,remount /dev/block/mmcblk0p2 /system/sd
uansari1 said:
I noticed that after a wipe, I still had loccy's modified browser. Does wiping only delete information that wasn't part of the original flash?
Click to expand...
Click to collapse
Wiping only removes apps and settings (stuff in the /data/ partition of the nand, Launcher.apk resides in the /system/ partition) so launcher will not be affected.
sorry, I cant spot the difference. After I type:
mount -o rw,remount /dev/block/mmcblk0p2 /system/sd
I get
mouting /dev/block/mmcblk0p2 on system/sd failed: Invalid argument
I got it to work by typing:
# mount -o rw /dev/block/mmcblk0p2 /system/sd
# cd /system/sd
# rm -rf /system/sd/*
altough it said that couldnt delete it because it was busy,
I rebooted it, wipe, installed the ROM and all apps were gone
Thanks for your help
One more piece of code to put it on my evernote for later
AdrianK said:
Epic fail on my part guys >< T
hat line should be
Code:
mount -o rw,remount /dev/block/mmcblk0p2 /system/sd
Wiping only removes apps and settings (stuff in the /data/ partition of the nand, Launcher.apk resides in the /system/ partition) so launcher will not be affected.
Click to expand...
Click to collapse
remount is only used on partitions that are already mounted, and I can't think of a reason why ext3 partition would be mounted in recovery .
after wipe:
Code:
busybox rm -rf /system/sd/*
Gary13579 said:
remount is only used on partitions that are already mounted, and I can't think of a reason why ext3 partition would be mounted in recovery .
Click to expand...
Click to collapse
Ugh, I copied and psted the old command then forgot to make the change removing remount!! *repeatedly bangs head against the wall*
Sorry for the confusion..but you seem to have sorted it out for your selves
uansari1 said:
I noticed that after a wipe, I still had loccy's modified browser. Does wiping only delete information that wasn't part of the original flash?
Click to expand...
Click to collapse
Wipe clears data and cache only!!!
It does not remove applications in /system/app nor in /system/sd/app
If you have internal apps, ie in /data, then those will disappear

Creating Android's very own SDCard filesystem

If I were to create a 1.5gb fakesd.img ext2 file
done once, on computer
dd if=/dev/zero of=fakesd.img bs=1048576 count=1536
mke2fs -F fakesd.img
--------
done in rootfs-init
losetup /dev/block/loop2 /sdcard/fakesd.img
mount -t ext2 -o noatime,nodiratime /dev/block/loop2 /fakesd
change " symlink /mnt/sdcard /sdcard/ " in rootfs-init.rc
symlink /mnt/sdcard /fakesd/
probably want to avoid changing the external path from /mnt/sdcard/ to anything.. for compatibility sake..
I have my windows stuff on my card. I want android to index as little as possible yet still be able to access my sd card at /sdcard.. Will this work?
I have a feeling that someone is just going to tell me to partition card. I don't feel like it right now..
Partition the card Just kidding, but I like your thinking.
Trying to test it out post boot.. My router has more command line functionality, thanks Google.

Alternative to Apps2SD

After looking at the file system of the X10 and noticing lots of empty space on the /system partition and the fact I wanted more space for apps but didn't want to use my class 2 SD card (that is already pretty full!), I decided to try moving some of my larger apps and pointing to the new location using symlinks (like what apps2sd does). Got over 70mb extra space and no probs no far. New apps will just be installed in /data/app/ as before.
Goes without saying that you do this at your own risk and to make a backup first!
This hack of course requires root! And busybox installed.
First copy the apk file to /system/app2/ say (/system/app/ is already used for some system apps so I decided not to copy their so I could keep them separate.)
Check this is done correctly (I used root explorer) but if the command completed with no errors it should be ok. May need to mount /system as read/write.
Then delete the original file and create a symlink to the new file. (If the first step was done incorrectly this step will remove the app!)
I used an app called Scripter to read QR codes I generated from http://qrcode.kaywa.com/ (use text mode) with the code I wrote on my PC, just scan your comp screen with phone camera and it gives you the option to execute the text. (Or you could spend hours typing it in by hand.) adb didn't work for step 2 when I tried it (access denied).
If step 1 says access denied use root explorer to mount /system as read write and try again or use adb to copy the apps ("adb shell" then use the "busybox cp /data/app/com.rovio.angrybirds.apk /system/app2/com.rovio.angrybirds.apk" command)
Example with angrybirds:
First find the name of the .apk file (I used root explorer and navagated to /data/app/ and ordered by size) in this case "com.rovio.angrybirds.apk"
Copy it:
busybox cp /data/app/com.rovio.angrybirds.apk /system/app2/com.rovio.angrybirds.apk
Delete old file and create symlink:
busybox rm /data/app/com.rovio.angrybirds.apk
busybox ln -s /system/app2/com.rovio.angrybirds.apk /data/app/com.rovio.angrybirds.apk
I used notepad "find and replace" to change "com.rovio.angrybirds.apk" to the name of a different app and repeated.
Here are the names of the apps I moved (to save you typing out the names, all near the top of the list in terms of size).
com.polarbit.krazyracers.apk
com.rovio.angrybirds.apk
com.skype.raider.apk
com.fring.apk
com.qype.radar.apk
com.galcon.igalcon.apk
Hope this helps people who like me want more space for apps without using their SD card. Any probs ask here and hopefully I or someone else can help.
Shaun
i wonder if this really works
not calling into question what you say but I think in the long run is able to consume more resources (or at least the same) due to the fact that they also use a folder within the system...
just a thought
but hey, if it works ... WOW
I'd like to see it implemented in a sh script, accepting app name to move as a command line argument.
Or, even better - an apk, which lists all apps installed, and does moving selected ones. Should not be difficult to implement.
thanks for this, but can i do it on HTC Wildfire where it could actually matter?
and btw, currently my system folder has 175MB free space, how low do you think would be too low? how much free space really has to be free?
If by more resources you mean phone memory? Then yes it consumes the same amount of memory but as /system is on a different partition it consumes the memory in a different place (kind of like a different hard drive in your comp, google partitioning).
I'd love to make this into an app but have no idea where to start, prob wouldn't be too hard though, just a gui that passes busybox commands to the shell, with maybe some safe guards, say leave 50meg free, check its copied correctly ect, wonder if other phones have free space in /system as well? No idea with the script either or how to build a safeguard if command 1 fails don't do 2 and 3, but if someone can run a script they can prob do this.
Yeah should work on other phones if /system is mounted on a different partition and has free space. Run "df" (without quotes) in terminal or using adb run "adb shell" after you've connected to your phone and then "df" and post your output here and I'll let you know. My phone starts to complain (memory low message in status bar) and drop sms messages (really bad bug/feature!) when I get below 50meg, hence the reason for me doing this.
I tried to do the same thing but use /nand (internal storage) and link is created in /data/app but doesnt appear in drawer
It looks permission are the problem
have you tried Link2SD?
This is the only thing that is simple enough for everyone
Adolf1994 said:
have you tried Link2SD?
This is the only thing that is simple enough for everyone
Click to expand...
Click to collapse
Tried and couldnt have my SD recognize by my tablet after making the second partition.
I really like to make link2sd work but as soon I create the secont FAT32 or ext2 or ext3 card disapear
enotar said:
Tried and couldnt have my SD recognize by my tablet after making the second partition.
I really like to make link2sd work but as soon I create the secont FAT32 or ext2 or ext3 card disapear
Click to expand...
Click to collapse
tablet? what kind of tablet? if you partitioned the card wrong, it could cause unexpected things. I prefer to do it with SuperOS(formerly Super Ubuntu) distro or any kind of Ubuntu.
if that tablet is 2.1 then this should work, but if it's 2.2+ then app2sd is exactly you need.
Adolf1994 said:
tablet? what kind of tablet? if you partitioned the card wrong, it could cause unexpected things. I prefer to do it with SuperOS(formerly Super Ubuntu) distro or any kind of Ubuntu.
if that tablet is 2.1 then this should work, but if it's 2.2+ then app2sd is exactly you need.
Click to expand...
Click to collapse
Tablet: HSG-X5A-G 2.1
I format with a PC with Ubuntu and not recognize I even try with minitool on another PC
I did on ubuntu with 8gb SD Card X6 and gparted:
delete all partition on SD card apply
create a partition (1) of 8gb primary FAT32 apply
resize to 7.5gb this partition apply
create 0.5gb partition (2) with the free space after resize primary FAT32 apply.
set partition (1) active
put the card in tablet
and no detection of the card.
If I delete the 500 meg (2) partition the sdcard is imediately recognize after putting back in the tablet.
I even try second partition with ext2 or ext3 try too formating with clockwork recovery menu.I try too to copy to the new formated SD the dir Android, Android-secure and Lost.Dir...... Nothing work.
The second partition make my SD unrecognizable.
I even try to create a linux swap file of 32 meg and no chance too.
If someone can explain me why?
did you use cwm to format things? for now avoid things like this
if you have root(have you?), then please download irssi connectbot from market, open it, set the pulldown list to 'local' at the bottom and give it a name, enter.
then open the newly created connection, issue these commands and post the results here(with the sd card working):
Code:
$ su <- after this allow superuser access
# mount
Adolf1994 said:
did you use cwm to format things? YES
if you have root(have you?), YES
Click to expand...
Click to collapse
Result with my working 16gb card:
rootfs / rootfs ro 0 0tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
tmpfs /broadcasting tmpfs rw,size=1024k 0 0
/dev/block/mtdblock2 /system yaffs2 ro 0 0
/dev/block/mtdblock5 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block/ndda1 /nand vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fma
sk=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
if you put in the partitioned card, does Android notifies you to format it or doesn't even do that?
if it notifies you, please try to issue this command as superuser:
Code:
mount /dev/block//vold/179:1 /sdcard -t vfat -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro
Adolf1994 said:
if you put in the partitioned card, does Android notifies you to format it or doesn't even do that?
Click to expand...
Click to collapse
Dont even do that, no message at all
then issue the command anyway, and see if it works, if not, then post the results here
I create the second partition on the card (space was free) as primary and FAT32 put back the card in the tablet.
As the card was not recognize i use PC with adb:
adb remount
adb shell
su
mount /dev/block//vold/179:1 /sdcard -t vfat -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro
I get :
mount /dev/block//vold/179:1 /sdcard -t vfat -o rw,dirsync,nosuid,nodev,noexec,u
id=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset
=iso8859-1,shortname=mixed,utf8,errors=remount-ro
Usage: mount [-r] [-w] [-o options] [-t type] device directory
oh, the sequence that matters!
then type this:
Code:
mount -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro -t vfat /dev/block//vold/179:1 /sdcard
Adolf1994 said:
oh, the sequence that matters!
then type this:
Code:
mount -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro -t vfat /dev/block//vold/179:1 /sdcard
Click to expand...
Click to collapse
Result:
Usage: mount [-r] [-w] [-o options] [-t type] device directorymount -o rw,dirsyn
c,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,c
odepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro -t vfat
/dev/block//vold/179:1 /sdcard
Usage:: not found
Re runing give me this now:
mount -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,
allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=
remount-ro -t vfat /dev/block//vold/179:1 /sdcard
[1] + Stopped (signal) mount -o rw,dirsync,nosuid,nodev,noexec,uid=1000,g
id=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-
1,shortname=mixed,utf8,errors=remount-ro -t vfat /dev/block//vold/...
well, it looks like it's too high for me.
try to find the tablet's subforum and/or another senior member with the same tablet.
hope you can solve it
and please post here the things you found
Thank you very much to try....

USB External hard drive on Nook Touch?

Hi everyone,
I'm trying to figure out if I can get my nook to be the ultimate upgrade on a 160gb Ipod, that is to get it to work with an external battery powering a 200gb or higher 2.5" external hard drive.
and then using audio through USB.
Do you know if that is theorically possible? (power wouldnt be an issue with external power but maybe the nook just can't recognize any external storage beyond a certain capacity)
the info is probably out there somewhere but I'm sad to say I don't know enough to understand most of what I find on the board (yet)
please tell me it's possible !
cheers
I don't see why it wouldn't work.
USB mass storage should all be the same.
You'll need to mount it.
I'll have to borrow a 2.5" disk in a USB enclosure and try it today.
Hi Renate,
Great! thanks for your reply
and wow! thanks for looking into this!
I'll have to wait till next month to give it a try, the idea is to build some sort of portable dock (using the slots meant for the nook cases) with battery/USB hub/hard drive and jack audio output so I can use the nook+dock as a unit, just the dock as music library on my laptop or just the nook for reading.
I've been dreaming of an e-ink computer for some time, the three main things I needed were a keyboard, and sound output (both of which you already took care of, and mass storage) if you tell me it works I'll post a guide on how to get that done.
I have a 2.5" disk out of an old laptop in a USB.
It has 3 partitions on it.
Yes, it works fine on FAT, FAT32 & NTFS
If you use this a lot, you might want to put a mkdir for the mount point in init.rc before the root goes ro.
This is how you have to mount it if you have to do all the steps.
Code:
mount -o rw,remount rootfs /
mkdir /usb
mount -t vfat /dev/block/uba1 /usb
Change vfat to ntfs if applicable.
Thanks a lot Renate,
I don't quite understand everything yet, but I'll get there (there's plenty to read on this board) don't bother explaining, if you start you'll never see the end of it.
Now I suppose the big question is : can the nook touch take a 300gb itunes library? I'll get back to you on that
cheers
I tried this script
mount -o rw,remount rootfs /
mkdir /usbdisk
mount -o rw,iocharset=utf8 -t vfat /dev/block/uba1 /usbdisk
Click to expand...
Click to collapse
for fat32 hard disks - 500 and 1000gb and work perfect
but for ntfs
mount -o rw,remount rootfs /
mkdir /usbdisk
mount -o rw,iocharset=utf8 -t ntfs /dev/block/uba1 /usbdisk
Click to expand...
Click to collapse
script works without errors but usbdisk folder remained empty.
where I do mistake? please advice.
Try without any of the options.
It may be that with the default driver NTFS can only be mounted read-only.
Code:
mount -t ntfs /dev/block/uba1 /usbdisk
Renate NST said:
...
If you use this a lot, you might want to put a mkdir for the mount point in init.rc before the root goes ro.
This is how you have to mount it if you have to do all the steps.
Code:
mount -o rw,remount rootfs /
mkdir /usb
mount -t vfat /dev/block/uba1 /usb
Change vfat to ntfs if applicable.
Click to expand...
Click to collapse
Does this just work on top of a plain rooted 1.1.2, or do I also need some additional apk?
It should work on anything.
Renate NST said:
It should work on anything.
Click to expand...
Click to collapse
What I meant to ask was if the above process (to mount an external drive on the NST) was contingent on the prerequisite "to first get my NST to support USB Host Mode"?
Yes, to get a disk drive working you need to somehow get the Nook to be a USB host.
The straight forward way is to install verygreen & mali100's uImage and then use my UsbMode.apk to switch it into host mode.
This is all detailed in another thread: http://forum.xda-developers.com/showthread.php?t=1457971
You'll need a powered hub if you want to run a disk drive.
If you know what you are doing and you use a back-powering hub you can get the Nook to kick into USB host mode without any modifications or apps.
Oh, yeah, of course an OTG adapter is required for any of this.
Thanks for reply/pointer.
I found the usb-host-mt-pack_0.1.zip.
I assume I should replace the NullKbd-1.1.apk and UsbMode-1.2.apk in the zip file with their corresponding newer versions NullKbd-1.2.apk and UsbMode-1.6.apk?
Renate NST said:
Try without any of the options.
It may be that with the default driver NTFS can only be mounted read-only.
Code:
mount -t ntfs /dev/block/uba1 /usbdisk
Click to expand...
Click to collapse
Renate thanks for advice. I tried without any of the options, but without luck. usbdisk folder still remaining blank. Please any more suggestions.
You probably have multiple partitions on the drive.
Try:
Code:
busybox fdisk -l /dev/block/uba1
Then you'll have to do something like:
Code:
mount -t ntfs /dev/block/uba1p1 /usb
Renate NST said:
Try without any of the options.
It may be that with the default driver NTFS can only be mounted read-only.
Code:
mount -t ntfs /dev/block/uba1 /usbdisk
Click to expand...
Click to collapse
Renate NST said:
You probably have multiple partitions on the drive.
Try:
Code:
busybox fdisk -l /dev/block/uba1
Then you'll have to do something like:
Code:
mount -t ntfs /dev/block/uba1p1 /usb
Click to expand...
Click to collapse
I get this print with error:
***********************
# busybox fdisk -l /dev/block/uba1
busybox fdisk -l /dev/block/uba1
Disk /dev/block/uba1: 500.1 GB, 500104691712 bytes
255 heads, 63 sectors/track, 60800 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/uba1p1 ? 120528 234814 918008208 4f Unknown
Partition 1 does not end on cylinder boundary
/dev/block/uba1p2 ? 119381 153271 272218546+ 73 Unknown
Partition 2 does not end on cylinder boundary
/dev/block/uba1p3 ? 113202 147075 272087568 2b Unknown
Partition 3 does not end on cylinder boundary
/dev/block/uba1p4 ? 177064 177067 27487 61 Unknown
Partition 4 does not end on cylinder boundary
Partition table entries are not in disk order
# mount -t ntfs /dev/block/uba1p1 /usbdisk
mount -t ntfs /dev/block/uba1p1 /usbdisk
mount: No such file or directory
**********************
p.s. In Windows this disk have one ntfs partition only.
Hmm, I tried fdisk on an old 256M flash drive that I had and got similar gobble-dee-gook.
It mounted correctly though without a partition number.
Renate NST said:
Hmm, I tried fdisk on an old 256M flash drive that I had and got similar gobble-dee-gook.
It mounted correctly though without a partition number.
Click to expand...
Click to collapse
Now tried sd 256mb ntfs via card reader. In fdisk - same gibberish output. mount work w/o errors but usbdisk dir still empty (on sd were few files).
Renate NST said:
...
If you use this a lot, you might want to put a mkdir for the mount point in init.rc before the root goes ro.
This is how you have to mount it if you have to do all the steps.
Code:
mount -o rw,remount rootfs /
mkdir /usb
mount -t vfat /dev/block/uba1 /usb
Change vfat to ntfs if applicable.
Click to expand...
Click to collapse
Is there another way to auto-create a persistent mount point without fiddling with unpacking/repacking uRamdisk to apply the snippet to its init.rc copy?
digixmax said:
Is there another way to auto-create a persistent mount point ...
Click to expand...
Click to collapse
Certainly. Just do it in init.rc before the root is mounted read-only.
Code:
[b]mkdir /usb 0777 system system[/b]
mount rootfs rootfs / ro remount
(init.rc is in uRamdisk in the boot partition.
use bootutil.exe to extract and replace the init.rc)

System RW on Axon 7 US

I'm just having root from Magisk 13 on B25. I used ES File Explorer to convert some app into system app but /system doesn't give me rw permission. I keep change back to RO on my root explorer.
I diid terminal command and have this
mount -o remount,rw /system
mount: '/dev/block/bootdevice/by-name/system'->'/system': Device or resource busy
Click to expand...
Click to collapse
and this
mount | grep \system
/dev/block/sde13 on /system type ext4 (ro,seclabel,relatime,discard,data=ordered)
/dev/block/loop0 on /system/etc/hosts type ext4 (rw,seclabel,relatime,data=ordered)
Click to expand...
Click to collapse
I feel like the security doesn't let me change permission for system somehow.
Thanks in advanced!
NVm, i solved the issue. I haven't disable the write protection. I guess i need to do it after upgrade android.

Categories

Resources