Moving files to the Android root directory is a task that users face when installing custom firmware, modifying system applications, or restoring 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 file manager will not show its contents.
In this article we will examine 5 proven methods transferring files to the root of Android: from simple (via ADB) to advanced (using TWRP or root access). We will pay special attention security to incorrect actions in the root folder that can lead to data loss or device failurewhen the system stops booting. If you are a beginner, we recommend that you first study the section on backup.
Important: methods differ in complexity and requirements. For example, to work with ADB you need a computer and a debug bridge, and for Root Explorer โsuperuser rights. We have indicated the pros and cons of each option so that you can choose the best one.
1. What is the Android root folder and why is it not visible
The root folder (or root directory) is the top level of the Android file system, indicated by the symbol /. All system files are stored here, including:
- ๐
/systemโ firmware and pre-installed applications; - ๐
/dataโ user data (settings, applications); - ๐
/vendorโ drivers and proprietary components; - ๐
build.propโ system configuration file.
By default, Android hides the root folder from the user for two reasons:
- Security: accidental deletion or modification of system files can damage the device.
- Policy manufacturers: modification of system partitions often violates the warranty and can block OTA updates.
Even if you connect your smartphone to a PC via USB in MTPmode, the root folder will remain inaccessible. To see it, you need either root accessor special tools like ADB or TWRP.
โ ๏ธ Attention: Changes in the root folder can lead to loss of warranty. Manufacturers (Samsung, Xiaomi, Google) often check the integrity of the system partition during service. If modifications are detected, repairs under warranty will be denied.
2. Preparation: backing up and unlocking the bootloader
Before any manipulations with the root folder required create a backup copy of your data. Even experienced users sometimes make mistakes, and restoring a system without a backup can take hours.
Backup methods:
- ๐ TWRP: if you have custom recovery installed, make a full backup of the partition
/systemand/data; - โ๏ธ Cloud: upload important files to Google Drive, Yandex.Disk or another service;
- ๐ป ADB Backup: command
adb backup -apk -obb -shared -all -f backup.abwill create an archive of applications and data.
If you plan to use methods with unlocking the bootloader (for example, to install TWRP), please note:
- On most devices, unlocking erases all data (
fastboot oem unlock). - Some brands (Huawei, Xiaomi) require waiting 7 days after the unlock request.
- After unlocking, services like Google Pay or Netflix may stop working (due to triggering SafetyNet).
To check the bootloader status, enter in the terminal:
adb shell getprop ro.boot.verifiedbootstate
If the answer orange โthe bootloader is unlocked, green โis locked.
3. Method 1: Moving via ADB (without root)
ADB (Android Debug Bridge) โan official tool from Google for debugging devices. It allows you to execute commands on your smartphone from your computer, including copying files to the root folder. Advantage. method: does not require root access, but only works when USB debugging is enabled.
Step-by-step guide:
- Download Platform Tools (includes ADB and Fastboot) and unpack the archive.
- On your smartphone, activate
Settings โ About phone โ Build number(press 7 times to unlock developer mode), then enableUSB debugginginSettings โ System โ For developers. - Connect the device to the PC and confirm permission to debug.
- Open the command line (Windows) or terminal (Linux/macOS) in the folder with ADB and run:
adb push local_path/file.txt /sdcard/adb shell
su -c"cp /sdcard/file.txt /"
If the command su does not work, then the device does not have root access. In this case, use an alternative path:
adb shellcp /sdcard/file.txt /data/local/tmp/
mv /data/local/tmp/file.txt /
Method limitations:
- โ Not all files can be moved without root (for example, to
/system); - โ On some firmware (MIUI, EMUI) access to
/data/local/tmpis limited; - โ Works on locked bootloaders (if debugging is enabled).
Drivers for your devices|
USB debugging is enabled|
The file to be transferred is in an accessible folder (for example, /sdcard/)|
Command line is opened as administrator (Windows)-->
4. TWRP (for flashed devices)
TWRP (Team Win Recovery Project) - custom recovery that allows you to manage the Android file system at a low level. If you already have TWRP installed, transferring files to the root will take a couple of minutes.
Instructions:
- Download the desired file to a memory card or internal memory.
- Boot into TWRP: turn off the smartphone, then press
Power + Volume up(the combination may vary). - In the TWRP main menu, select
Advanced โ File Manager. - Go to the folder with the file (for example,
/sdcard/Download), select it and clickCopy. - Return to the root folder (
/), clickPasteand confirm the replacement (if the file already exists).
Advantages of TWRP:
- โ
Full access to all partitions, including
/systemi/vendor; - โ
Ability to mount partitions in read/write mode (
Mount โ Enable MTP); - โ Built-in verification checksums (MD5) for critical files.
Disadvantages:
- โ Requires an unlocked bootloader;
- โ On some devices (for example, Samsung s Knox) installation TWRP triggers the flag
RMM State, blocking the download.
What to do if TWRP does not see the internal memory?
If the File Manager is empty, check:
1. Partition /data is not encrypted (if yes - you need to format).
2. Mounting is enabled in TWRP settings /data (Mount โ Data).
3. The file system is not damaged (try rebooting into TWRP again).
5. Method 3: Root Explorer (for rooted devices)
If your smartphone has root access, the easiest way is to use a file manager with root support, for example:
- ๐ Root Explorer (paid, but reliable);
- ๐ Solid Explorer (free version with limitations);
- ๐ FX File Explorer (requires an additional plugin for root).
Action algorithm (for example Root Explorer):
- Open the application and provide root access when prompted.
- In the top panel, click on the root folder icon (
/). - Find the file that need to be moved (for example, to
/sdcard/Download), hold it and selectCopy. - Go to the root folder, press
Pasteand confirm the replacement (if necessary).
Important nuances:
- ๐ Some folders (for example,
/system) are mounted inread-only. To change this, Root Explorer clickMount R/Win the top menu. - ๐ก๏ธ The application may ask for permission to access
/dataโthis is normal for root managers. - โ ๏ธ Avoid changes to
/efs(to Samsung) or/persistโthese sections contain critical communication data (IMEI, MAC addresses).
If Root Explorer does not see the root folder, check the superuser settings in an application like Magisk or SuperSU. Sometimes you need to manually allow access for file managers.
6. Method 4: Through the terminal on the device (with root)
If you prefer to work with the command line on a smartphone, use terminal emulators like Termux or Terminal Emulator for Android. This method is suitable for automation or when there is no access to a PC.
Example commands for copying a file magisk.zip from /sdcard to the root:
sucp /sdcard/magisk.zip /
chmod 644 /magisk.zip
Command decoding:
| Command | Description |
|---|---|
su |
Obtaining superuser rights. |
cp source destination |
Copying a file (analogue adb push, but locally). |
chmod 644 |
Setting file rights: the owner - read/write, the rest - read only. |
ls -l / |
View the contents of the root folder with access rights. |
Errors and solutions:
- ๐ซ
Permission denied: check that the partition is mounted in moderw(mount -o remount,rw /). - ๐ซ
No such file or directory: make sure that the path to the file is correct (register important!). - ๐ซ
Read-only file system: some firmware blocks writing to/systemeven from root. The solution is to remount the partition.
7. Method 5: Via Fastboot (for flashing files)
The method is suitable for transferring files that need to be flashed to system partitions (for example, boot.img, recovery.img). Unlike previous methods, here the file is not simply copied, but written to the partition directly.
Instructions:
- Place the file (for example,
twrp.img) in the folder withfastbooton the PC. - Boot the device to mode
fastboot: turn off the smartphone, then pressPower + Volume Down. - Run the command to check the connection:
fastboot devices
- Flash the file to the desired partition (for example, in
recovery):
fastboot flash recovery twrp.img
Partitions and their purpose:
| Section | Description | Example file |
|---|---|---|
boot |
Kernel and ramdisk (responsible for booting the system). | boot.img |
recovery |
Recovery mode (stock or custom). | twrp.img |
system |
Firmware and system applications. | system.img |
vendor |
Drivers and proprietary libraries. | vendor.img |
โ ๏ธ Attention: Firmware of the wrong file in the partitionbootorrecoverymay lead to "soft brick" (the device boots only into fastboot). In this case, re-flashing the originalboot.imgor resetting via TWRP will help.
8. data-i="232">Even experienced users sometimes encounter problems when working with the root folder. Let's look at typical errors and ways to solve them:
Even experienced users sometimes encounter problems when working with the root folder. Let's look at common mistakes and ways to solve them:
1."Operation not permitted" when copying
Cause: the partition is mounted in mode read-onlySolution:
adb shellsu
mount -o remount,rw /system
2. The file is copied, but is not applied
Example: you replaced build.prop, but the changes did not take effect. Solution:
adb shellsu
chmod 644 /system/build.prop
reboot
3.
Symptoms: stuck on the logo, cyclic reboot. Reasons:
- ๐ด Incompatible file in
/system(for example,libfrom another firmware); - ๐ด Incorrect access rights (for example,
777instead644); - ๐ด Damage
boot.imgorrecovery.img.
Solution: boot into TWRP and restore the backup or flash the original boot via fastboot.
4. Data disappeared after moving
If you moved files from /data to the root and then deleted the originals, you can only restore them from a backup. Always check the destination path before deleting the source!
1. Is there a backup? data-i="254">2. Compatibility of files with your firmware.
2. Compatibility of files with your firmware.
3. Correct access rights (chmod).
4. Possibility of rollback (for example, via TWRP).-->
FAQ: Answers to popular questions
Is it possible to move a file to the root without root and unlocking the bootloader?
Partially. Through ADB you can copy files to /data/local/tmp or /sdcard, but access to /system or /vendor without root will be limited. To fully work with the root folder you need advanced rights.
Why are the changes not applied after copying the file to /system?
Most likely, the partition /system is mounted in mode read-only. Remount it:
adb shellsu
mount -o remount,rw /system
Also check the file permissions (chmod 644) and the owner (chown root:root).
How to get everything back if I made a mistake?
If the device is still booting:
- Delete the copied file via Root Explorer or ADB;
- Reboot your smartphone.
If the system does not start:
- Boot into TWRP and restore the backup;
- Or flash the stock firmware via
fastbootor Odinh (for Samsung).
Is it possible to move a file to the root on a device with Magisk (without full root)?
Yes, Magisk provides limited root access. Use Termux with the command su or a file manager like Mixplorer (in the settings, enable the use of Magisk for root). Please note: Magisk may block changes to some sections (for example /system) for saving SafetyNet.
What files should absolutely not be modified in the root folder?
Avoid modifications to the following files and folders:
- ๐ซ
/efs(on Samsung) - contains IMEI and serial numbers; - ๐ซ
/devโ virtual device files; - ๐ซ
/procโ information about processes (changes are reset on reboot, but may cause crashes); - ๐ซ
/sysโ kernel system parameters; - ๐ซ
vold.fstaborfstabโ partition mounting configuration.
It is also not recommended to change files in /system/bin i /system/lib without an exact understanding of their purpose.