分享

adb shell mount command: documentation?

 ihacku 2015-03-16

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:///downloads/BusyBox.html and http://developer./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! :)

asked Jan 26 '13 at 6:06
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

2 Answers

 

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.

answered Jan 26 '13 at 11:45
Izzy
45.7k2086309
    
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

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:///android-enablement/system-core/blobs/bc7b0cbe156da639f0cbe17bf89725d87e86512a/toolbox/mount.c

answered Jan 26 '13 at 14:32
ott--
158116
    
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

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多