Centos6 ext4 file system accidental deletion and recovery operation (extundelete software recovery)

First of all, we need to know whether a file deleted by mistake in the centos6 ext4 file system can be deleted

The linux file system has three parts, the file name inode block
such as a.txt inode (file metadata information) block is the place where the data is actually stored
if the file is deleted by mistake, what is the first thing we do

first step:

​ To prohibit continued writing (uninstall or read-only permission)

Step 2:

​ Method 1: Find a backup
​ Method 2: Software-restore inode number

# Use extundelete software

Create a new hard disk, partition, mount,

1 Create 20G, load a new hard disk, hot swap,
add a new disk, init 6
​ 2sdc partition, 3G partition
partition fdisk /dev/sdb (the disk added here is /dev/sdb)
enter the partition and create a new 3G partition Partition
View our disk partition through fdisk -l
3 View dev/sdb1 through ll

Create a test file in the above partition

1. Format sdb1
mkfs.ext4 /dev/sdb1
2. Create a mount directory /sdb1
mdkir /sdb1
3. Create a /sdb1 under the root to mount the partition we just created
mount /dev/sdb1 /sdb1

Delete test file

1. Copy some files
cp /etc/passwd /sdb1/
cp /etc/hosts /sdb1/

Guess you like

Origin blog.csdn.net/a1749437237/article/details/107981965