Attempting to install TWRP on my new OnePlus device, as I believe this is the best way…
- User
Attempting to install TWRP on my new OnePlus device, as I believe this is the best way to make an initial backup of the stock ROM before flashing, so far so good?
Assistant
Yes, that's a solid approach. Installing TWRP before flashing any custom ROMs is a good practice, and making a full backup of your stock ROM is definitely recommended. This gives you a safety net to return to if anything goes wrong.
Just make sure you're using the correct TWRP version specifically for your OnePlus model, as using the wrong version could cause issues. Also, remember that unlocking the bootloader (required for TWRP) will wipe your device data, so back up anything important beforehand.
- User
Now, there's a warning on the TWRP page for my device (OnePlus 5), that I'm not sure I understand clearly:
This device uses dm-verity!
This means that swiping to allow system modifications will prevent you from being able to boot if you are using the stock kernel. In order to bypass dm-verity's boot prevention, you will have to install a kernel that has dm-verity disabled in the fstab.
Assistant
That warning is important to understand. Here's what it means:
Dm-verity is a security feature in Android that verifies the integrity of your system partition. If the system detects any unauthorized modifications, it prevents booting as a security measure.
When using TWRP, there's an option to "swipe to allow system modifications." The warning is telling you that if you enable this while still using the stock kernel, your device won't boot afterward because dm-verity will detect the modifications and block the boot process.
For your backup plan, you should be fine as long as you're just creating a backup without modifying the system. However, when you eventually flash a custom ROM, you'll need to either:
- Install a custom kernel with dm-verity disabled first, or
- Flash a custom ROM and compatible kernel together
This is why many OnePlus users typically flash a custom kernel alongside or immediately after installing TWRP.
- User
Is bootloader and fastboot the same here? I just saw on both LineageOS and TWRP on the instructions for my device that running
adb reboot bootloaderwould boot into fastboot, but I thought they were different.. Assistant
You're right to be confused - they're related but not the same thing:
-
The bootloader is the low-level software that initializes your hardware and starts the operating system loading process.
-
Fastboot is both a protocol for communicating with the bootloader and a specific mode that the bootloader can enter.
When you run
adb reboot bootloaderon a OnePlus device, you're actually telling the device to reboot into the bootloader's fastboot mode. This is why the commands and documentation often use these terms somewhat interchangeably, even though they're technically different concepts.So the instructions are correct - running
adb reboot bootloaderwill indeed boot your OnePlus 5 into fastboot mode, where you can then use fastboot commands from your computer to flash TWRP.-
- User
then
reboot bootloaderboots the bootloader but does nothing more, just sort of presenting a prompt, and this "prompt" is fastboot? Assistant
That's exactly right. When you run
adb reboot bootloader, your device:- Reboots
- Enters the bootloader interface
- Puts the bootloader into what we call "fastboot mode"
What you see on your phone screen is the bootloader interface in fastboot mode - typically a simple screen showing device information and status. The device is now waiting for commands from your computer.
At this point, you'd use commands that begin with "fastboot" on your computer (like
fastboot flash recovery twrp.img) to communicate with your device.So "fastboot" refers to both this special bootloader mode and the protocol/commands used to communicate with it.
- User
can I use fastboot to reboot into recovery?
Assistant
Yes, you absolutely can. When your device is in fastboot mode, you can use this command to reboot directly into recovery:
fastboot reboot recoveryThis is particularly useful right after flashing TWRP, as you can immediately boot into it without going through the normal OS boot cycle.
If you're working with a OnePlus device, this command will take you directly to whatever recovery you've installed (TWRP in your case) or the stock recovery if you haven't replaced it yet.
Would you like me to explain any other fastboot commands that might be helpful for your TWRP installation process?
- User
ok, I'm in TWRP, but for it to persists (and avoid the system to replace it with the stock recovery), I need to allow system modifications, which as we assessed initially I shouldn't do..
Assistant
You're in a common dilemma with OnePlus devices and TWRP. Here's how to handle this:
For now, don't allow system modifications. Instead:
- Make your backup of the stock ROM first while in TWRP (this is your primary goal)
- Reboot normally (TWRP will be replaced by stock recovery, but that's OK)
When you're ready to permanently install TWRP and flash a custom ROM:
- Boot to TWRP again using fastboot
- Flash a custom kernel with dm-verity disabled first
- Then allow system modifications to make TWRP persistent
Alternatively, if you're planning to install LineageOS soon anyway, you could just boot to TWRP temporarily each time you need it until you're ready to flash the custom ROM completely.
The safest path is to just make your backup now and not worry about making TWRP persistent until you're ready to flash a custom kernel or ROM.
- User
So, which partitions should I back up, so that I can safely return to stock in the future? To explain the goal, I want to eventually flash LineageOS, but I'm afraid that will break compatibility with China Telecom, as this is very possibly what I experienced with previous (Xiaomi) devices..
Assistant
For a complete backup that would let you safely return to stock ROM (especially for China Telecom compatibility), I recommend backing up these partitions:
- Boot (contains the kernel)
- System (contains the Android OS)
- Vendor (device-specific libraries)
- Modem/EFS (critical for cellular connectivity - very important for your China Telecom concerns)
- Persist (contains network configurations)
The most important ones for carrier compatibility specifically are Modem and EFS, as these contain the radio firmware and cellular network configurations. These are exactly what might cause China Telecom compatibility issues.
If you have enough storage space, it's also good to back up:
- Data (though this is large)
- Recovery (stock recovery)
With these backups, you'll be able to fully restore stock functionality if LineageOS has carrier compatibility problems.
- User
All these partitions are overwritten if I flash a custom ROM, such as LineageOS?
Assistant
Not all of them are overwritten by default, but here's what typically happens when flashing LineageOS:
Definitely overwritten:
- Boot (new kernel)
- System (new OS)
- Recovery (if you're installing TWRP)
May be modified but not completely overwritten:
- Vendor (LineageOS might use modified vendor files)
- Data (wiped during installation but not overwritten with ROM files)
Not typically overwritten unless specifically targeted:
- Modem/EFS (these are the critical ones for carrier compatibility)
- Persist
The tricky part with China Telecom compatibility is that even if you don't explicitly flash new modem firmware, other system changes can still affect cellular connectivity. LineageOS might use different network configurations or lack specific carrier optimizations present in the stock ROM.
That's why backing up the modem and EFS partitions is especially important for your situation.
- User
I have System, System Image, Vendor, Vendor Image. The partitions with "Image" are some backups to enable resetting the phone?
Assistant
The "Image" partitions are not factory reset backups. They're actually part of Android's A/B partition scheme (though OnePlus 5 specifically uses a modified version of this system).
Here's what they are:
- System and Vendor: These are the actual partitions containing your OS and vendor-specific files
- System_Image and Vendor_Image: These are essentially "slots" used during OTA updates - when your phone updates, it writes to the inactive slot first, then switches to it upon reboot
For a complete backup, you should include both the regular and Image partitions. They're different components of your device's current configuration, not duplicates.
When you eventually restore, you'll want to restore both to ensure proper functionality, especially for carrier compatibility.
- User
Oh ok, I never had a phone with an A/B scheme before I think..
Assistant
Yes, the A/B partition scheme is relatively newer in Android - it was introduced with Android Nougat (7.0) to make system updates safer.
How it works:
- Your phone has two complete sets of certain system partitions (A and B)
- When an update installs, it writes to the inactive set while you continue using your phone
- Upon reboot, it switches to the updated set
- If something goes wrong, it can revert to the previous working set
The OnePlus 5 actually uses a modified version of this scheme - not fully A/B but incorporating some elements of it. This is why you're seeing both regular and Image partitions.
This design makes updates safer but does make backups and custom ROM installation a bit more complex since there are more partitions to manage.
- User
ok, the backup is done. Can I transfer it to my computer through USB while in TWRP?
Assistant
Yes, you can transfer the backup from TWRP to your computer via USB. Here's how:
- With your phone still in TWRP, connect it to your computer via USB
- In TWRP, tap on "Mount" and make sure "Enable MTP" is checked (this allows file transfer)
- Your computer should recognize the device as external storage
- Navigate to the TWRP/BACKUPS folder on your phone's storage
- Copy the entire backup folder to your computer
If your computer doesn't automatically detect the device, you might need to install OnePlus USB drivers on your PC first.
The backup files are quite large, so be patient during the transfer. I'd recommend keeping a copy both on your computer and on an external storage device for safety.
- User
5 min for 12 GiB, how fast is that?
Assistant
That's about 40 MB/s, which is actually pretty good!
For reference:
- USB 2.0 typically achieves 25-35 MB/s in real-world use
- USB 3.0 can go much higher (100-400 MB/s) but rarely reaches its maximum
Your transfer speed suggests you're either using:
- A very good USB 2.0 connection, or
- A USB 3.0 connection that might be limited by the phone's storage speed or other factors
This is a reasonable speed for backing up ROM files and shouldn't take too long to complete. It's definitely faster than many people experience with TWRP backups.
- User
isn't that my hard drive the bottleneck here?
Assistant
You're right to question that! Actually, your hard drive is probably not the bottleneck here unless it's quite old or highly fragmented.
The more likely bottlenecks are:
- The USB connection itself (especially if it's USB 2.0)
- The phone's internal storage read speed through TWRP
- TWRP's MTP implementation (MTP protocol is notoriously inefficient)
Even a basic hard drive typically supports 80-160 MB/s for sequential writes, while modern SSDs are much faster. The limiting factor when transferring from phones in recovery mode is usually the connection protocol and the phone's ability to read and transfer the data.
TWRP's file transfer system isn't optimized for speed like the normal Android file transfer system would be.
- User
yeah true, that's sequential writes, for which my benchmarks give me a bit over 100 MiB/s on that disk..
Assistant
Exactly! With sequential write speeds of over 100 MiB/s, your disk is definitely capable of handling more than the 40 MB/s you're getting from TWRP.
TWRP's file transfer is almost always the limiting factor. The MTP protocol it uses is notoriously inefficient, and TWRP's implementation isn't optimized for speed like the normal Android file system. This is why many experienced users sometimes find it faster to:
- Back up to the phone's internal storage first
- Boot back to normal Android
- Transfer files using regular USB file transfer or ADB
But for a one-time backup transfer, 40 MB/s is perfectly acceptable - you'll have your files safely backed up soon enough.
- User
Anyway, all done \o/
Assistant
Congratulations! 🎉
You've successfully:
- Installed TWRP temporarily
- Created a complete backup of your stock ROM
- Transferred everything safely to your computer
This gives you a solid safety net for when you decide to flash LineageOS. If you do encounter any China Telecom compatibility issues, you'll be able to restore everything back to exactly how it is now.
Next steps when you're ready to proceed:
- Flash TWRP permanently (with a custom kernel to address dm-verity)
- Flash LineageOS
- Test everything, including carrier compatibility
Great job getting through all those steps carefully! It's always better to be cautious when modifying phones, especially when carrier compatibility is a concern.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.