last day (18 days later) » 

3:25 PM
Thanks
 
So I've told you already what we're going to do and I'll number the steps.
 
The first thing I'm confused about is how to format the external HDD to be able to write on it.
 
Tell me which ones you need help with:
1. boot Live USB
2 install ddrescue and testdisk
 
1. Done.
2. Done.
 
3. ddrescue a copy of your SSD onto the HDD.
4 As that one is NTFS and you cannot mount it, resize it with 200+GB so you can take a copy of your SD onto it
5 ddrescue SSD on HDD EXT 4 partition
 
3:28 PM
Starting with step 3 I'm lost.
 
6 run testdisk on that partition, recovering files to a third partition.
3. man ddrescue
 
Before running ddrescue, I want to know why I cannot write anything on my HDD
 
I'm not going to do all the work for you, I'm just pointing you in the right direction.
@IonicăBizău I dunno and I don't care: the only thing you need is a partition in EXT4 on there and that should be mountable and writeable.
 
OK, doing that.
 
so fire up gparted (it's a GUI) and resize NTFS so you have enough space to add ETX4
don't forget that dd is the abbreviation of disk destroyer
 
3:31 PM
The whole HDD is now ext4.
 
Very powerful tool, but if you use it the wrong way, easy to wipe all data
 
Right.
 
@IonicăBizău so resize with gparted
 
Can you tell me in short why resize is needed?
 
because it's NTFS
we need to recover EXT4 to EXT4?
 
3:33 PM
I've just formatted it to ext4
 
so it's empy?
 
The laptop SSD is ext4.
Yes, it's empty.
So, both are ext4.
 
Oh.
 
I mounted the HDD to /mnt/hdd
 
OK different strategy:
4 partitions on the HDD:
 
3:35 PM
The SSD has three partitions: fat32, ext4 and linux-swap.
 
(easier so we don't make mistakes)
yup, create them exactly as they are on the HDD in the same order with the same size
 
For my reference: sda =ssd; sdb = USB sdc=HDD
 
The ext4 has 94.40 GB--can I put 100GB?
Or it should be exact?
 
exact is best, bigger is good.
 
3:40 PM
I put bigger, to make sure it will enter
OK:
fat32: 512MB
ext4: 100GB
linux-swap: 16GB
Should I set up the flags?
I'm not sure how to do that.
 
now create another one of 100GB and give me the lsblk output
 
Another ext4?
 
yup
 
It looks like this ^
Should I click the Apply button?
 
yup
now show me the lsblk and the mount outputs
 
3:45 PM
$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb           8:16   1   7.4G  0 disk /cdrom
├─sdb2        8:18   1   2.3M  0 part
└─sdb1        8:17   1   1.5G  0 part
sr0          11:0    1  1024M  0 rom
loop0         7:0    0   1.5G  1 loop /rofs
sdc           8:32   0   1.8T  0 disk
├─sdc2        8:34   0   100G  0 part
├─sdc3        8:35   0    16G  0 part
├─sdc1        8:33   0   512M  0 part
└─sdc4        8:36   0   100G  0 part
sda           8:0    0 111.8G  0 disk
├─sda2        8:2    0  95.4G  0 part
 
let's wait for the mount output first
 
What is the mount output?
What command should I run?
 
oh- ooh...
 
$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=8135456k,nr_inodes=2033864,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=1630640k,mode=755)
/dev/sdb on /cdrom type iso9660 (ro,noatime,nojoliet,check=s,map=n,blocksize=2048)
/dev/loop0 on /rofs type squashfs (ro,noatime)
This?
 
Good! Because i was going to write: if you don't know how to do that, you're not qualified to do any data recovery
 
3:47 PM
Well.. I can learn :-)
 
For my reference: sda =ssd; sdb = USB sdc=HDD
OK, so the following command is going to copy your EFI partition from SSD to HDD:
(Do not execute, read it and verify and ask questions)
 
sorry, we need to mount sdc4 first to store the log file
 
sdc4?
 
mkdir /mnt/Recovery&&mount /dev/sdc4 /mnt/Recovery
@IonicăBizău yup, that's why we need 4 eyes.
sdd is the exrternal HDD on my machine
 
3:53 PM
mount: wrong fs type, bad option, bad superblock on /dev/sdc,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
Should it be sdc4?
 
edited
 
SDC4
 
Mounted.
 
ddrescue --direct --retry-passes=5 --verbose /dev/sda1 /dev/sdc1 /mnt/Recovery/sda1.log
 
3:54 PM
So, the last argument is the log file path.
 
the higher the retry-passes, the higher the likelyhood something will be recovered, but the longer it'll take.
 
This is going to move the fat32, into the HDD, right?
 
Minimum 3, I normally take 5 unless it's business-critical and then I take 10
 
Good to know.
 
@IonicăBizău yes
 
3:55 PM
OK, going to run it.
ddrescue --direct --retry-passes=5 --verbose /dev/sda1 /dev/sdc1 /mnt/Recovery/sda1.log
ddrescue: Output file exists and is not a regular file.
ddrescue: Use '--force' if you really want to overwrite it, but be
          aware that all existing data in the output file will be lost.
Try 'ddrescue --help' for more information.
 
It should go pretty quickly as it's only 512MB
 
Should I do everything with sudo?
 
no.
it's just saying it'll delete everything that is stored on /dev/sdc1
 
Because I didn't have permision to mkdir /mnt/Recovery and mount
 
ah.
you're not running as root.
 
3:56 PM
$ ddrescue --direct --retry-passes=5 --verbose /dev/sda1 /dev/sdc1 /mnt/Recovery/sda1.log --force
ddrescue: Can't open input file: Permission denied
 
sudo -s
 
That's what I'm asking, should I go with sudo?
Ok
 
data recovery = low-level - run as root and verify everything twice.
 
# ddrescue --direct --retry-passes=5 --verbose /dev/sda1 /dev/sdc1 /mnt/Recovery/sda1.log --force
GNU ddrescue 1.19
About to copy 536870 kBytes from /dev/sda1 to /dev/sdc1.
    Starting positions: infile = 0 B,  outfile = 0 B
    Copy block size: 128 sectors       Initial skip size: 128 sectors
Sector size: 512 Bytes

Press Ctrl-C to interrupt
rescued:   536870 kB,  errsize:       0 B,  current rate:   38862 kB/s
   ipos:   536805 kB,   errors:       0,    average rate:     134 MB/s
   opos:   536805 kB, run time:       4 s,  successful read:       0 s ago
 
rinse and repeat for: sda2
 
3:58 PM
When we run it for sda2, can we know any progress?
Like percentage or something?
 
that's what the --verbose is for
 
Something like ddrescue --direct --retry-passes=5 --verbose /dev/sda2 /dev/sdc2 /mnt/Recovery/sda2.log --force?
Ok
 
skip SWAP: that's just here as a plcaeholder
 
sda3 is swap
 
I'm going for a smoke and a drink. (Pepsi, no Rum & Coke yet)
 
3:59 PM
Ok :) Enjoy
Should I run it for sda2, then?
 
Yes, I'm smoking while you do that
:P
 
OK, running.
14846 MB so far
No errors as far I can understand
errsize: 0B
The goal is to reach some number close to 102400, right?
 
I'm back
@IonicăBizău exactly: 97280 MB
how much now?
 
4:15 PM
76,5k, so far
no errors
 
this is the command to keep when you want to try again.
 
Thanks a lot for this, @Fabby
 
It pings everyone who's user name starts with "Fabb" in this channel if you leave the "y" out.
@I pings everyone whose username starts with I
>:-)
 
Whoups, didn't know that.
But it didn't ping me.
 
I need to go to the restaurant soon though (I'm invited, so I'm definitely going)
@Io
maybe 2 letters?
 
4:18 PM
Nopes.
 
@Ion 3?
 
Yes :D
OK, just to understand: this command I've run, it brings all the files from SSD to HDD from the ext4 extension, is that right?
 
OK, so three minimum. Mmmh...
 
Can I browse them on the HDD when it's done?
 
it copies the entire partition. not the individual fles.
 
4:19 PM
What does that mean more exactly?
 
individual files is the next step:
mount and repair /dev/sdc2
 
leaving /dev/sda2 intact.
 
99,7k
No errors, so far.
 
nearly done
 
4:21 PM
Finished
 
OK
 
And now should I mount sbc2?
 
mkdir /mnt/SSD-copy
 
rmdir /mnt/SSD
 
4:22 PM
OK, I did a mv :)
 
mount /dev/sdc2 /mnt/SSD-copy
what's the output?
 
Shouldn't it be sdc2?
 
edited.
 
mount: mount /dev/sdc2 on /mnt/SSD-copy failed: Structure needs cleaning
I think here is where the real fun starts, lol
 
fsck /dev/sdc2
2!!! TWO!
 
4:23 PM
Right
 
what does that say?
 
This is gonna ask me a lot of questions
# fsck /dev/sdc2
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap
fsck.ext4: Group descriptors look bad... trying backup blocks...
Block bitmap for group 0 is not in group.  (block 65552877)
Relocate<y>?
I already ran this on the ssd before contacting you
 
Y
Shit!
 
Inode table for group 0 is not in group.  (block 1524232041)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>?
 
What did you respond?
I need to read the manual now.
 
4:25 PM
I responded with n to those ^
 
hold on
N skip that one.
@IonicăBizău what other questions?
Working without questions???
 
So, it didn't work
I answered n to those with sever data loss
 
What do you mean by "it didn't work"
did you try remounting?
 
...
e 0x5f7b.  FIXED.
fsck.ext4: e2fsck_read_bitmaps: illegal bitmap block(s) for /dev/sdc2

/dev/sdc2: ***** FILE SYSTEM WAS MODIFIED *****

/dev/sdc2: ********** WARNING: Filesystem still has errors **********
And now I'll try mounting
Same error
 
Ah!
 
4:31 PM
mount: mount /dev/sdc2 on /mnt/SSD-copy failed: Structure needs cleaning
 
Don't say "it didn't work" then1
just simple fsck again.
copy-paste errors again
Smoke. BRB
 
fsck /dev/sdc2
This?
 
yup
 
Pretty much the same...
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>? no
Group descriptor 124 checksum is 0x50cf, should be 0x5f7b.  FIXED.
fsck.ext4: e2fsck_read_bitmaps: illegal bitmap block(s) for /dev/sdc2

/dev/sdc2: ***** FILE SYSTEM WAS MODIFIED *****

/dev/sdc2: ********** WARNING: Filesystem still has errors **********
 
now you have to say yes to the first one
Don't do anything unless I tell you to do so...
 
4:36 PM
Ok
 
Please?
 
yes to SEVERE data loss?
 
yup as it doesn't mount
 
What if I say yes to all?
Will it mount?
 
no
one by one
 
4:36 PM
I can remake the copy later and try one by one
 
tell them one by one I'll tell you what to do
 
OK
Still, the same error
 
just do a:
fsck /dev/sdc2
copy-paste output
I'll tell you what to do
 
# fsck /dev/sdc2
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap
fsck.ext4: Group descriptors look bad... trying backup blocks...
Block bitmap for group 0 is not in group.  (block 65552877)
Relocate<y>? yes
Inode table for group 0 is not in group.  (block 1524232041)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>? yes
One or more block group descriptor checksums are invalid.  Fix<y>? yes
Group descriptor 0 checksum is 0x80d2, should be 0xbd49.  FIXED.
 
no.
 
4:40 PM
I will have to go in about 20 minutes...
OK, what did I do wrong?
 
fsck /dev/sdc2 [enter]
copy-paste output and I'll tell you what to do.
when to say yes and when to say nO
 
root@ubuntu:/mnt# fsck /dev/sdc2
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap
fsck.ext4: Group descriptors look bad... trying backup blocks...
Block bitmap for group 0 is not in group.  (block 65552877)
Relocate<y>?
 
Y
 
Inode table for group 0 is not in group.  (block 1524232041)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>?
 
damn! I can't type any more "Y"
so do yes again
 
4:41 PM
Ok
 
working???
 
One or more block group descriptor checksums are invalid.  Fix<y>?
All Y?
 
No!!!
 
I'll tell you what to do.
 
4:42 PM
Yes to this?
 
Y now
 
Group descriptor 0 checksum is 0x80d2, should be 0xbd49. FIXED.
Inode bitmap for group 3 is not in group. (block 581059213)
Relocate<y>?
 
Y
 
Group descriptor 3 checksum is 0xb988, should be 0x924c.  FIXED.
Inode bitmap for group 4 is not in group.  (block 95287692)
Relocate<y>?
This way is gonna be really slow
 
Y
 
4:43 PM
Until it reaches 124, we are at 3
Inode table for group 4 is not in group.  (block 95287692)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>?
 
Shit. I thought there would be only one severe data loss once we did the first one.
yes to all
 
OK, did yes to all
And now?
 
done?
 
mount: mount /dev/sdc2 on /mnt/SSD-copy failed: Structure needs cleaning
 
mount again.
fsck again
 
4:45 PM
The same
 
CtrlC
 
reading man page for mkfs
mkfs.ext4 -S /dev/sdc2
mount again afterwards
 
mkfs.ext4 -S /dev/sdc2
mke2fs 1.42.13 (17-May-2015)
/dev/sdc2 contains a ext4 file system
	last mounted on / on Fri Apr 20 13:52:56 2018
Proceed anyway? (y,n)
y?
 
Y that's a last-ditch method
to get it to mount
 
4:48 PM
Creating filesystem with 26214400 4k blocks and 6553600 inodes
Filesystem UUID: c1fcf698-3801-4132-bfec-45bdbc01ac1e
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
	4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done
Skipping journal creation in super-only mode
Writing superblocks and filesystem accounting information: done
 
mount
working???
I need to go in 2 minutes
 
Worked!!!!
Some files are unaccesable, but that's fine
 
copy all files you can already!
 
THANKS A LOT
Gonna give you a bounty soon
 
we'll take it up further when I'm back
copy to /mnt/Recovery
Bye!!!
 
4:50 PM
Do you have a specific answer you'd like to get the bounty on?
Ok :)
Thanks!
@Fabby I will be back in about 25 hours. Thank you so much again!!! I started the backup process, hopefully it's gonna work.
 
 
2 hours later…
7:20 PM
and then use it as well!!!
So this doesn't happen any more!!!
:D
If there are still other files you need to recover, we still have testdisk (that's one step further and is a file-by-file recovery. @IonicăBizău
@ThomasWard Sorted... :-)
 

  last day (18 days later) »