You are not logged in.

#1 2026-11-01 03:34

bretsim
Member
Registered: 2021-11-21
Posts: 39

Help! Recover accidentally deleted folder and files!

This has to be my very dumbest move yet...

I was trying to update a browser in Q4OS and for some reason it wasn't working. I saw an option to reinstall and clicked it in the hope it would update just the browser itself in place.

Instead it reinstalled the whole browser file system. A year of documents, bookmarks and downloads vanished in a second. On Windows I know the steps to attempt recovery, but I'm at a loss on this weird install alongside windows. Most of the stuff was in one Download folder that now appears completely empty.

Is there any possible way to get my files back? I've put the laptop to sleep for the moment to prevent too much more activity on the SSD, but any advice much appreciated! I can't see how I can install recovery software without putting data at risk, but I also can't see how to access the file system with an external recovery device (and without first shutting the system down, which will cause a lot more SSD activity during the shutdown process).

Edit: apologies for the duplicate posts. Just in a blind panic here!

Last edited by bretsim (2026-11-01 17:04)

Offline

#2 2026-11-01 17:21

bin
Member
From: U.K.
Registered: 2016-01-28
Posts: 1,613

Re: Help! Recover accidentally deleted folder and files!

First of all, re-installing a web browser is unlikely to delete anything out of your download folder.
You don't say which browser, that would help.
Are you confusing the information in your browser bookmarks with the actual contents of the Downloads folder?
Either way we need to get a look at the log files surrounding this event as a starter.
Initially the /var/apt/history.log and /var/apt/terminal.log
Copy them to somewhere in your home and then upload them to the forum.

Offline

#3 2026-11-01 17:35

bretsim
Member
Registered: 2021-11-21
Posts: 39

Re: Help! Recover accidentally deleted folder and files!

bin wrote:

First of all, re-installing a web browser is unlikely to delete anything out of your download folder.
You don't say which browser, that would help.
Are you confusing the information in your browser bookmarks with the actual contents of the Downloads folder?
Either way we need to get a look at the log files surrounding this event as a starter.
Initially the /var/apt/history.log and /var/apt/terminal.log
Copy them to somewhere in your home and then upload them to the forum.

It's Torbrowser. Normally it updates as soon as it launches, but this time it didn't. I thought it might be down to a lack of space so I cleared some room and that seemed to get it going but it still wouldn't update despite multiple attempts.

I - evidently very stupidly  - saw a button to reinstall the browser and clicked it thinking it would just download the latest version and leave everything else intact. Instead, the files in the Download folder I had open literally vanished before my eyes before flashing up a message saying the folder doesn't exist. When I navigated back to the location, the folder was back but empty.

On Windows I know I could use a file recovery program like Recuva/Directory Snoop to salvage and/or reconstruct what remains of the files, or use a live rescue toolkit to access the drive from outside the OS, but I have no idea how to achieve either on Linux, much less the bizarro filesystem-within-a-filesystem that Q4OS uses on this kind of install.

I'm not even going to risk waking the laptop up unless I have an idea of how to attempt recovery quickly.

Last edited by bretsim (2026-11-01 18:09)

Offline

#4 2026-11-01 20:51

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 6,489
Website

Re: Help! Recover accidentally deleted folder and files!

The reason your files vanished is specific to how Tor Browser handles its directory. Unlike standard browsers, Tor stores its bookmarks, settings, and its internal downloads folder entirely within its own installation folder. Clicking "reinstall" wiped that specific folder directory and replaced it with a fresh, clean one.

You can access filesystem data, see https://www.q4os.org/forum/viewtopic.php?id=4789

Offline

#5 2026-11-01 21:36

bretsim
Member
Registered: 2021-11-21
Posts: 39

Re: Help! Recover accidentally deleted folder and files!

q4osteam wrote:

The reason your files vanished is specific to how Tor Browser handles its directory. Unlike standard browsers, Tor stores its bookmarks, settings, and its internal downloads folder entirely within its own installation folder. Clicking "reinstall" wiped that specific folder directory and replaced it with a fresh, clean one.

You can access filesystem data, see https://www.q4os.org/forum/viewtopic.php?id=4789

Yes, I realised that about TB's filesystem when I saw the files disappear before my eyes! How likely is it in Linux that the files are still there? I've never tried this outside of Windows before.

I've actually used those exact commands to mount a filesystem on a different machine. But how do I shut the machine down first without a load of risky disk activity?

Also what are the goto tools for file recovery on Linux?

Thanks for the reply.

Last edited by bretsim (2026-11-01 21:36)

Offline

#6 2026-11-01 21:47

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 6,489
Website

Re: Help! Recover accidentally deleted folder and files!

First we would recommend you to backup the root.disk file. Afterwards you can make some experiments to recover your data without a data lost concerns.

bretsim wrote:

How likely is it in Linux that the files are still there?

We don't know, but guess not much as rewritten.

bretsim wrote:

... how do I shut the machine down first without a load of risky disk activity?

Just re-mount the root.disk read-only and shut the PC down.

bretsim wrote:

How likely is it in Linux that the files are still there?

You could try this https://www.q4os.org/forum/viewtopic.php?id=4947

---
AI tips:
When it comes to data recovery on Linux, the right tool depends heavily on whether you are dealing with a physically failing drive or simply trying to undelete files from a healthy file system.
Here are the go-to industry-standard tools for Linux, categorized by their specific use case.
1. Hard Drive Failure and Cloning (The Essential First Step)
If a drive is clicking, has bad sectors, or is dying, never try to recover files directly from it. Every read attempt could be its last.
• ddrescue (GNU ddrescue): The gold standard for data imaging. Unlike the standard dd command, it skips bad sectors, creates a map log of damaged areas, and goes back to try and scrape the remaining data later.
• The Rule: Always use ddrescue to create a bit-by-bit .img clone onto a healthy drive first, then perform file recovery on that image file.
2. All-in-One Partition and File Recovery
These two legendary open-source command-line tools are developed by the same team and are included in almost every Linux rescue toolkit.
• TestDisk: Designed primarily to fix damaged partition tables, recover deleted partitions, and repair boot sectors. If an entire disk partition suddenly goes missing, TestDisk can often bring it back instantly.
• PhotoRec: A powerful file carving tool. It ignores the file system entirely and scans raw data blocks looking for file signatures (headers and footers). It can recover hundreds of file types (documents, archives, videos, photos). Note: It recovers files without their original filenames or folder structure.
3. File-System Specific Undelete Tools
If your drive is healthy but you accidentally deleted a file and want to recover it with its original filename and directory path intact, use a tool tailored to your file system.
• extundelete (for Ext3 and Ext4): Uses partition journal metadata to restore files with original names and directory paths.
• ext4magic (for Ext4): More advanced than extundelete; can leverage historical journal data to recover files deleted hours or days ago.
• xfs_undelete (for XFS): A specialized script specifically for recovering deleted files from XFS partitions.
• btrfs restore (for Btrfs): A built-in command within btrfs-progs used to scrape files from unmountable or corrupted Btrfs volumes.
4. Forensic File Carving
• Foremost / Scalpel: Originally developed by military intelligence and forensic agencies. Like PhotoRec, they carve files out of disk images based on headers and footers, but they are highly configurable, allowing you to define custom file structures to hunt for specific data types.
5. Graphical User Interface (GUI) Tools
If you prefer a visual interface over the command line:
• R-Linux: A completely free GUI tool for Ext2/Ext3/Ext4 file systems created by the developers of R-Studio. Excellent for visualizing what can be saved.
• Commercial Suites: Tools like Disk Drill and R-Studio offer native Linux versions with modern interfaces, file previews, and deep scanning algorithms.
Pro-Tip: Use a Live Rescue USB
Installing recovery tools onto the system you are trying to save risks overwriting the very data you want to recover. The safest method is to boot into a live USB environment.
• SystemRescue (formerly SystemRescueCD): An Arch-based live Linux distro that comes pre-packaged with all the tools mentioned above (ddrescue, TestDisk, PhotoRec, file system utilities). Keep a thumb drive flashed with this image handy.
If you are currently dealing with an active data loss scenario, let me know what file system you are using, what exactly happened, and if you can power down the machine to boot from a USB. I can walk you through the exact commands needed for your situation.

Offline

#7 2026-11-01 22:15

bretsim
Member
Registered: 2021-11-21
Posts: 39

Re: Help! Recover accidentally deleted folder and files!

q4osteam wrote:

First we would recommend you to backup the root.disk file. Afterwards you can make some experiments to recover your data without a data lost concerns.

bretsim wrote:

How likely is it in Linux that the files are still there?

We don't know, but guess not much as rewritten.

bretsim wrote:

... how do I shut the machine down first without a load of risky disk activity?

Just re-mount the root.disk read-only and shut the PC down.

bretsim wrote:

How likely is it in Linux that the files are still there?

You could try this https://www.q4os.org/forum/viewtopic.php?id=4947

---
AI tips:
When it comes to data recovery on Linux, the right tool depends heavily on whether you are dealing with a physically failing drive or simply trying to undelete files from a healthy file system.
Here are the go-to industry-standard tools for Linux, categorized by their specific use case.
1. Hard Drive Failure and Cloning (The Essential First Step)
If a drive is clicking, has bad sectors, or is dying, never try to recover files directly from it. Every read attempt could be its last.
• ddrescue (GNU ddrescue): The gold standard for data imaging. Unlike the standard dd command, it skips bad sectors, creates a map log of damaged areas, and goes back to try and scrape the remaining data later.
• The Rule: Always use ddrescue to create a bit-by-bit .img clone onto a healthy drive first, then perform file recovery on that image file.
2. All-in-One Partition and File Recovery
These two legendary open-source command-line tools are developed by the same team and are included in almost every Linux rescue toolkit.
• TestDisk: Designed primarily to fix damaged partition tables, recover deleted partitions, and repair boot sectors. If an entire disk partition suddenly goes missing, TestDisk can often bring it back instantly.
• PhotoRec: A powerful file carving tool. It ignores the file system entirely and scans raw data blocks looking for file signatures (headers and footers). It can recover hundreds of file types (documents, archives, videos, photos). Note: It recovers files without their original filenames or folder structure.
3. File-System Specific Undelete Tools
If your drive is healthy but you accidentally deleted a file and want to recover it with its original filename and directory path intact, use a tool tailored to your file system.
• extundelete (for Ext3 and Ext4): Uses partition journal metadata to restore files with original names and directory paths.
• ext4magic (for Ext4): More advanced than extundelete; can leverage historical journal data to recover files deleted hours or days ago.
• xfs_undelete (for XFS): A specialized script specifically for recovering deleted files from XFS partitions.
• btrfs restore (for Btrfs): A built-in command within btrfs-progs used to scrape files from unmountable or corrupted Btrfs volumes.
4. Forensic File Carving
• Foremost / Scalpel: Originally developed by military intelligence and forensic agencies. Like PhotoRec, they carve files out of disk images based on headers and footers, but they are highly configurable, allowing you to define custom file structures to hunt for specific data types.
5. Graphical User Interface (GUI) Tools
If you prefer a visual interface over the command line:
• R-Linux: A completely free GUI tool for Ext2/Ext3/Ext4 file systems created by the developers of R-Studio. Excellent for visualizing what can be saved.
• Commercial Suites: Tools like Disk Drill and R-Studio offer native Linux versions with modern interfaces, file previews, and deep scanning algorithms.
Pro-Tip: Use a Live Rescue USB
Installing recovery tools onto the system you are trying to save risks overwriting the very data you want to recover. The safest method is to boot into a live USB environment.
• SystemRescue (formerly SystemRescueCD): An Arch-based live Linux distro that comes pre-packaged with all the tools mentioned above (ddrescue, TestDisk, PhotoRec, file system utilities). Keep a thumb drive flashed with this image handy.
If you are currently dealing with an active data loss scenario, let me know what file system you are using, what exactly happened, and if you can power down the machine to boot from a USB. I can walk you through the exact commands needed for your situation.


Surely as soon as I wake up/login to the machine it will start performing write operations on the disk?

What would happen if I just let the battery run down in sleep mode until it switches off without waking from sleep? I thought I could then reboot into Windows and backup the .disk file in preparation for any recovery attempt.

This may well be a bad idea. I seem to be specialising in them recently...

Last edited by bretsim (2026-11-01 22:17)

Offline

#8 2026-11-01 22:25

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 6,489
Website

Re: Help! Recover accidentally deleted folder and files!

bretsim wrote:

Surely as soon as I wake up/login to the machine it will start performing write operations on the disk?

As long as you go with https://www.q4os.org/forum/viewtopic.php?id=4789 , and mount root.disk read only nothing is written to the root.disk filesystem.

In anyway, first make a backup as mentioned above https://www.q4os.org/forum/viewtopic.ph … 793#p35793

Last edited by q4osteam (2026-11-01 22:33)

Offline

#9 2026-11-01 23:15

bretsim
Member
Registered: 2021-11-21
Posts: 39

Re: Help! Recover accidentally deleted folder and files!

q4osteam wrote:
bretsim wrote:

Surely as soon as I wake up/login to the machine it will start performing write operations on the disk?

As long as you go with https://www.q4os.org/forum/viewtopic.php?id=4789 , and mount root.disk read only nothing is written to the root.disk filesystem.

In anyway, first make a backup as mentioned above https://www.q4os.org/forum/viewtopic.ph … 793#p35793

But how do I mount anything as read only when the laptop is suspended mid session and as soon as  I wake the machine disk activity will recommence before I can remount anything?

In case this wasn't clear, as soon as I realised what had happened, I suspended the laptop and it has been in that state ever since.

Last edited by bretsim (2026-11-01 23:17)

Offline

#10 2026-11-02 09:04

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 6,489
Website

Re: Help! Recover accidentally deleted folder and files!

Ah so. There is no way to wake the PC up with no disk activity. The way is dirty hard poweroff. Wake up the pc and press and hold the power button as long as the computer will switch off. However this may make filesystem integrity broken, the same as for any other installation.

Offline

#11 2026-11-02 11:36

bretsim
Member
Registered: 2021-11-21
Posts: 39

Re: Help! Recover accidentally deleted folder and files!

q4osteam wrote:

Ah so. There is no way to wake the PC up with no disk activity. The way is dirty hard poweroff. Wake up the pc and press and hold the power button as long as the computer will switch off. However this may make filesystem integrity broken, the same as for any other installation.

Yes, that was what I thought. Practically speaking, this happens every time I suspend the laptop and forget to plug it in for so long that the battery runs down. 

When restarting q4os after one of these unclean shutdowns, the startup process begins with what appears to be filesystem cleanup, so I am assuming it's having the same effect as the method you describe.

Offline

#12 2026-11-02 11:40

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 6,489
Website

Re: Help! Recover accidentally deleted folder and files!

Yes, the same effect.

Offline

#13 2026-11-02 22:17

bretsim
Member
Registered: 2021-11-21
Posts: 39

Re: Help! Recover accidentally deleted folder and files!

And just to be clear, booting into Windows to backup the .disk file shouldn't have any effect on the .disk file itself, right? Do i have that correct?

The internal contents and 'blank' space of the Q4OS filesystem are not accessible to be written/overwritten by Windows as Windows just sees the whole filesystem as a single file of fixed size?

Offline

#14 2026-11-02 23:04

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 6,489
Website

Re: Help! Recover accidentally deleted folder and files!

Yes, correct

Offline

Registered users online in this topic: 0, guests: 1

Board footer

Powered by FluxBB
Modified by Visman