I search everywhere if I will lose data in recovery mode so will I? I looked everywhere even in ask ubuntu and found nothing helpful.
I search everywhere if I will lose data in recovery mode so will I? I looked everywhere even in ask ubuntu and found nothing helpful.
Recovery Mode will not delete any of your data merely by entering it (or merely by trying it).
It is NOT a "System Restore" or "System Reset". It's merely access to a root prompt so you can troubleshoot and fix problems yourself.
If you just enter recovery mode, and make no changes, nothing "bad" will happen. Simply type
exit
and press Enter to exit recovery mode.Recovery mode allows you to make changes to your system using a terminal console, but you have to explicitly grant yourself read/write access to do that.
You obviously already know how to get to the "recovery mode" menu, but I'll list the steps for completeness (adapted from Ubuntu Recovery Mode Wiki)
Switch on your computer.
With BIOS, quickly press and hold the Shift key to get grub menu.
With UEFI press the Escape key to get grub menu.
Select the line which starts with "Advanced options".
Select the line ending with "(recovery mode)"
Press Return and your machine will begin the boot process.
The "recovery mode" menu with a number of options will be displayed.
One of these options is "Drop to root shell prompt", and I believe this is the option you are asking about. (There are other options, but I will specifically talk about the "root" option).
Highlight "root Drop to root shell prompt" and press Enter.
Even though you are logged into your system as root, you can not (yet) accidentally make any changes.
This is because the root partition (the "parent"
/
directory on your system) is mounted read-only.To make changes to your system must explicitly do the following:
Mount
/
as read/write using the following command:Next, if you have other partitions that you need to access (such as a separate partition for
/home
) use the following command:This will mount all filesystems mentioned in fstab.
Now, if you make any changes you could damage your system if you are not careful!
I address the question that you added in your comment:
In itself, it will not wipe any data — only if you explicitly ask it to.
Recovery mode in itself is just a simplified variant (actually, a subset) of the operating system: it starts up only the very core of the system, the bare minimum that can give you a chance to interact with the computer and try to fix any error that may be present.
A lot of features (even important ones) are not being enabled in recovery mode by default, so that a faulty subsystem has less chance to cause any instability or further crash.
You may still encounter data-loss — but not caused by merely entering recovery mode — in three ways:
fsck
) is being run in read-only mode, then it should be fine.The lesson should be that one always needs to keep backups of important data, preferably on a separate device: at the minimum on some sort of memory card, or an external disk.
Not keeping a backup and always just hoping that you can get out of every emergency without any data lost, may slowly, but likely, lead to unpleasant surprises.
short answer: NO
Recovery mode is just like safe mode boot in windows. You boot up with just the very minimal resources and programs loaded so that you can debug and troubleshoot some OS or module issues and recover from that.
You can of course, destroy your OS by running commands without knowing what you are doing, but that you can do even in normal mode. Linux command line is powerful, and with great power comes great responsibility. So know what a command can and is supposed to do before executing it.