By The Dark Knight


2014-12-02 10:49:20 8 Comments

I want to edit some files on my phone but I can not access the root folder on my phone.

I'm using a rooted Google Nexus 5 running Android 5.0. I can read/write to my /, and /system by Android's ES file explorer but not Windows' software.

How can I mount the Android system file in Windows, so I can read/write to the same places from there? If that's not possible on Windows: I'm also use Ubuntu. So, Can I mount my phone under Ubuntu?

4 comments

@razz 2016-04-30 09:45:02

install fx file explorer from play store .....and give it root acces and change it through filesystem

@Izzy 2014-12-02 17:46:15

There's a second way, which should work with multiple operating systems on the computer's end: Taking a look at my list of file Android server apps, you can find some Android file-server apps using WebDAV or Samba, and SSH Clients & Server has some for SSH. Check those with "root capabilities", as you want to access the entire file system read/write.

Preparing your device for read/write access is done the same way as specified in my other answer. Then start the "server-app" you've selected, and you should be ready – not even a cable needed, as this works via WiFi:

  • Linux supports SSHFS, i.e. mounting the file system via SSH. There are also helpers to achieve this on Windows (listed there)
  • Samba is supported as "Samba" on Linux, and should be natively supported on Windows as "Windows Share"
  • WebDAV should also be supported by both systems

So with any of the three categories, you should be able to mount your Android's file system under Linux as well as Windows. Only possible "drawbacks" here are that you need an additional app on the Android device, and it might be a bit slower due to WiFi (the latter must not necessarily be the case, though).

@Trish Ling 2014-12-02 15:13:47

Windows File Explorer by default doesn't let you access the Android root files. You'll need to download a different application (to your PC) for that. Many places (like this guidingtech.com tutorial recommend Android Commander. Another recommended file explorer program is Droid Explorer.

@Izzy 2014-12-02 16:50:54

If you need a specific application to interact with the Android device's file system, that's not answering the question. Mounting a file system makes it available system-wide, for any application. If the question would be "how to copy files", there are many fine applications for that – Ryan's Droid Explorer definitely being one of them (the dev is active here as well ;)

@Trish Ling 2014-12-02 16:52:44

It is answering the question as in how you see and read/write the android system's root files on the pc.

@Izzy 2014-12-02 17:15:30

Yupp, it answers that part of the question, you're right. Maybe I take it a little to literal, as the title says mount android file system. It's definitely a useful hint – which the OP might wish to follow, lacking alternatives on Windows :) So thanks for bringing this in!

@Izzy 2014-12-02 14:58:20

I cannot answer the Windows part – but the Ubuntu part I can answer for sure, as I'm using that as well and mount my devices from my computer, sometimes with full r/w access. What I use needs ADB tools to be installed on your computer. If you didn't already install them, see e.g. Is there a minimal installation of ADB?

Prepare your Droid

First a basic requirement, applying to any OS which might run on your computer: To be able to get full access, the ADB daemon needs to be running in root-mode. This is not the case with stock ROMs, even if rooted, by default (though many custom ROMs have it enabled by default). So first check: If an "ordinary" adb shell directly brings you to the root-prompt (#) without invoking su, you're fine. Otherwise, you will need a helper like adbd insecure: Run it, and enable the "patched insecure mode". Optionally check the box to have that accomplished automatically on every boot of your device.

Prepare for write access to read-only file systems

Second, again independent from the OS on your computer: to read and write to file systems, they need to be mounted in read/write mode. You can accomplish that via adb shell anytime you need to write there (I don't recomment leaving those partitions in permanent read/write mode), e.g. issuing a mount -o remount,rw /system for the /system partition.

Mount your Droid

Now let's go for the specifics. I mount the Android file system via ADB, utilizing FUSE. The tool for that is adbfs-rootless. Compiling the code is easy given the instructions there; that done, copy the resulting adbfs binary to a directory in your $PATH. Then create a mount-point on your computer; in my example, I will use ~/droid for that. Now here we go:

# Mount the Android FS:
adbfs ~/droid
# Unmount it again:
fusermount -u ~/droid

To ease the process, I've created two aliases:

alias mdroid="adbfs ~/droid"
alias udroid="fusermount -u ~/droid"

You surely already have guessed: mdroid stands for "mount droid", udroid for "unmount droid".

A different approach to manually mounting/unmounting is using Midnight Commander with a specific VFS: mc-extfs-adb is doing that. A version I've spefically adapted for Ubuntu is available in the download area at IzzyOnDroid, where you can simply pick it (installation instructions included).

Both variants have their pros and cons: mc-extfs-adb takes quite a while on first access (while it caches the entire file system structure) – but then is pretty fast browsing the file system (as it is cached), only slowing down when you copy/edit files remotely. Using adbfs directly starts up much faster, but then always "hesitates" for a second when switching directories (as it does not cache the entire structure, but only reads on demand). I usually prefer the latter, but YMMV – hence I've given you both options :)

@The Dark Knight 2014-12-02 16:02:10

I've followed what you said, when I implement the command "adbfs ~/droid" my pc show "droid has been connected", the terminal show "--*-- exec_command: adb shell ls" but when I click on the device symbol, It show "Unhandled error message: Error when getting information for file '/home/peter/droid': Transport endpoint is not connected". What must I do now?

@Izzy 2014-12-02 16:48:24

The first part (what the terminal shows) is normal and expected behavior. As clicking in the shell doesn't do anything, I don't know what "device symbol" you mean; you should rather cd to that folder, or (using your file explorer) navigate to /home/peter/droid (the "local" directory) instead of some device. For file operations, I'm not the "graphical guy" ;)

@The Dark Knight 2014-12-02 16:59:28

This is what the terminal show [email protected]:~/adbfs-rootless$ ./adbfs /droid --*-- exec_command: adb shell ls [email protected]:~/adbfs-rootless$ /home/peter/droid bash: /home/peter/droid: Transport endpoint is not connected

@Izzy 2014-12-02 17:19:00

Do you have the device connected, and USB debugging enabled? What does adb devices show? I've never seen that error message, but somehow "Transport endpoint is not connected" seems to indicate there's nothing on the "other end" that could be used.

@The Dark Knight 2014-12-02 17:21:04

adb devices: List of devices attached 04b713228291c6d0 device The USB debugging mode is enabled.

@Izzy 2014-12-02 17:23:47

Uh, looks like you've run into issue #3 – please follow up to that Github ticket, fix is there.

Related Questions

Sponsored Content

0 Answered Questions

0 Answered Questions

What file system for Asus Zenfone 2 on CentOS 6.9?

2 Answered Questions

0 Answered Questions

Big issue related to system less root

0 Answered Questions

Link2SD: Mount script cannot be created

1 Answered Questions

[SOLVED] Unable to mount /system as read-write

0 Answered Questions

mount in shell as user or root with different output

2 Answered Questions

[SOLVED] Android folder does not show up in Windows 7

2 Answered Questions

[SOLVED] Galaxy S3: "/sdcard/Sounds" folder appears empty in Windows 7

1 Answered Questions

[SOLVED] System file contain mount command

  • 2014-07-07 08:51:40
  • Mark98T
  • 343 View
  • -1 Score
  • 1 Answer
  • Tags:   sd-card mount

Sponsored Content