Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I'm creating a guide for noobs on editing the SystemUI.apk on the US Galaxy S3. But, before I post the guide, I want to make sure I know my stuff! I'm looking to learn about ADB (and ADB shell) and its various commands. I've noticed that some users mount their system read-write like so:

mount -o remount,rw /system

But, others mount like so:

mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system

I have a little bit of knowledge behind this (-o signifies options, yaffs2 signifies the file system, /dev/block/mtdblock4 signifies mount point, and /system is the actual directory), but why do people have different commands? Is it unsafe to miss some of the arguments? Why do some people include the mount point? The file system? Some separate multiple options using commas, others use spaces: does that matter?

Instead of asking 50 questions like those, does anyone know where to find the documentation/reference/explanation of the mount command, and describing its options? If you are feeling extra great, any documentation/reference/explanation regarding ADB and busybox-for-android available? (Besides these: http://busybox.net/downloads/BusyBox.html and http://developer.android.com/tools/help/adb.html , which are a little lacking.)

Someone knows these things, but my Google-fu is took weak... :( I would sincerely appreciate your guidance, any at all! :)

share|improve this question
1  
mount is fairly standard *nix utility. I don't think you'll really find any specific "Android" documentation for it, but the man page is readily available. –  eldarerathis Jan 26 '13 at 6:14
    
Wow, thanks! That page really helped. Bookmarked! :) –  Ibrahim Khan Jadoon Jan 26 '13 at 17:13
add comment

2 Answers

up vote 1 down vote accepted

On some devices/ROMs most mount points seem to be defined in a special config file called /etc/fstab. In this case, you can ommit the device information and options, as they can be automatically determinded.

However, other devices/ROMs use init scripts to create the mounts, and have the special options defined there (CM7.2 on my Motorola Milestone seems to be one example for this). If you omit the device information here, you will simply get an error.

So which variant to take very much depends on the device/ROM. Safest way is to first check how the file system in question is mounted (e.g. using mount |grep system to show it for the /system mount point), and then adapt this information for your use.

share|improve this answer
    
Oh, OK. Like in the man page posted in the comment above, mount will guess if I omit. But, what if I specify the wrong for system, for example? My /system is mounted as ext4, but say I use -t yaffs2? Will that return a simple error or will it actually, probably dangerously, convert it to the specified file system? Thanks for the explanation of how Android describes its mount points! :) –  Ibrahim Khan Jadoon Jan 26 '13 at 17:14
    
It's basically the same as on Linux (as Android runs on top of a Linux kernel). And no, no automatically conversion will take place -- the mount process will simply fail, as it cannot correctly determine the file system specifics. –  Izzy Jan 26 '13 at 19:01
    
Awesome! :D Thank for the clarification, :) I really appreciated your help! :) –  Ibrahim Khan Jadoon Jan 27 '13 at 0:40
add comment

Android uses by default toolbox, if you want you can use busybox instead. I haven't found documentation except a string in the binary saying Usage: %s [-r] [-w] [-o options] [-t type] device directory and the toolbox/mount.c, which is at http://gitorious.org/android-enablement/system-core/blobs/bc7b0cbe156da639f0cbe17bf89725d87e86512a/toolbox/mount.c

share|improve this answer
    
Thanks for the info! Izzy's answer was more helpful, but seeing the "usage" string was important, too! –  Ibrahim Khan Jadoon Jan 26 '13 at 19:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.