Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Try debugfs restore the deleted files ext3 file system     - MySQL database under Linux to achieve automatic backup scheduled backup day (Database)

- CentOS system dual network card IP information configuration (Linux)

- VPN built on CentOS (Server)

- Graphical development environment to build Android under Ubuntu 11.04 (Linux)

- Linux centos rm directory does not prompt (Linux)

- Installation and Configuration JDK8 In CentOS 7 (Linux)

- Linux upgrade GCC 4.8.1 clear and concise tutorials (Ubuntu 12.04 64-bit version as an example) (Linux)

- Several Methods of SSH Auto - login (Linux)

- Under CentOS using yum command to install the Task Scheduler crontab (Linux)

- Ubuntu firewall installation and configuration (Linux)

- Java learning problems encountered (Programming)

- Android thread mechanism --AsyncTask (Programming)

- Comparison of sorting algorithms (Programming)

- Oracle in the add & split partition on the impact of global & local index (Database)

- Linux System Getting Started Learning: the curl set custom HTTP header (Linux)

- Install Krita 2.8 on Ubuntu 13.10 / 12.04 / 12.10 (Linux)

- Linux administrator should command: sed and awk (Linux)

- Piostat - Monitoring and Statistics Linux process (Linux)

- GAMIT 10.50 installed in Ubuntu 12.04 system (Linux)

- KVM virtualization of nested virtualization (Linux)

 
         
  Try debugfs restore the deleted files ext3 file system
     
  Add Date : 2018-11-21      
         
         
         
  We all know Linux, delete the file you want to restore hard! And commands and tools under a different file system recovery may not be the same. Below that treated with debugfs, Linux comes with command, on the ext3 file system recover deleted files attempt.

   
 [Root] # mkdir / root / test // -> build test folder
 [Root] # cd / root / test // -> to enter the directory
 [Root] # touch test.txt // -> build test file name
 [Root] # cat / proc / meminfo >> test.txt // -> test file to write
 [Root] # cat test.txt
 MemTotal: 16432172 kB
 MemFree: 7577528 kB
 Buffers: 896832 kB
 Cached: 5724212 kB
 SwapCached: 0 kB
 Active: 2737104 kB
 Inactive: 4246932 kB
 HighTotal: 0 kB
 HighFree: 0 kB
 LowTotal: 16432172 kB
 LowFree: 7577528 kB
 SwapTotal: 16777208 kB
 SwapFree: 16777208 kB
 Dirty: 1944 kB
 Writeback: 0 kB
 AnonPages: 362976 kB
 Mapped: 179000 kB
 Slab: 1756168 kB
 PageTables: 9432 kB
 NFS_Unstable: 0 kB
 Bounce: 0 kB
 CommitLimit: 24993292 kB
 Committed_AS: 1469296 kB
 VmallocTotal: 34359738367 kB
 VmallocUsed: 291068 kB
 VmallocChunk: 34359447031 kB
 HugePages_Total: 0
 HugePages_Free: 0
 HugePages_Rsvd: 0
 Hugepagesize: 2048 kB
 [Root] # rm test.txt // -> Delete this test file
 [Root] # ls -lart // -> View Delete
 total 12
 drwxr-x --- 6 root root 4096 Aug 6 09:51 ..
 drwxr-xr-x 2 root root 4096 Aug 6 09:52.
 

[Root] # mount -r -n / dev / mapper / vg00-lvol1 / // -> all the way back to only mount to prevent the use of other process
 

[Root] # df -h
 Filesystem Size Used Avail Use% Mounted on
 / Dev / mapper / rootVG-root
                        83G 7.4G 72G 10% /
 / Dev / mapper / rootVG-tmp
                      3.9G 137M 3.6G 4% / tmp
 / Dev / mapper / rootVG-var
                        31G 5.0G 24G 18% / var
 / Dev / cciss / c0d0p1 145M 26M 111M 19% / boot
 / Dev / mapper / vgglobal-lvol2
                        27G 291M 25G 2% / home
 / Dev / mapper / vgglobal-lvol1
                      105G 7.3G 93G 8% / d / oss / global
 [Root @ nas2ds1 test] # df -T
 Filesystem Type 1K-blocks Used Available Use% Mounted on
 / Dev / mapper / rootVG-root
              ext3 86623180 7696528 74455460 10% /
 / Dev / mapper / rootVG-tmp
              ext3 4062912 139456 3713744 4% / tmp
 / Dev / mapper / rootVG-var
              ext3 31741856 5222564 24880892 18% / var
 / Dev / cciss / c0d0p1
              ext3 147764 26611 113524 19% / boot
 / Dev / mapper / vgglobal-lvol2
              ext3 27447508 297580 25755652 2% / home
 / Dev / mapper / vgglobal-lvol1
              ext3 109806464 7579200 96649332 8% / d / oss / global
 [Root] # debugfs // -> Use this command
 debugfs 1.39 (29-May-2006)
 debugfs: open / dev / mapper / rootVG-root // -> Open File System
 debugfs: ls -d / root / test // -> View deleted files
  16269861 (12). 16269793 (4084) .. < 16269863> (4072) test.txt
 debugfs: logdump -i < 16269861> // -> node where the block view
 Inode 16269861 is at group 497, block 16285700, offset 512
 Journal starts at block 6182, transaction 1128695
  FS block 16285700 logged at sequence 1128698, journal block 6330
    (Inode block for inode 16269861):
    Inode: 16269861 Type: bad type Mode: 0000 Flags: 0x0 Generation: 0
    User: 0 Group: 0 Size: 0
    File ACL: 0 Directory ACL: 0
    Links: 0 Blockcount: 0
    Fragment: Address: 0 Number: 0 Size: 0
    ctime: 0x00000000 - Thu Jan 1 07:00:00 1970
    atime: 0x00000000 - Thu Jan 1 07:00:00 1970
    mtime: 0x00000000 - Thu Jan 1 07:00:00 1970
    Blocks:
  FS block 16285700 logged at sequence 1128704, journal block 6727
    (Inode block for inode 16269861):
    Inode: 16269861 Type: bad type Mode: 0000 Flags: 0x0 Generation: 0
    User: 0 Group: 0 Size: 0
    File ACL: 0 Directory ACL: 0
    Links: 0 Blockcount: 0
    Fragment: Address: 0 Number: 0 Size: 0
    ctime: 0x00000000 - Thu Jan 1 07:00:00 1970
    atime: 0x00000000 - Thu Jan 1 07:00:00 1970
    mtime: 0x00000000 - Thu Jan 1 07:00:00 1970
    Blocks:
  FS block 16285700 logged at sequence 1128705, journal block 6819
    (Inode block for inode 16269861):
    Inode: 16269861 Type: bad type Mode: 0000 Flags: 0x0 Generation: 0
    User: 0 Group: 0 Size: 0
    File ACL: 0 Directory ACL: 0
    Links: 0 Blockcount: 0
    Fragment: Address: 0 Number: 0 Size: 0
    ctime: 0x00000000 - Thu Jan 1 07:00:00 1970
    atime: 0x00000000 - Thu Jan 1 07:00:00 1970
    mtime: 0x00000000 - Thu Jan 1 07:00:00 1970
    Blocks:
  FS block 16285700 logged at sequence 1128707, journal block 6860
    (Inode block for inode 16269861):
    Inode: 16269861 Type: directory Mode: 0755 Flags: 0x0 Generation: 285284165
    User: 0 Group: 0 Size: 4096
    File ACL: 0 Directory ACL: 0
    Links: 2 Blockcount: 8
    Fragment: Address: 0 Number: 0 Size: 0
    ctime: 0x53e18a66 - Wed Aug 6 09:52:38 2014
    atime: 0x53e18a44 - Wed Aug 6 09:52:04 2014
    mtime: 0x53e18a66 - Wed Aug 6 09:52:38 2014
    Blocks: (0 + 1): 16312328
 Found sequence 1127169 (not 1128751) at block 9518: end of journal
 debugfs: quit // -> exit, execute the dd command, count is set to 1, skip to the value of just viewing, which was placed in the / tmp directory.
 [Root] # dd if = / dev / mapper / rootVG-root of = / tmp / test.txt.bak bs = 4096 count = 1 skip = 16312328
 1 + 0 records in
 1 + 0 records out
 4096 bytes (4.1 kB) copied, 4.1e-05 seconds, 99.9 MB / s
 [Root] # cat /tmp/test.txt // -> check the contents, and consistent with the original!
 

MemTotal: 16432172 kB
 MemFree: 7577528 kB
 Buffers: 896832 kB
 Cached: 5724212 kB
 SwapCached: 0 kB
 Active: 2737104 kB
 Inactive: 4246932 kB
 HighTotal: 0 kB
 HighFree: 0 kB
 LowTotal: 16432172 kB
 LowFree: 7577528 kB
 SwapTotal: 16777208 kB
 SwapFree: 16777208 kB
 Dirty: 1944 kB
 Writeback: 0 kB
 AnonPages: 362976 kB
 Mapped: 179000 kB
 Slab: 1756168 kB
 PageTables: 9432 kB
 NFS_Unstable: 0 kB
 Bounce: 0 kB
 CommitLimit: 24993292 kB
 Committed_AS: 1469296 kB
 VmallocTotal: 34359738367 kB
 VmallocUsed: 291068 kB
 VmallocChunk: 34359447031 kB
 HugePages_Total: 0
 HugePages_Free: 0
 HugePages_Rsvd: 0
 Hugepagesize: 2048 kB
     
         
         
         
  More:      
 
- Linux, modify the fstab file system can not start causing solve one case (Linux)
- 2016, the new Node project Precautions (Programming)
- Linux Learning Notes: Users and Groups (Linux)
- Oracle 11g Export guide problem not an empty table (Database)
- Android Studio Clear Project or Rebuild Project Error (Linux)
- Ubuntu 14.04 LTS NTFS partition can not access solution (Linux)
- Setup Qt development environment under Linux (Linux)
- Extended use of the swap file swap space on Linux (Linux)
- A key installation Gitlab 7 on RHEL6.4 and Setup Mail TX (Linux)
- Intrusion analysis and prevention tools Knark under Linux platform (Linux)
- After installation of Debian 6.0 do a few things first (Linux)
- Nodejs command-line program development tutorial (Programming)
- JDK tools jstat (Linux)
- DDOS Attacks and Prevention (Linux)
- Transfer files and permissions from Windows to Linux system by Samba (Linux)
- How Mutt mail client to use cipher text password (Linux)
- Installation Strongswan: on a Linux IPsec-based VPN tool (Linux)
- Fedora 22 users to install the VLC media player (Linux)
- How to use SHA256 checksum files download (Linux)
- Web database security tips (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.