HOWTO recover deleted files on an ext3 file system

【深度学习预测】项目介绍 Python实现基于BO-Transformer-LSTM贝叶斯优化算法(BO)优化Transformer-LSTM模型进行多变量时间序列预测(含模型描述及部分示例代码) 内容概要:本文详细介绍了一个基于BO-Transformer-LSTM的多变量时间序列预测项目,通过结合Transformer的全局自注意力机制与LSTM的局部时序建模能力,构建了适用于复杂业务场景的深度学习预测模型。模型输入采用多变量滑动窗口结构,并引入正弦余弦位置编码以保留时间顺序信息;Transformer编码器提取变量间长距离依赖关系,LSTM进一步捕捉动态演化特征,最终通过回归层输出预测值。为优化模型性能,采用贝叶斯优化算法(基于Tree-structured Parzen Estimator)自动搜索最优超参数组合,包括嵌入维度、注意力头数、学习率、窗口长度等,显著提升了调参效率与模型泛化能力。项目还设计了包含周期性、趋势性、均值回归、突发事件和异方差噪声的五因素模拟数据生成机制,确保数据贴近真实业务场景,并建立了从数据预处理、模型训练、验证评估到结果恢复的完整技术链路。; 适合人群:具备一定机器学习与深度学习基础,熟悉PyTorch框架,从事时间序列预测相关研究或工程应用的研发人员、数据科学家及研究生。; 使用场景及目标:①应用于能源负荷预测、设备状态监测、金融风控、供应链需求预测等多变量时间序列预测任务;②解决传统模型在长时依赖、非线性关系和高维特征下的预测瓶颈;③实现高效超参数优化,提升模型调优自动化水平与部署可行性。; 阅读建议:本文含核心模型结构与部分示例代码,建议结合完整项目代码(如GitHub或博客资源)进行复现实践,重点关注数据生成逻辑、模型前向传播流程及贝叶斯优化集成方式,同时可通过调整网络结构或优化策略进一步拓展至多步预测、概率输出与可视化分析等高级功能。 立即下载

HOWTO recover deleted files on an ext3 file system

Carlo Wood, Mar 2008

Introduction

It happens to everyone sooner or later: a split second after you hit Enter you realizeyour mistake, but it's too late; you just deleted a valuable file or directory forwhich no backup exists. Or maybe you have a backup, but it's a month old...and in shock you see the past month flash before your eyes as you realize in painwhat you'll have to do all over again...

Fortunately, you remember that files are never really deleted, at mostoverwritten by new content. So, you remount the disk read-only as fast as possible.But now?

If you Google for "undelete ext3", almost every article you find will beusers asking if it's possible and the answer is every time: no.

The most frequently quoted passage comes from the ext3 FAQ itself:

Q: How can I recover (undelete) deleted files from my ext3 partition?

Actually, you can't! This is what one of the developers, Andreas Dilger, said about it:

In order to ensure that ext3 can safely resume an unlink after a crash, it actually zeros out the block pointers in the inode, whereasext2 just marks these blocks as unused in the block bitmaps and marks the inode as "deleted" and leaves the block pointers alone.

Your only hope is to "grep" for parts of your files that have been deleted and hope for the best.

However, this is not necessarily true.All information might still be there, also the block pointers.It is just less likely that those are still there (than on ext2),since they have to be recovered from the journal.On top of that, the meta data is less coherently related to the realdata so that heuristic algorithms are needed to find things back.Every time a file is accessed, it's Access Time is changed, and it'sinode is written to disk, along with 31 other inodes that reside inthe same block. When that happens, a copy of that block is writtento the journal. Therefore, if your partition isn't too large comparedto your journal, and if you at least recently accessed the files youwant to recover, you might be able to recover the block pointers fromthe journal.

On February 7th, 2008, I accidently deleted my whole home directory: over 3 GB of data, deleted with rm -rf.The only backup that I had was from June 2007. Not being able to undelete was unacceptable. So, I ignored whateveryone tried to tell me and started to learn how an ext3 file system really works, and what exactlyhappens when files are deleted...

Three weeks and nearly 5000 lines of code later, I had recovered every file on my disk.

What You Should Know Before You Begin

The tool that I wrote assumes a spike of recently deleted files (shortly before the last unmount).It does NOT deal with a corrupted file system, only with accidently deleted files.

Also, the program is in a beta stage: the development of the program wasdone as a hack, solely aimed at recovering my own data. After I recoveredmy data I have continued development for one more month to address bugs thatdidn't show in my case, but over all the program isn't as robust as it could be.Therefore, it is likely that things might not work entirely out-of-the-box for you.I stashed the program with asserts, which makes it likely that ifsomething doesn't work for you then the program will abort instead of trying togracefully recover. In that case you will have to dig deeper, and finish theprogram yourself, so to say.

The program only needs read access to the file system with the deleted files:it does not attempt to recover the files. Instead, it allows you to make a copyof deleted files and writes those to a newly created directory tree in thecurrent directory (which obviously should be a different file system).All paths are relative to the root of the partion,thus— if you are analysing a partition /dev/md5 which wasmounted under /home, then /home is unknown to thepartition and to the program and therefore not part of the path(s). Instead,a path will be something like for example "carlo/c++/foo.cc", withoutleading slash. The parition root (/home in the example) isthe empty string, not '/'.

The name of the program, ext3grep was chosen because I wasplanning to write a highly intelligent program that would be able toreconstruct files by searching for blocks that looked similarto expected blocks (based on an old backup, or other rules). The grepin the name was in anticipation that the quote from the ext3 developerwas true: I was preparing for the need to work with sets of blocks, eachset corresponding to a search pattern and weighted with a likeliness, uponwhich then one would have to work with set operators in order to reducethe number of blocks and assign them to files, and give them their order.However, nothing like it turned out to be needed. Nevertheless,I kept the name ext3grep because someone might want to adda true grep-like functionality to the program (at thismoment it's grep-functionality is limited to fixed strings, printingmatching block numbers to standard output).

How Does EXT3 Store Files?

Block sizes

The content of files is stored in contiguous blocks of 4096 bytes (theactual size depends on command line parameters passed to mke2fs when thefile system was first created and can be 1024, 2048 or 4096 bytes).A harddisk is a "block device", meaning that every I/O isdone in terms those blocks; one can only read/write an integral numberof a blocks at a time. This doesn't necessarily mean that the minimumsize of a contiguous file fragment is of the same size (although it canonly be smaller), but in practise it is. In fact, the program will notwork if the fragment size is unequal the block size.

The actual block size, as well as the actual fragment size, arestored in the superblock and can be retrieved with the option --superblock.For example,

$ ext3grep $IMAGE --superblock | grep 'size:'
Block size: 4096
Fragment size: 4096

Here IMAGE is an environment variable that was setto the name of the device (or a copy thereof made with dd)of the partition holding the file system. For example /dev/sdd2(in general, any of the device names as returned by the command dfunder the heading "Filesystem"). Normally only root can readdevices directly, but you can (temporarily) make them readable by you,of course, or make a backup image with dd. Note that, for example,/dev/sdd is NOT a partition (note the missing digit) andwill not contain usable data for our purpose.

The entire partition is divided into an integral number of blocks,starting to count at 0. Thus, if you ever want to make a copy of blocknumber N, you could do:

$ dd if=$IMAGE bs=4096 count=1 skip=$N of=block.$N

Where N runs from 0 till (but not including) the number of blocksas stored in the superblock. For example,

$ ext3grep $IMAGE --superblock | grep 'Blocks count:'
Blocks count: 2441824

Having any block number, one can print information about itby using the command line option --block.For example,

$ ext3grep $IMAGE --ls --block 600
[...]
Group: 0
Block 600 is Allocated. It's inside the inode table of group 0 (inodes [1 - 33>).

$ ext3grep $IMAGE --ls --block 1109
[...]
Group: 0

Block 1109 is a directory. The block is Allocated

          .-- File type in dir_entry (r=regular file, d=directory, l=symlink)
          |          .-- D: Deleted ; R: Reallocated
Indx Next |  Inode   | Deletion time                        Mode        File name
==========+==========+----------------data-from-inode------+-----------+=========
   0    1 d       2                                         drwxr-xr-x  .
   1  end d       2                                         drwxr-xr-x  ..
   2    3 d      11  D 1202351093 Thu Feb  7 03:24:53 2008  drwxr-xr-x  lost+found
   3  end d  195457  D 1202352103 Thu Feb  7 03:41:43 2008  drwxr-xr-x  carlo

The superblock

The superblock isn't really a block. It's size is always 1024 bytes and thefirst superblock starts at offset 1024. Thus, if the block size is1024 then the superblock is block 1, but if the block size is 2048 or4096, then the superblock is part of block 0. There are multiplebackup copies elsewhere on the disk. ext3grep assumes thatthe first superblock is not corrupted and does not attempt to find orread the backup copies.

One could read the contents of the first superblock with dd as follows:

$ dd if=$IMAGE bs=1024 skip=1 count=1 of=superblock

The meaning of each byte in the superblock is given in table 1.

Table 1. The Superblock
BytestypeDescription
0 .. 3__le32Inodes count
4 .. 7__le32Blocks count
8 .. 11__le32Reserved blocks count
12 .. 15__le32Free blocks count
16 .. 19__le32Free inodes count
20 .. 23__le32First data block
24 .. 27__le32Block size
28 .. 31__le32Fragment size
32 .. 35__le32Number of blocks per group
36 .. 39__le32Number of fragments per group
40 .. 43__le32Number of inodes per group
44 .. 47__le32Mount time
48 .. 51__le32Write time
52 .. 53__le16Mount count
54 .. 55__le16Maximal mount count
56 .. 57__le16Magic signature
58 .. 59__le16File system state
60 .. 61__le16Behaviour when detecting errors
62 .. 63__le16minor revision level
64 .. 67__le32Time of last check
68 .. 71__le32Max. time between checks
72 .. 75__le32OS
76 .. 79__le32Revision level
80 .. 81__le16Default uid for reserved blocks
82 .. 83__le16Default gid for reserved blocks
84 .. 87__le32First non-reserved inode
88 .. 89__le16Size of inode structure
90 .. 91__le16Block group number of this superblock
92 .. 95__le32Compatible feature set
96 .. 99__le32Incompatible feature set
100 .. 103__le32Readonly-compatible feature set
104 .. 119__u8[16]128-bit uuid for volume
120 .. 135char[16]Volume name
136 .. 199char[64]Directory where last mounted
200 .. 203__le32For compression
204__u8Number of blocks to try to preallocate
205__u8Number to preallocate for dirs
206 .. 207__le16Per group descriptors for online growth
208 .. 223__u8[16]uuid of journal superblock
224 .. 227__le32Inode number of journal file
228 .. 231__le32Device number of journal file
232 .. 235__le32Start of list of inodes to delete
236 .. 251__le32[4]HTREE hash seed
252__u8Default hash version to use
253 .. 255 Reserved
256 .. 259__le32Default mount options
260 .. 263__le32First metablock block group
264 .. 1023 Reserved

The C-struct for the superblock is given in the header file /usr/include/linux/ext3_fs.hand was used to create table 1.The data of the unsigned integers is stored on disk in Little Endian format.On a little endian CPU like Intel x86, that means that __le32 is in fact an uint32_tand __le16 is equal to uint16_t.

Groups

Each ext3 file system is devided into groups, with a fixed number ofblocks per group, except the last group which contains the remaining blocks.The number of blocks per group is given in the superblock, ie

$ ext3grep $IMAGE --superblock | grep 'Blocks per group'
# Blocks per group: 32768

Each group uses one block as a bitmap to keep track of which blockinside that group is allocated (used); thus, there can be at most 4096 * 8 = 32768normal blocks per group.

Another block is used as bitmap for the number of allocated inodes.Inodes are data structures of 128 bytes (they can be extended in theory;the real size is given in the superblock once again) that are stored in a table,(4096 / 128 = 32 inodes per block) in each group.Having at most 32768 bits in the bitmap, we can conclude that there will be atmost 32768 inodes per group, and thus 32768 / 32 = 1024 blocks in the inodetable of each group. The actual size of the inode table is given by the actualnumber of inodes per group, which is also stored in the superblock.

$ ext3grep $IMAGE --superblock | egrep 'Size of inode|inodes per group'
Number of inodes per group: 16288
Size of inode structure: 128

The block numbers of both bitmaps and the start of the inode tableis given in the "group descriptor table", which resides inthe block following the superblock; thus, block 1 or block 2 dependingon the size of a block. This group descriptor table exists of a seriesof consecutive ext3_group_desc structs, also defined in/usr/include/linux/ext3_fs.h, see table 2.

Table 2. A group descriptor
BytestypeDescription
0 .. 3__le32Blocks bitmap block
4 .. 7__le32Inodes bitmap block
8 .. 11__le32Inodes table block
12 .. 13__le16Free blocks count
14 .. 15__le16Free inodes count
16 .. 17__le16Directories count
18 .. 31 Reserved

Since the size of this struct is padded to a power of 2, 32 bytes, therefit precisely an integral number of descriptors in a block. Therefore the tableis contiguous even when spanning multiple blocks. Note that one block of4096 bytes is already capable of holding 128 group descriptors, each of whichcan store 32768 blocks— thus only a partition larger than 16 GBwill use more than one block for the group descriptor table.

The content of the table is printed by ext3grep ifno action or group is specified on the command line. For example,

$ ext3grep $IMAGE 
No action specified; implying --superblock.
[...]
Number of groups: 75
 Group	0: block bitmap at 598, inodes bitmap at 599, inode table at 600
	   4 free blocks, 16278 free inodes, 1 used directory
 Group	1: block bitmap at 33366, inodes bitmap at 33367, inode table at 33368
	   30510 free blocks, 16288 free inodes, 0 used directory
[...]
 Group	74: block bitmap at 2424832, inodes bitmap at 2424833, inode table at 2424834
	   16481 free blocks, 16288 free inodes, 0 used directory
[...]

Inodes

The inodes in the inode table of each group contain meta data for each typeof data that the file system can store. This type might be a symbolic link,in which case only the inode is sufficient, it might be a directory, a file,a FIFO, a UNIX socket and so on.In the case of files and directories the real data is stored in file systemblocks outside the inode.The first 12 block numbers are stored in the inode,if more blocks are needed, then then the inode points to an indirect block:a block with more block numbers that contain data. Subsequently the inodecan store a double indirect block and a triple indirect block.The structure of an inode is given in table 3.

Table 3. An inode
BytestypeDescription
0 .. 1__le16File mode
2 .. 3__le16Low 16 bits of Owner uid
4 .. 7__le32Size in bytes
8 .. 11__le32Access time
12 .. 15__le32Creation time
16 .. 19__le32Modification time
20 .. 23__le32Deletion Time
24 .. 25__le16Low 16 bits of Group Id
26 .. 27__le16Links count
28 .. 31__le32Blocks count
32 .. 35__le32File flags
36 .. 39linux1OS dependent 1
40 .. 99__le32[15]Pointers to blocks
100 .. 103__le32File version (for NFS)
104 .. 107__le32File ACL
108 .. 111__le32Directory ACL
112 .. 115__le32Fragment address
116 .. 127linux2OS dependent 2

The C-struct for the inode, struct ext3_inode,is given in the header file /usr/include/linux/ext3_fs.h and was used to create table 3.That same header file also defines a number of constants in the form of macros that shouldbe used to access the data. For example, the struct member that is stored in bytes 40 to 99is i_block, it's size is EXT3_N_BLOCKS 32-bit block numbers.i_block[EXT3_IND_BLOCK] points to (contains the block number of) an indirect blockif one exists. i_block[EXT3_DIND_BLOCK] to a double indirect block andi_block[EXT3_TIND_BLOCK] to a tripple indirect block. Basically, every constanthas it's macro, see the header file for more details. ext3grep usesi_reserved2 to store the inode number, so that printing an ext3_inodestruct in gdb shows which inode it really is.

The superblock shows how many inodes exist in total, and how many inodes there are per group.This allows one to calculate the number of groups. Because the inodes are stored in theirrespective inode tables per group, one first has to determine the group that an inode numberbelongs to. Because inodes start to count at 1, the formula to convert an inode number tothe group it belongs to is:

group = (inode_number - 1) / inodes_per_group

This gives the correct inode table. To find the index of the inode in this tablewe subtract the inode number of the first inode in the table from our inode number:

index = inode_number - (group * inodes_per_group + 1)

Note that this index also determines the corresponding bit in the inodes bitmap.

As such, groups have been made transparent: every inode can be addressed witha number in the contiguous range [1, number_of_inodes], wherethe number of inodes is given by:

$ ext3grep $IMAGE --superblock | grep 'Inodes count'
Inodes count: 1221600

In some case you might want to know which block in the file system belongsto the inode table that stores a particular inode. This can be retrieved withthe command line option --inode-to-block, for example:

$ ext3grep $IMAGE --inode-to-block 2
[...]
Inode 2 resides in block 600 at offset 0x80.

Inode number 2 (the macro EXT3_ROOT_INO in ext3_fs.h)is always used for the root of the partition: it's type is a directory.Of all other special inodes we only use EXT3_JOURNAL_INO (number 8).

Having the inode number, one can print it's contents with ext3grep,for example:

$ ext3grep $IMAGE --inode 2 --print
Number of groups: 75
Loading group metadata... done
[...]

Hex dump of inode 2:
0000 | ed 41 00 00 00 10 00 00 97 6f aa 47 08 6c aa 47 | .A.......o.G.l.G
0010 | 08 6c aa 47 00 00 00 00 00 00 02 00 08 00 00 00 | .l.G............
0020 | 00 00 00 00 02 00 00 00 55 04 00 00 00 00 00 00 | ........U.......
0030 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
0040 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
0050 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
0060 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
0070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................

Inode is Allocated
Group: 0
Generation Id: 0
uid / gid: 0 / 0
mode: drwxr-xr-x
size: 4096
num of links: 2
sectors: 8 (--> 0 indirect blocks).

Inode Times:
Accessed:       1202352023 = Thu Feb  7 03:40:23 2008
File Modified:  1202351112 = Thu Feb  7 03:25:12 2008
Inode Modified: 1202351112 = Thu Feb  7 03:25:12 2008
Deletion time:  0

Direct Blocks: 1109
[...]
Inode 2 is directory "".
Directory block 1109:
          .-- File type in dir_entry (r=regular file, d=directory, l=symlink)
          |          .-- D: Deleted ; R: Reallocated
Indx Next |  Inode   | Deletion time                        Mode        File name
==========+==========+----------------data-from-inode------+-----------+=========
   0    1 d       2                                         drwxr-xr-x  .
   1  end d       2                                         drwxr-xr-x  ..
   2    3 d      11  D 1202351093 Thu Feb  7 03:24:53 2008  drwxr-xr-x  lost+found
   3  end d  195457  D 1202352103 Thu Feb  7 03:41:43 2008  drwxr-xr-x  carlo

As you see, ext3grep first dumps the hexadecimal content ofthe inode table; then interprets it and prints the struct members, ending withthe line Direct Blocks: 1109. It then detects that this block isa directory (which can also be seen in the mode field of the inode) andtherefore continuous with listing this block as directory.

Regular Files

If an inode represents a regular file, then the blocks it refers tosimply contain the data of the file. If the size of a file is not an integralnumber of times the block size, than the excess bytes in the last blockwill be zeroed out (at least, on linux).

Symbolic links

The value of a symbolic link is a string: the pathname to it's target.The length of the string is given in i_size.If i_blocks is zero, then i_blockdoes not contain block numbers, but is used to store the string directly.However, if the name of the target is longer than fits in i_block,then i_blocks will be non-zero and i_block[0] willpoint to a block containing the target name.

Directories

If an inode represents a directory then its blocks are (singly) linked lists of ext3_dir_entry_2 data structures.Each block is self-contained: no dir entry points outside the block.The first block will always start with the dir entries for "." and "..".

Table 4. A Directory Entry
BytestypeDescription
0 .. 3__le32Inode number
4 .. 5__le16Directory entry length
6__u8Name length
7__u8File Type
8char[]File-, symlink- or directory name

Using the options --ls --inode $N, ext3greplists the contents of each directory block of inode N. For example,to list the root directory of a partition:

$ ext3grep $IMAGE --ls --inode 2
Number of groups: 75
Loading group metadata... done
Minimum / maximum journal block: 1115 / 35026
Loading journal descriptors... done
Journal transaction 4381435 wraps around, some data blocks might have been lost of this transaction.
Number of descriptors in journal: 30258; min / max sequence numbers: 4379495 / 4382264
Inode is Allocated
Loading md5.ext3grep.stage2... done
The first block of the directory is 1109.
Inode 2 is directory "".
Directory block 1109:
          .-- File type in dir_entry (r=regular file, d=directory, l=symlink)
          |          .-- D: Deleted ; R: Reallocated
Indx Next |  Inode   | Deletion time                        Mode        File name
==========+==========+----------------data-from-inode------+-----------+=========
   0    1 d       2                                         drwxr-xr-x  .
   1  end d       2                                         drwxr-xr-x  ..
   2    3 d      11  D 1202351093 Thu Feb  7 03:24:53 2008  drwxr-xr-x  lost+found
   3  end d  195457  D 1202352103 Thu Feb  7 03:41:43 2008  drwxr-xr-x  carlo

Subsequently, one could use ext3grep --ls --inode 195457 tolist directory carlo, and so on.

Note that ext3grep prints all directory entries, deleted not.There are two ways that one can see that a directory is deleted: firstly,it's inode will have a non-zero Deletion Time, secondly the dir entry mightbe taken out of the linked list by skipping it; the "Directory Entry Length",bytes 4 and 5 of each directory entry, basically 'point' to the next entry,or to the byte directly following the block if there are no other dir entries.In the listing of ext2grep the address of the dir entries hashas been replaced by an artificial index (in the first column) and the "Directory Entry Length"is replaced with the column called Next, which either points to the nextentry or contains end when there are no other dir entries. In theabove example, 0 is the first entry, 1 is the next and last entry. The entrieswith index 2 and 3 are skipped. However, it is still visible that entry 2 used topoint to entry 3. In fact, entries 2 and 3 are deleted at the same time bychanging the "Directory Entry Length" of entry 1 such that it didnot 'point' to entry 2 anymore, but to the end of the block.

Because ext3grep prints also deleted entries, it is verywell possible that the SAME entry occurs multiple times. In particular, ifa file is moved, a duplicate remains that will still be visible. Ie,

$ ext3grep $IMAGE --ls --inode 195457 | grep '\.viminfo$'
   7    8 r  201434  D 1202351096 Thu Feb  7 03:24:56 2008  rrw-r--r--  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  197221  D 1202351110 Thu Feb  7 03:25:10 2008  rrw-r--r--  .viminfo
  18   19 r  197221  D 1202351110 Thu Feb  7 03:25:10 2008  rrw-r--r--  .viminfo
  18   19 r  197221  D 1202351110 Thu Feb  7 03:25:10 2008  rrw-r--r--  .viminfo
  18   19 r  197221  D 1202351110 Thu Feb  7 03:25:10 2008  rrw-r--r--  .viminfo
  17   19 r  197221  D 1202351110 Thu Feb  7 03:25:10 2008  rrw-r--r--  .viminfo
  17   19 r  197221  D 1202351110 Thu Feb  7 03:25:10 2008  rrw-r--r--  .viminfo
  17   19 r  197221  D 1202351110 Thu Feb  7 03:25:10 2008  rrw-r--r--  .viminfo
  18   19 r  195993  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195981  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-r--r--  .viminfo
  18   19 r  195993  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195981  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-r--r--  .viminfo
  18   19 r  195993  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195987  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195993  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195993  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195993  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195993  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195993  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195993  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195993  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195994  D 1202351111 Thu Feb  7 03:25:11 2008  rrw-r--r--  .viminfo
  18   19 r  195995  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  18   19 r  195993  D 1202351097 Thu Feb  7 03:24:57 2008  rrw-------  .viminfo
  17   19 r  197221  D 1202351110 Thu Feb  7 03:25:10 2008  rrw-r--r--  .viminfo

In order to understand this, the following remarks.

Firstly, these duplicated entries come mostly from duplicated directory blocks,which is already apparent from the index number of the entries: if they were allfrom the same block then all index numbers would have been different. Of course,without piping the output to grep it would be clear that each entrybelongs to a different directory block, but that output is too much to show here.

Secondly, you have to realize that only the inode number, the file type inthe third column and the file name is data from the dir entry itself. TheDeletion time, and the Mode column are extracted from the current data inthe corresponding inode. However, that inode could have been reused long agoby another file and the data it contains would not be related anymore tothis dir entry. This is clearly the case in the above example because itis certain that all those .viminfo files weren't deleted on the same day!In a few case it can be detected that an inode has been reallocated (reused):if it is still in use (that can't be by this deleted dir entry), or when thefile type in the inode differs from the file type in the dir entry. In those casesthe fifth column shows an 'R' instead of a 'D', and the content of theinode is not shown. However, because such entries show little information ofuse, they are normally suppressed. If you want to see entries with knownreallocated inodes, you have to add the command line option --reallocated.Moreover, sometimes the inode number in the dir entry itself is zeroed.Such entries are obviously useless as well and therefore also suppressed.In order to show them use the command line option --zeroed-inodes.

It is possible to apply filters to the output of --ls.An overview of the available filters is given in the output of the --help option:

$ ext3grep $IMAGE --help
[...]
Filters:
  --group grp            Only process group 'grp'.
  --directory            Only process directory inodes.
  --after dtime          Only entries deleted on or after 'dtime'.
  --before dtime         Only entries deleted before 'dtime'.
  --deleted              Only show/process deleted entries.
  --allocated            Only show/process allocated inodes/blocks.
  --unallocated          Only show/process unallocated inodes/blocks.
  --reallocated          Do not suppress entries with reallocated inodes.
                         Inodes are considered 'reallocated' if the entry
                         is deleted but the inode is allocated, but also when
                         the file type in the dir entry and the inode are
                         different.
  --zeroed-inodes        Do not suppress entries with zeroed inodes. Linked
                         entries are always shown, regardless of this option.
  --depth depth          Process directories recursively up till a depth
                         of 'depth'.
[...]

In order to easily determine sensible values for --after and --beforethe action --histogram=dtime was added. This command line option causes ext3grepto print a histogram of time versus number of deleted inodes. If you delete a large number offiles at once, for example with rm -rf, then it should be easy to determine a timewindow within which the deletion took place.For example, here I zoomed in on my personal disaster where I deleted a little over fiftythousand files from my home directory:

$ ext3grep $IMAGE --histogram=dtime --after=1202351086 --before=1202351129
Only show/process deleted entries if they are deleted on or after Thu Feb  7 03:24:46 2008 and before Thu Feb  7 03:25:29 2008.

Number of groups: 75
Minimum / maximum journal block: 1115 / 35026
Loading journal descriptors... done
Journal transaction 4381435 wraps around, some data blocks might have been lost of this transaction.
Number of descriptors in journal: 30258; min / max sequence numbers: 4379495 / 4382264

Only show/process deleted entries if they are deleted on or after 1202351086 and before 1202351129.
Only showing deleted entries.
Thu Feb  7 03:24:46 2008  1202351086        0 
Thu Feb  7 03:24:47 2008  1202351087        1 
Thu Feb  7 03:24:48 2008  1202351088        0 
Thu Feb  7 03:24:49 2008  1202351089        0 
Thu Feb  7 03:24:50 2008  1202351090        0 
Thu Feb  7 03:24:51 2008  1202351091        0 
Thu Feb  7 03:24:52 2008  1202351092        0 
Thu Feb  7 03:24:53 2008  1202351093      705 ==============
Thu Feb  7 03:24:54 2008  1202351094     1698 ==================================
Thu Feb  7 03:24:55 2008  1202351095     2320 ===============================================
Thu Feb  7 03:24:56 2008  1202351096     3652 ==========================================================================
Thu Feb  7 03:24:57 2008  1202351097     3332 ===================================================================
Thu Feb  7 03:24:58 2008  1202351098     2014 =========================================
Thu Feb  7 03:24:59 2008  1202351099     1160 =======================
Thu Feb  7 03:25:00 2008  1202351100     4188 =====================================================================================
Thu Feb  7 03:25:01 2008  1202351101     2480 ==================================================
Thu Feb  7 03:25:02 2008  1202351102     1945 =======================================
Thu Feb  7 03:25:03 2008  1202351103     1471 ==============================
Thu Feb  7 03:25:04 2008  1202351104     2724 =======================================================
Thu Feb  7 03:25:05 2008  1202351105     3090 ===============================================================
Thu Feb  7 03:25:06 2008  1202351106     3360 ====================================================================
Thu Feb  7 03:25:07 2008  1202351107     4902 ====================================================================================================
Thu Feb  7 03:25:08 2008  1202351108      698 ==============
Thu Feb  7 03:25:09 2008  1202351109     1612 ================================
Thu Feb  7 03:25:10 2008  1202351110     4547 ============================================================================================
Thu Feb  7 03:25:11 2008  1202351111     2651 ======================================================
Thu Feb  7 03:25:12 2008  1202351112     1513 ==============================
Thu Feb  7 03:25:13 2008  1202351113        0 
Thu Feb  7 03:25:14 2008  1202351114        0 
Thu Feb  7 03:25:15 2008  1202351115        0 
Thu Feb  7 03:25:16 2008  1202351116        0 
Thu Feb  7 03:25:17 2008  1202351117        1 
Thu Feb  7 03:25:18 2008  1202351118        0 
Thu Feb  7 03:25:19 2008  1202351119        0 
Thu Feb  7 03:25:20 2008  1202351120        0 
Thu Feb  7 03:25:21 2008  1202351121        0 
Thu Feb  7 03:25:22 2008  1202351122        0 
Thu Feb  7 03:25:23 2008  1202351123        0 
Thu Feb  7 03:25:24 2008  1202351124        0 
Thu Feb  7 03:25:25 2008  1202351125        0 
Thu Feb  7 03:25:26 2008  1202351126        0 
Thu Feb  7 03:25:27 2008  1202351127        0 
Thu Feb  7 03:25:28 2008  1202351128        0 
Thu Feb  7 03:25:29 2008  1202351129 
Totals:
1202351086 - 1202351128    50064

It is important to set a good value for --after before recovering all files,or way too many files will be "recovered".

The Journal

The journal is a file existing of a fixed number of blocks.It's inode is EXT3_JOURNAL_INO, which is usually 8.The actual inode can also be found in the superblock:

$ ext3grep $IMAGE --superblock | grep 'Inode number of journal file'
Inode number of journal file: 8

and the size then can be found by printing inode 8:

$ ext3grep $IMAGE --print --inode 8
Number of groups: 75
Loading group metadata... done
Minimum / maximum journal block: 1115 / 35026
Loading journal descriptors... done
Journal transaction 4381435 wraps around, some data blocks might have been lost of this transaction.
Number of descriptors in journal: 30258; min / max sequence numbers: 4379495 / 4382264

Hex dump of inode 8:
0000 | 80 81 00 00 00 00 00 08 00 00 00 00 62 07 57 46 | ............b.WF
0010 | 62 07 57 46 00 00 00 00 00 00 01 00 10 01 04 00 | b.WF............
0020 | 00 00 00 00 08 00 00 00 5b 04 00 00 5c 04 00 00 | ........[...\...
0030 | 5d 04 00 00 5e 04 00 00 5f 04 00 00 60 04 00 00 | ]...^..._...`...
0040 | 61 04 00 00 62 04 00 00 63 04 00 00 64 04 00 00 | a...b...c...d...
0050 | 65 04 00 00 66 04 00 00 67 04 00 00 68 08 00 00 | e...f...g...h...
0060 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
0070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................

Inode is Allocated
Group: 0
Generation Id: 0
uid / gid: 0 / 0
mode: rrw-------
size: 134217728
num of links: 1
sectors: 262416 (--> 34 indirect blocks).

Inode Times:
Accessed:       0
File Modified:  1180108642 = Fri May 25 17:57:22 2007
Inode Modified: 1180108642 = Fri May 25 17:57:22 2007
Deletion time:  0

Direct Blocks: 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126
Indirect Block: 1127
Double Indirect Block: 2152

where you can see that the size of my journal is 134217728 bytes, or32768 blocks. The first 12 blocks are listed directly in the inode:blocks 1115 - 1126. Then an indirect block is placed in 1127. Thisindirect block can contain 1024 block numbers each of which followthe indirect block directly (1128 - 2151). Then the inode refers toa double indirect block containing 31 block numbers of additionalindirect blocks. The total number of (double/tripple) indirectblocks is calculated to be 34 (using the fact that a sector is 512 byte).Therefore, if everything would be stored contiguously, the last block ofthe journal would be 1115 + 32768 + 34 - 1 = 33916. However, the journaldidn't fit entirely in group 0, so the last blocks are in group 1 andthe header of group 1 (most notably it's inode table) is insertedsomewhere between the journal blocks, causing the last block to be 35025.On top of this, there could be bad blocks anywhere in between as well.Therefore, the correct way to approach the journal is in terms of'journal block numbers'.

The first block of the journal file (block 1115 in the above example)contains the 'journal superblock'. It's structure is defined in/usr/include/linux/jbd.h as journal_superblock_t.It can be printed with:

$ ext3grep $IMAGE --journal --superblock
Journal Super Block:

Signature: 0x3225106840
Block type: Superblock version 2
Sequence Number: 0
Journal block size: 4096
Number of journal blocks: 32768
Journal block where the journal actually starts: 1
Sequence number of first transaction: 4382265
Journal block of first transaction: 0
Error number: 0
Compatible Features: 0
Incompatible features: 1
Read only compatible features: 0
Journal UUID: 0xe3 0x88 0xd9 0x09 0x94 0xca 0x43 0x95 0x9b 0x53 0xac 0x2c 0xd8 0xe0 0x3d 0x25
Number of file systems using journal: 1
Location of superblock copy: 0
Max journal blocks per transaction: 0
Max file system blocks per transaction: 0
IDs of all file systems using the journal:
1. 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

Minimum / maximum journal block: 1115 / 35026
Loading journal descriptors... done
Journal transaction 4381435 wraps around, some data blocks might have been lost of this transaction.
Number of descriptors in journal: 30258; min / max sequence numbers: 4379495 / 4382264

Here you can see that the journal actually starts in Journal Block Number 1, and thelast block is Journal Block Number 32768. These are thus not the same as the file system block numbers.One can find the real block number with, for example,

$ ext3grep $IMAGE --journal --journal-block 1
[...]
Group: 0
Block 1116 belongs to the journal.
[...]

which reveals that Journal Block Number 1 is file system block 1116.

The journal is filled with "Transactions" which have an ever increasingsequence number. If the end of the journal is reached, writing continuous atthe start, wrapping around. However, if a file system is cleanly unmountedthen the next mount writing always starts at the beginning (I think).

A single transaction exists of a one or more "Descriptors".The last descriptor of a transaction is a "Commit Block", signalingthat the transaction has been closed succesfully and the data in the previousdescriptors of that transaction has been written to disk. There are two othertypes of descriptors: revoke blocks and blocks containing "tags".A revoke block is filled with block numbers that should be (or are) unallocatedby this transaction. A tag is a structure that assigns subsequent journal blocks(not file system blocks!) to file system blocks: the following journal blockscontain the data that should (have been) written to the given file system block.

That makes "tags" in particular interesting for us: they containcopies of data that was written to disk in the past, including old inodes.

Manual recovery example

In the following example we will manually recover a small file.Only partial output is given in order to save space and to make theexample more readable.

Using ext3grep $IMAGE --ls --inode we find the name ofthe file that we want to recover:

$ ext3grep $IMAGE --ls --inode 2 | grep carlo
   3  end d  195457  D 1202352103 Thu Feb  7 03:41:43 2008  drwxr-xr-x  carlo

$ ext3grep $IMAGE --ls --inode 195457 | grep ' bin$' | head -n 1
  34   35 d  309540  D 1202352104 Thu Feb  7 03:41:44 2008  drwxr-xr-x  bin

$ ext3grep $IMAGE --ls --inode 309540 | grep start_azureus
   9   10 r  309631  D 1202351093 Thu Feb  7 03:24:53 2008  rrwxr-xr-x  start_azureus

Obviously, inode 309631 is erased and we have no block numbers for this file:

$ ext3grep $IMAGE --print --inode 309631
[...]
Inode is Unallocated
Group: 19
Generation Id: 2771183319
uid / gid: 1000 / 1000
mode: rrwxr-xr-x
size: 0
num of links: 0
sectors: 0 (--> 0 indirect blocks).

Inode Times:
Accessed:       1202350961 = Thu Feb  7 03:22:41 2008
File Modified:  1202351093 = Thu Feb  7 03:24:53 2008
Inode Modified: 1202351093 = Thu Feb  7 03:24:53 2008
Deletion time:  1202351093 = Thu Feb  7 03:24:53 2008

Direct Blocks:

Therefore, we will try to look for an older copy of it in the journal.First, we find the file system block that contains this inode:

$ ext3grep $IMAGE --inode-to-block 309631 | grep resides
Inode 309631 resides in block 622598 at offset 0xf00.

Then we find all journal descriptors referencing block 622598:

$ ext3grep $IMAGE --journal --block 622598
[...]
Journal descriptors referencing block 622598:
4381294 26582
4381311 28693
4381313 28809
4381314 28814
4381321 29308
4381348 30676
4381349 30986
4381350 31299
4381374 32718
4381707 1465
4381709 2132
4381755 2945
4381961 4606
4382098 6073
4382137 6672
4382138 7536
4382139 7984
4382140 8931

This means that the transaction with sequence number 4381294 has a copyof block 622598 in block 26582, and so on. The largest sequence number,at the bottom, should be the last data written to disk and thus block8931 should be the same as the current block 622598. In order to findthe last non-deleted copy, one should start at the bottom and work upwards.

If you try to print such a block, ext3grep recognizes that it's a blockfrom an inode table and will print the contents of all 32 inodes in it.We only wish to see inode 309631 however; so we use a smart grep:

$ ext3grep $IMAGE --print --block 8931 | grep -A15 'Inode 309631'
--------------Inode 309631-----------------------
Generation Id: 2771183319
uid / gid: 1000 / 1000
mode: rrwxr-xr-x
size: 0
num of links: 0
sectors: 0 (--> 0 indirect blocks).

Inode Times:
Accessed:       1202350961 = Thu Feb  7 03:22:41 2008
File Modified:  1202351093 = Thu Feb  7 03:24:53 2008
Inode Modified: 1202351093 = Thu Feb  7 03:24:53 2008
Deletion time:  1202351093 = Thu Feb  7 03:24:53 2008

Direct Blocks:

This is indeed the same as we saw in block 622598. Next welook at smaller sequence numbers until we find one with a0 Deletion time. The first one that we find (bottom up) isblock 6073:

$ ext3grep $IMAGE --print --block 6073 | grep -A15 'Inode 309631'
--------------Inode 309631-----------------------
Generation Id: 2771183319
uid / gid: 1000 / 1000
mode: rrwxr-xr-x
size: 40
num of links: 1
sectors: 8 (--> 0 indirect blocks).

Inode Times:
Accessed:       1202350961 = Thu Feb  7 03:22:41 2008
File Modified:  1189688692 = Thu Sep 13 15:04:52 2007
Inode Modified: 1189688692 = Thu Sep 13 15:04:52 2007
Deletion time:  0

Direct Blocks: 645627

The above is automated and can be done much faster with the command line option --show-journal-inodes.This option will find the block that the inode belongs to, then finds all copies of that block in the journal,and subsequently prints only the requested inode from each of these block (each of which contains 32 inodes, as you know),eliminating duplicates:

$ ext3grep $IMAGE --show-journal-inodes 309631
Number of groups: 75
Minimum / maximum journal block: 1115 / 35026
Loading journal descriptors... done
Journal transaction 4381435 wraps around, some data blocks might have been lost of this transaction.
Number of descriptors in journal: 30258; min / max sequence numbers: 4379495 / 4382264
Copies of inode 309631 found in the journal:

--------------Inode 309631-----------------------
Generation Id: 2771183319
uid / gid: 1000 / 1000
mode: rrwxr-xr-x
size: 0
num of links: 0
sectors: 0 (--> 0 indirect blocks).

Inode Times:
Accessed:       1202350961 = Thu Feb  7 03:22:41 2008
File Modified:  1202351093 = Thu Feb  7 03:24:53 2008
Inode Modified: 1202351093 = Thu Feb  7 03:24:53 2008
Deletion time:  1202351093 = Thu Feb  7 03:24:53 2008

Direct Blocks:

--------------Inode 309631-----------------------
Generation Id: 2771183319
uid / gid: 1000 / 1000
mode: rrwxr-xr-x
size: 40
num of links: 1
sectors: 8 (--> 0 indirect blocks).

Inode Times:
Accessed:       1202350961 = Thu Feb  7 03:22:41 2008
File Modified:  1189688692 = Thu Sep 13 15:04:52 2007
Inode Modified: 1189688692 = Thu Sep 13 15:04:52 2007
Deletion time:  0

Direct Blocks: 645627

The file is indeed small: only one block. We copy this block with dd as shown before:

$ dd if=$IMAGE bs=4096 count=1 skip=645627 of=block.645627
1+0 records in
1+0 records out
4096 bytes (4.1 kB) copied, 0.0166104 seconds, 247 kB/s

and then edit the file to delete the trailing zeroes, or copy the first 40 bytes(the given size of the file):

$ dd if=block.645627 bs=1 count=40 of=start_azureus
40+0 records in
40+0 records out
40 bytes (40 B) copied, 0.000105397 seconds, 380 kB/s

$ cat start_azureus
cd /usr/src/azureus/azureus
./azureus &

Recovered!

Note that it is possible to see all descriptors of a given transaction.The transaction that we used to recover this file was 4382098. The completetransaction can be seen with:

$ ext3grep $IMAGE --journal-transaction 4382098
[...]
Prev / Current / Next sequences numbers: 4382097 4382098 4382099
Transaction was NOT COMMITTED!
TAG: 6074=851971 6073=622598 6072=393218 6071=393395 6070=393231 6069=393409 6068=393240 6067=393371 6066=622596
REVOKE: 506451
TAG: 6056=393217 6057=1 6058=393273 6059=393232 6060=403879 6061=393216 6062=491520 6063=506302 6064=0 6065=393219

Here you see, for example, the TAG 6072=393218, meaning that block 6072 contains a (old) copy of block 393218.I don't know why it says that the transaction wasn't committed (that seems very unlikely). Probably, the commit blockwas overwritten and this old journal transaction simply isn't complete anymore.

Recovering files

Of course, it would be annoying to recover larger files, existing of many blocks this way;let alone manually recovering thousands of files! Therefore all of the above can be automated.However, if you recover 50,000 files then there is virtually no way to even check if it workedafterwards: especially when MORE files were recovered than you really wanted; it will behard to find back all the junk. You really should take care to recover files as accurate aspossible.

No such care seems necessary to recover a single file,you can just pass it's path to ext3grep:

$ ext3grep $IMAGE --restore-file carlo/bin/start_kvm
[...]
Restoring carlo/bin/start_kvm

$ cat RESTORED_FILES/carlo/bin/start_kvm
#! /bin/sh
cd /usr/src/qgt/src
./host-linux 192.168.2.4 &
cd /opt/kvm/winXPpro
sudo modprobe kvm_intel
sudo kvm -m 384 -hda vdisk6GB.img -cdrom /dev/cdrom -localtime -std-vga -net nic,vlan=0,model=rtl8139 -net tap,vlan=0
#-snapshot # -daemonize
killall -9 host-linux

Note that this created the directory RESTORED_FILES/carlo/bin in the current directory, in order to be able to restore this file.Also note that if RESTORED_FILES/carlo/bin/start_kvm already existed in the current directory then it was not overwritten!

In order for this to work you will first have to pass stage1 and stage2 of the disk analysis that ext3grep will perform (see below).

It is possible to dump all file names that ext3grep can find, using the command line option --dump-names:

$ ext3grep $IMAGE --dump-names
carlo
carlo/.Trash
carlo/.Xauthority
carlo/.Xauthority-c
carlo/.Xauthority-l
carlo/.Xauthority-n
carlo/.alsaplayer
carlo/.alsaplayer/alsaplayer.m3u
carlo/.alsaplayer/config
[...]
carlo/www/xcw/.svn/tmp/wcprops
carlo/www/xcw/index.html
carlo/www/xmlwrapp-0.5.0.tar.gz
lost+found
lost+found/1st level admin borders (states_provinces)
lost+found/1st level admin names (states_provinces)
lost+found/2002 - cloud cover (0-10%)
[...]

The files that will end up in lost+found are files for which no directory couldbe found (but that still had an inode copy in the journal). Most likely those are files that weredeleted long ago and can be disgarded anyway.

Once you are satisfied with the output of --dump-names, you can replace --dump-nameswith --restore-all, which in effect will cause --restore-file to be called on everyfile name printed by --dump-names. As mentioned before, it is highly advisable to use a proper--after command line option in order to avoid that ext3grep tries to recover filesthat are simply too old. Note that at this moment the output of --dump-names is unfiltered,and --restore-file (--restore-all) only honors the --aftercommand line option.

For example,

$ time ext3grep $IMAGE --restore-all --after=1202351117
Only show/process deleted entries if they are deleted on or after Thu Feb  7 03:25:17 2008.
[...]
Loading md5.ext3grep.stage2... done
Not undeleting "carlo/.Trash" because it was deleted before 1202351117 (32767)
Not undeleting "carlo/.Xauthority" because it was deleted before 1202351117 (32767)
[...]
Cannot find an undeleted inode for file "carlo/.azureus/logs/save/1176594823051_alerts_1.log".
[...]
Restoring carlo/bin/startx
[...]
real	0m3.079s
user	0m1.332s
sys	0m1.744s

where carlo/bin/startx is the only file recovered. It was the lastfile that was deleted, and I set the --after value to one second before it was.Note that it's logical that it was the last file, since I started X by executing thisscript; hence, it was "in use" until I rebooted.

Considering that it checked over 50,000 files from a in total 10 GB large partition,the 3.1 seconds is extremely fast; this is caused by several factors:1) The first time ext3grep is run, it does a full analysis of the partitionand writes the results to a cache file (in two steps, first stage1 and then stage2).These stages only need to be done once.2) Since only one file had to be recovered, there wasn't much disk access (besides, Ihave 4 GB of RAM -- so everything needed was already cached). 3) I have a very fast cpu.It was using 100% cpu during those 3.1 seconds though. Trying to restore many filesmainly hangs on disk access, but is relatively still pretty fast (you can just sitand wait for it).

Stage 1

The stage 1 cache file is written to DEVICE.ext3grep.stage1, where DEVICE isreplaced with the device name (ie, if $IMAGE is /dev/hda2,then DEVICE is hda2). There is little that can go wrong withstage 1: it just scans the whole disk and finds all blocks that seem to contain a directory.

The format of the stage1 cache file is:

$ cat md5.ext3grep.stage1
# Stage 1 data for md5.
# Inodes and directory start blocks that use it for dir entry '.'.
# INODE : BLOCK [BLOCK ...]
2 : 1109 6592 9312
11 : 1110
195457 : 415744
195468 : 2916 4732 17783 403469
195469 : 403470
[...]
929633 : 1885254
929659 : 1885280
# Extended directory blocks.
1178
1179
1182
[...]
1884516

In the first part, the first column are inodes, followed by a space, followed by a colon,followed by a space seperated list of block numbers that use that inode for a dir entry with name ".".Obviously, there can only be one directory that uses this inode, so ext3grep hasto determine which of those block numbers is the last one that was the real one. The second partlists all block numbers that contain extended directory blocks, that is, directory blocks thatare not the first block and do not contain the dir_entry with name ".". It is unknown whichdirectory those belong to without having the original inode. In stage 2 ext3grepwill attempt to find out to which directory they belong.

Stage 2

This stage, executed by the function init_directories(), contains most heuristic code.First it determines which blocks are the real directorystart blocks, and then assigns each extended directory block to one of those directories (seealso TODO, below). As a result it is possible to assign a path name to each (directory) inode,and assign a list of directory blocks to them. Finally, this result is written to a cache file(DEVICE.ext3grep.stage2). In case something goes very wrong here, you might beable to fix it by editing this file (removing incorrect-, or adding correct block numbers),however, do not remove or add comments: ext3grep will get confused if you changethe file too much.

locate database

I'm afraid that I used one more thing, besides just the dataon my partition to recover my files: I still had my /var partitionand therefore still had the locate database (in /var/cache/locate/locatedb).I used it to make a list of all file names that were deleted and wrote it to a filelocate_output, with the format:

carlo
carlo/.Trash
carlo/.Xauthority
[...]

in other words, the same format as the output of --dump-names.This file is being opened and used by the function load_locate_data,in the source file locate.cc, which fills filename_to_locatepath_map.That map is subsequently used by the function parent_directory inorder to make an educated guess about what the correct parent directory is ofa given filename.

Even then, because my locate database file wasn't complete, I needed to manuallyadd hacks. In particular, it is possible to add a hardcoded list of regularexpressions to locate.cc that causes a specified parent directory tobe returned. Still, I also hardcoded the translation of three (directory) blocknumbers to "lost+found". It might be needed to tune/hack this part of the codeif you want to be succesful in cleanly recovering your data to the correctdirectory.

If you see messages of the form:

Could not find an inode for extended directory at BLOCKNR, disregarding it's contents.

Then please read this post entirely, for more information.

Superfluous hardlinks

Because inodes are reused, it happens often that an old directory entry (of a deleted file,or in a deleted directory, or in an old directory block that is not used anymore) refers toan inode that is now used by something else. If that something else is of the same type (bothregular files) then there is no way to distinguish it from a hardlink: two files using thesame inode. As a result, a recovery results in a lot of WRONG hardlinks.

In order to make it easier to clean these up, ext3grep provides thecommand line option --show-hardlinks.

$ ext3grep $IMAGE --show-hardlinks
[...]
Inode 309562:
  carlo/bin/pc++ (309540)
  carlo/bin/pcc (309540)
  carlo/bin/pcc.unlock (309540)
Inode 702474:
  carlo/projects/libcwd/libcwd/.svn/entries (700387)
  carlo/projects/libcwd/libcwd/testsuite/tst_flush.o (700609)
[...]

Here, the hardlinks for inode 309562 are correct. The hardlink for inode 702474is wrong, and one of the files should be deleted. After you manually determined whichfile is wrong and deleted it; it will not show up again when you rerun this command:Only those hardlinks are reported that still exist in the output directory: youcan only use --show-hardlinks after running --restore-all,or it will not result in any output since no output file exists.

TODO

The program has been written while I was learning how ext3 works. It's earliestfunctionality is therefore not depending on things that I wrote later. An advantage is thatthose functionalities are faster and will still work if the later code is broken; they arealso more down-to-earth, so you can use them to check what is really going on withoutdepending on the more complex (and heuristic) code that was added later. However, there arealso disadvantages: The filtering code that I wrote for --ls is not beingused by the later written code that handles --dump-names and --restore-all.Also, stage 2 is resolved without using the journal as would be possible by using codewritten later. It is not easy to change that because that code uses the results of stage 2.I think that a better algorithm to find which blocks are the correct ones for the lastcopy of a directory would be the same as how I finally recovered files: by finding the lastnon-deleted inode of that directory in the journal. This is not how it currently works though.

Command line options

All command line options are listed by providing --help on the command line:

$ ext3grep $IMAGE --help
Usage: ext3grep [options] [--] device-file
Options:
  --version, -[vV]       Print version and exit successfully.
  --help,                Print this help and exit successfully.
  --superblock           Print contents of superblock in addition to the rest.
                         If no action is specified then this option is implied.
  --print                Print content of block or inode, if any.
  --ls                   Print directories with only one line per entry.
                         This option is often needed to turn on filtering.
  --accept filen         Accept 'filen' as a legal filename.
                         Can be used multiple times.
  --journal              Show content of journal.
  --show-path-inodes     Show the inode of each directory component in paths.
Filters:
  --group grp            Only process group 'grp'.
  --directory            Only process directory inodes.
  --after dtime          Only entries deleted on or after 'dtime'.
  --before dtime         Only entries deleted before 'dtime'.
  --deleted              Only show/process deleted entries.
  --allocated            Only show/process allocated inodes/blocks.
  --unallocated          Only show/process unallocated inodes/blocks.
  --reallocated          Do not suppress entries with reallocated inodes.
                         Inodes are considered 'reallocated' if the entry
                         is deleted but the inode is allocated, but also when
                         the file type in the dir entry and the inode are
                         different.
  --zeroed-inodes        Do not suppress entries with zeroed inodes. Linked
                         entries are always shown, regardless of this option.
  --depth depth          Process directories recursively up till a depth
                         of 'depth'.
Actions:
  --inode-to-block ino   Print the block that contains inode 'ino'.
  --inode ino            Show info on inode 'ino'.
                         If --ls is used and the inode is a directory, then
                         the filters apply to the entries of the directory.
                         If you do not use --ls then --print is implied.
  --block blk            Show info on block 'blk'.
                         If --ls is used and the block is the first block
                         of a directory, then the filters apply to entries
                         of the directory.
                         If you do not use --ls then --print is implied.
  --histogram=[atime|ctime|mtime|dtime|group]
                         Generate a histogram based on the given specs.
                         Using atime, ctime or mtime will change the
                         meaning of --after and --before to those times.
  --journal-block jblk   Show info on journal block 'jblk'.
  --journal-transaction seq
                         Show info on transaction with sequence number 'seq'.
  --dump-names           Write the path of files to stdout.
                         This implies --ls but suppresses it's output.
  --search-start str     Find blocks that start with the fixed string 'str'.
  --search str           Find blocks that contain the fixed string 'str'.
  --search-inode blk     Find inodes that refer to block 'blk'.
  --search-zeroed-inodes Return allocated inode table entries that are zeroed.
  --inode-dirblock-table dir
                         Print a table for directory path 'dir' of directory
                         block numbers found and the inodes used for each file.
  --show-journal-inodes ino
                         Show copies of inode 'ino' still in the journal.
  --restore-file 'path'  Will restore file 'path'. 'path' is relative to root
                         of the partition and does not start with a '/' (it
                         must be one of the paths returned by --dump-names).
                         The restored directory, file or symbolic link is
                         created in the current directory as ./'path'.
  --restore-all          As --restore-file but attempts to restore everything.
                         The use of --after is highly recommended because the
                         attempt to restore very old files will only result in
                         them being hard linked to a more recently deleted file
                         and as such polute the output.
  --show-hardlinks       Show all inodes that are shared by two or more files.

New functionality was more or less added top down, so this also givesa historic overview of how the program was written.

西周BC798年世界历史地图矢量文件SHP格式.zip 本资源为《西周BC798年世界历史地图矢量文件SHP格式》压缩包,文件大小约 24.84 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。 立即下载

相关推荐

西周BC1010年世界历史地图矢量文件SHP格式.zip

本资源为《西周BC1010年世界历史地图矢量文件SHP格式》压缩包,文件大小约 21.04 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。

EXT3-fs:journal inode is deleted

周末,desktop没有关机,周六停电,系统缺电关机;周一系统启动不了:EXT3-fs:journal inode is deleted一个上午用Ubuntu-7.04-Alternative-i386DVD修复,无果。所谓“修复”,只是显示一个受限的ash命令行,缺乏相关知识,无从下手。下午,抓住EXT3-fs:journal inode is deleted这么个提示,google之,有得:e...

improgrammer的专栏 340

城市生命线之长距离输水管线的监测与检测.pdf

城市生命线之长距离输水管线的监测与检测.pdf

ext3文件系统恢复

Carlo Wood, Mar 2008 Introduction It happens to everyone sooner or later: a split second after you hit Enter you realize your mistake, but it's too late; you just deleted a valuable fil...

weixin_34240657的博客 489

AI大模型训练大规模智算中心建设方案.pdf

AI大模型训练大规模智算中心建设方案.pdf

复现水下航行器(NMPC)非线性模型预测控制分布式轨迹跟踪(Matlab代码实现)

内容概要:本文档围绕水下航行器(AUV)的非线性模型预测控制(NMPC)分布式轨迹跟踪技术展开,重点复现并实现了国际顶级期刊中提出的先进控制算法。该资源详细提供了基于Matlab的仿真代码,涵盖AUV的非线性动力学建模、多智能体系统协同控制、事件触发通信机制以及复杂海洋环境下分布式轨迹跟踪的优化求解过程。通过系统地构建NMPC控制器,实现对预设轨迹的高精度跟踪,同时有效处理系统约束与外部扰动。研究强调算法在多AUV协同任务中的适用性,突出其在节能通信与实时性方面的优势,是控制理论与工程实践相结合的典型范例; 适合人群:具备自动控制原理、非线性系统理论及Matlab编程基础的研究生、科研人员和工程技术开发者,尤其适用于从事水下机器人、智能控制、多智能体协同、路径规划与优化控制等方向的研究者; 使用场景及目标:① 深入理解非线性模型预测控制(NMPC)在欠驱动AUV轨迹跟踪中的设计与实现机制;② 复现并验证高水平学术论文中的控制策略,支撑科研创新与论文撰写;③ 探索事件触发机制下的分布式协同控制架构,提升多智能体系统的通信效率与控制性能; 阅读建议:建议结合现代控制理论相关教材与原始参考文献,逐行分析Matlab代码结构与算法流程,重点关注系统建模、代价函数构造、约束处理与优化求解器的调用方式。可通过调整控制参数、初始状态或引入环境干扰等方式进行仿真实验,以评估算法的鲁棒性、收敛性与工程实用性。

EXT4文件系统学习(四)手动破坏文件系统信息并恢复

1、破坏主superblock能否挂载成功     备份:     dd if=/dev/loop0 of=super2.img     卸载     umount      破坏superblock:     dd if=/dev/zero of=/dev/loop0 bs=1k seek=1 count=1     记录了1+0 的读入     记录了1+0 的写出     1024字节(1...

TSZ0000的博客 1万+

【Python Turtle合集】有趣好玩的代码当然要分享给大家啦~(皮卡丘、玫瑰花、小黄人......)

前言 🚀 作者 :“程序员梨子” 🚀 **文章简介 **:本篇文章主要是写了利用Turtle库绘制四种不一样的图案的小程序! 🚀 **文章源码免费获取 : 为了感谢每一个关注我的小可爱💓每篇文章的项目源码都是无 偿分享滴💓👇👇👇👇 点这里蓝色这行字体自取,需要什么源码记得说标题名字哈!私信我也可! 🚀 欢迎小伙伴们 点赞👍、收藏⭐、留言💬 正文 今天给大家介绍一个好玩儿的库,嘻嘻! Turtle库是Python语言中一个很流行的绘制图像的函数库,想象一个小乌龟,在一个横轴为x、纵

TZ45678的博客 3万+

linux缩小lv发生文件系统错误

众所周知,linux lvm 扩大lv是先扩大lv,然后再扩大文件系统,所以有的人就认为缩小lv也是先缩小lv,再缩小文件系统,当然博主刚开始也那么认为,导致lvresize 以后,lv的大小小于文件系统大小而无法挂载,以下分享下解决办法。 案例: 缩小/opt from 8.46G to 4G. HostA:~ # lvresize -L 4G /dev/vg00/l...

weixin_33842304的博客 1048

GO与KEGG富集分析实战:从差异基因到功能注释

本文详细介绍了GO与KEGG富集分析的完整实战流程,从差异基因列表出发,通过基因ID转换、核心分析到结果可视化,系统阐述了如何将基因数据转化为生物学洞察。文章重点讲解了使用R语言clusterProfiler包进行GO和KEGG富集分析的具体步骤、参数设置及常见问题解决方案,并强调了结果解读与生物学故事构建的方法,帮助研究者深入理解差异基因的集体功能倾向。

weixin_29291863的博客 926

历年CSP-J(NOIP普及组)考点分析与分类汇总(纯干货)

noip/csp-j历年真题考点分类

weixin_42358969的博客 1万+

修复Linux损坏的文件系统

  fsck The file system consistency check utility most of the time is able to find and recover damaged filesystems. My systems do a filesystem check at every boot, and they get a reboot regularly. Th...

心核智慧科技 360度人脸识别开放算法 新零售系统定制 6485

ubuntu通过qemu安装银河麒麟V10_Arm_v8 (kylin_v10_飞腾/鲲鹏版)

一、windows下安装vmware虚拟机 二、ubuntu下载地址 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/20.04/ubuntu-20.04.3-live-server-amd64.iso 三、vmware中新建虚拟机,并使用ubuntu-20.04.3-live-server-amd64.iso作为启用盘 。。。在虚拟机中安装ubuntu(略) 四、配置ssh(如果ssh登录不上时配置) 修改openssh的配置 vi /etc/s

u010533742的博客 8714

Ext3日志文件系统三种日志模式的分析

在安装文件系统时,Ext3 允许您从三种数据日志记录方式中选择一个: data=writeback 、 data=ordered 和 data=journal 。要指定日志方式,可以向 /etc/fstab 的选项节添加适当的字符串(例如 data=journal ),也可以在调用 mount 时直接指定 -o data=journal 命令行选项。如果您愿意指定用于根文件系...

weixin_34239592的博客 667

浅谈Android MVI架构---大自然的搬运工~~~

浅谈 Android MVI架构

hong_world的博客 2162

Ollama DNS 重新绑定攻击 (CVE-2024-28224)

一旦 DNS 重新绑定攻击成功,攻击者就可以对这些 API 进行排序,以读取 Ollama 运行的进程可访问的任意文件数据,并将这些数据泄露到攻击者控制的系统中。完成对“创建模型” API 请求的调用后,Ollama 将收集组成新创建的用户模型的许多工件,包括大型语言模型数据、许可证数据等,以及我们要提取的文件,所有这些都可以通过其 SHA256 内容进行寻址。这是我们要窃取的文件,在我们的示例中,是可通过运行 Ollama 的主机上的路径名访问的现有文本文件。值得注意的是,该模型配置为通过参数中的。

技术超强的网络安全平台 1653

recover deleted file on ext3

[oracle@goolen ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 31 20:05:37 2013 Copyright (c) 1982, 2005, Oracle.  All rights reserved. Connected to: Oracle Database 1

Goolen的专栏 1013

影像组学文章复现:ITHscore:通过多尺度放射学特征全面定量NSCLC肿瘤内异质性 ----小细胞肺癌肿瘤异质性评分

目的:通过计算机断层扫描(CT)图像量化非小细胞肺癌(NSCLC)的肿瘤内异质性(ITH)。 方法:整合局部辐射特征和全局像素分布模式,开发定量ITH测量-ITHscore。在六个患者队列(n = 1399)中检查ITHscore与肿瘤表型,基因型和患者预后的关联,以验证其在表征ITH方面的有效性。

xxx 1028

ext3grep恢复误删除的文件

http://code.google.com/p/ext3grep/ HOWTO recover deleted files on an ext3 file system Carlo Wood, Mar 2008 Introduction It happens to everyone sooner or later: a split second after you hit Ent

春来江水绿如蓝 3005

uniapp [全端兼容] - 详细实现拍照或相册选取图片后插入水印功能,手机拍照或相册上传图像并添加自定义水印及指定位置显示水印,uniApp给图片加水印后上传到后端服务器或保存到本机相册详细教程!

uni-app,h5移动端网页,微信小程序,支付宝小程序,Android安卓,苹果ios,app,nvue,图片水印,上传照片带水印,从相册选择图片加水印功能,拍完照片给图片加水印,添加照片水印,uniapp图片加水印,为图片添加自定义水印,uni-app上传图片并添加水印,上传图片加水印,uni-app如何对拍摄的照片加水印,uni-app实现图片上传添加水印操作,给上传的图片添加上水印,图片加完水印后如何上传到服务器,水印相机,拍照图片加水印,相册选取后给图片加上水印,渲染失败,无法保存,文字水印,日期

🏆 前端领域优质创作者 1万+

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

ext3文件系统超级块损坏修复

ext3文件系统超级块损坏修复2013-05-28 10:58:04 分类: LINUX 超级块:从磁盘上读出来的第一块信息就是超级块(superblock),它记录了磁盘的几何尺寸,可用空间容量最重要的是记录了第一个inode位置,就是"/ ",ext2/3文件存取都是通过inode定位的,比如使用/home/blue/test这个文件,首先先找到/的inode,然后找到

liushi558 3367

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

linux 安全删除文件_如何在Linux上安全删除文件

linux 安全删除文件Biehler Michael/Shutterstock.comBiehler Michael / Shutterstock.com Shred old data files for the same reason you shred old paper documents. We tell you what you need to know about securely ...

culiyuan8310的博客 2593

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

GPT PMBR size mismatch 解决方法

GPT PMBR size mismatch 解决方法 parted -l 修复分区表

我的学习笔记 2万+

Linux学习之路-Linux-磁盘管理【5】---20171210

设备文件 I/O Ports: I/O设备地址 一切皆文件: open(), read(), write(), close() 设备类型: 块设备:block,存取单位“块”,磁盘 字符设备:char,存取单位“字符”,键盘 设备文件:关联至一个设备驱动程序,进而能够跟与之对应硬件设备进行通信设备号码: 主设备号:major number, 标识设备类型 次设备号:min...

weixin_34303897的博客 450
上一篇: Oracle 10gR2压缩(Compress)技术
下一篇: Linux添加硬盘并编辑配额
iqlife
博客等级 码龄20年 865粉丝 115原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址