Moving files to the root directory of Android is a task that users face when installing custom firmware, modifications system applications or backing up important data. Unlike ordinary folders like Download or DCIM, the root directory (/) is protected by the system from accidental changes. Without special rights or tools, even a standard file manager will not show its contents.
The problem is complicated by the fact that smartphone manufacturers (Samsung, Xiaomi, Huawei) often block access to system partitions through the graphical interface. However, there are workarounds - from using ADB commands to receiving root access. In this article, we will analyze all the current methods, including those that work without superuser rights, and also warn about the risks that come with careless manipulation of system files.
What is the Android root folder and why access to it is limited
The root folder (or root directory) is the top level of the Android file system, indicated by the symbol /. It stores all system files, including:
- ๐
/systemโ OS kernel, pre-installed applications, fonts; - ๐
/dataโ user data, application settings; - ๐
/vendorโ drivers and proprietary components of the manufacturer; - ๐
/sdcardโ symbolic link to internal memory user.
Access restrictions have been introduced for two reasons:
- Security: accidental deletion or modification of system files can lead to bootloop (boot loop) or complete inoperability of the device.
- OS Integrity: manufacturers block modifications to prevent the installation of uncertified software (for example, via
MagiskorXposed).
On most modern smartphones (for example, Samsung Galaxy S23 or Xiaomi 13) even with USB debugging enabled (ADB) you canโt just copy the file to /system. This will require additional tools or rights.
โ ๏ธ Attention: Changing files in/systemor/vendormay disrupt the operation of OTG, camera, mobile network or lead to resetting the device to factory settings. You perform all actions at your own risk. risk.
Method 1: Moving via ADB (without root access)
Android Debug Bridge (ADB) is an official tool from Google that allows you to manage the file system via the command line. The method works on most devices, but has limitations: you will not be able to write files to protected system folders (for example, /system/app) if you do not have superuser rights.
What you will need:
- ๐ฅ๏ธ Computer with Windows/macOS/Linux;
- ๐ฑ Smartphone with enabled debugging USB;
- ๐ USB cable (preferably original).
Steps to move the file:
- Download Platform Tools (included in the Android SDK) and unpack the archive.
- Connect your phone to the PC and confirm trust in the computer on the smartphone screen.
- Open the command line (or Terminal) in the folder with
adb.exeand run:adb devicesMake sure that the device appears in the list.
- Copy the file from the PC to the root folder (for example, to
/sdcard):adb push C:\path\to\file.txt /sdcard/Or move the file inside the device:
adb shell mv /storage/emulated/0/Download/file.txt /sdcard/
If you need to move a file to the system folder (for example, /system/etc), you will need Root or temporarily mount the partition in write mode:
adb shellsu
mount -o rw,remount /system
cp /sdcard/file.txt /system/etc/
mount -o ro,remount /system
โ ๏ธ Attention: On devices with Dynamic Partitions (Android 10+) the command mount -o rw,remount may not work. In this case, you will need a modified kernel or Magisk.
Method 2: Using file managers with Root access
If your device has root access (obtained through Magisk, SuperSU or other tools), you can use specialized file managers, such as:
- ๐ Root Explorer (paid, but with trial version);
- ๐ Solid Explorer (requires a module for Root);
- ๐ FX File Explorer (free with Root support).
Instructions for Root Explorer:
- Open the application and provide Root access when prompted.
- In the top panel select
/(root folder). - Find the file you want to move, hold it and select
Cut(cut) orCopy(copy). - Go to the target folder (for example,
/system/etc), clickPaste(paste). - If folder protected, you will be asked to mount in write mode - confirm.
Important: some system folders (for example, /system) can be mounted in read-onlymode. In this case:
mount -o rw,remount /system
This command can be executed directly in the file manager terminal (if it supports built-in ADB Shell).
Obtain root access (Magisk/SuperSU)
Install a file manager with Root support
Create a backup copy of important data
Check free space in the target folder
-->
Method 3: Total Commander + Root plugin
Total Commander is a popular file manager for Android that can work with Root folders through an additional plugin. The advantage of this method is that it is free and free. supports cloud storage. Total Commander free and supports cloud storage.
How to set up:
- Install Total Commander from Google Play.
- Download the plugin Root Access Plugin (available in the menu
Plugins โ Install). - Run the plugin and provide Root access.
- In the main window, select
/..(top level), then go to/.
Features:
- ๐น Supports dragging files between folders;
- ๐น Can archive/unzip files directly in Root directories;
- ๐น Allows you to edit text files (for example,
build.prop) with the built-in editor.
Limitation: on some firmwares (for example, MIUI from Xiaomi) the plugin may not see folders /data due to additional manufacturer restrictions. In this case, only ADB with superuser rights will help.
If Total Commander does not see the Root folder, try rebooting the device or temporarily disabling SELinux with the command setenforce 0 (requires Root).
Method 4: Moving through TWRP Recovery
TWRP (Team Win Recovery Project) is a custom recovery that allows you to manage the file system directly, even if Android does not boot. This method is useful if you need to copy a file to /system on a locked device.
What you will need:
- ๐ฑ A device with installed TWRP;
- ๐พ The file you want to move (for example, on an SD card or OTG drive);
- ๐ง Knowledge of basic commands
ADB Sideload(if the file is transferred from a PC).
Step-by-step guide:
- Turn off the phone and boot into TWRP (usually by holding
Power + Volume Up). - In the main menu, select
Mount โ System(if you need to mount a partition for recording). - Go to
Advanced โ File Manager. - Find the source file (for example, on
/sdcardor/external_sd) and the target folder (for example,/system/etc). - Copy or move the file, confirming the action.
- After completion, restart the device.
Warning: if you move files to /system via TWRP, be sure to check the access rights (permissions) to the file. For example, for build.prop the permissions must be set 644 (rw-r--r--). data-i="173">Folder File Manager TWRP.
| Folder | root access required? | Can I record via ADB? | Risk of system damage |
|---|---|---|---|
/sdcard |
โ No | โ Yes | โ ๏ธ Low |
/system |
โ Yes | โ No (without Root) | โ High |
/data |
โ Yes | โ ๏ธ Partially (depending on the firmware) | โโ Critical |
/vendor |
โ Yes | โ No | โ High |
Method 5: Using Termux (for advanced users)
Termux is a terminal emulator for Android that allows you to execute Linux commands directly on the device. With it, you can move files without connecting to a PC, but you will need root access.
Instructions:
- Install Termux from Google Play or F-Droid.
- Update packages:
pkg update && pkg upgrade - Install
tsu(Termux SuperUser) to work with Root:pkg install tsu - Start the terminal with superuser rights:
tsuand confirm access in the request Magisk/SuperSU.
- Move the file with the command:
mv /storage/emulated/0/Download/file.txt /system/etc/
Advantages of the method:
- ๐น Works without a PC;
- ๐น Supports scripts and automation;
- ๐น Can be used
rsyncto synchronize files.
Disadvantages:
- ๐ธ Requires knowledge of Linux commands;
- ๐ธ On some firmware Termux does not see
/storagewithout additional settings.
How to fix the "Read-only file system" error in Termux?
If when you try to write a file to /system you see an error Read-only file system, run:
su
mount -o rw,remount /system
If this does not help, check if the partition is blocked dm-verity (need to be disabled in Magisk module Disable DM-Verity).
Common errors and how to avoid them
Even experienced users encounter problems when working with the root folder. Here are the most common errors and their solutions:
- Error "Permission denied":
Cause: insufficient rights or the folder is mounted in mode
read-only.Solution: use
subefore the command or remount the partition:mount -o rw,remount /system - The file is not copied to
/system:Cause: on new devices (Android 10+), the partition
systemcan be compressed insystem.imgand is not writable.Solution: use Magisk to make changes through modules or unpack
system.imgon a PC. - After moving the file, the device does not boot:
Cause: a critical file is damaged (for example,
/system/bin/sh).Solution: boot in TWRP and restore the file from a backup or reflash the partition
system.
If you work with system files, always make a backup copy:
adb pull /system/etc/hosts C:\backup\
or via TWRP (menu Backup โ System).
โ ๏ธ Attention: On devices c Samsung Knox (for example, Galaxy S22) any modifications to system files can trigger the flag Knox 0x1, which voids the warranty and blocks some functions (for example, Samsung Pay).
Before any by manipulating the root folder, create a full backup via TWRP or ADB. This is the only way to restore the device in case of failure.
FAQ: Answers to frequently asked questions
Can I move a file to the root folder without root access?
Yes, but with restrictions. Through ADB you can copy files to /sdcard or other user folders, but not to /system or /dataFor full access you need Root.
Why, after moving a file to /system does it disappear after a reboot?
This happens because of the function dm-veritythat checks the integrity of the system partition. If the file is not signed, the system restores the original version. Solution: disable dm-verity via Magisk (module Disable DM-Verity).
How to move a file to the root folder on Xiaomi with MIUI?
On Xiaomi access to /data via ADB. Use Root manager (for example, Mixplorer) or TWRP. Disabling MIUI Optimizations in the developer settings may also help. data-i="266">Root manager
Is it possible to move a file to the root folder via MTK Engineering Mode?
No, MTK Engineering Mode (code ##3646633##) is intended for testing hardware components and does not provide access to the file system for working with files. use the methods described above.
What to do if, after moving the file, the device is stuck on the logo?
This is called bootloop. Try:
- Boot into Recovery Mode and delete the problematic file.
- Restore the backup via TWRP.
- Reflash the device via
Fastbootor Odin (for Samsung).