iSCSI disk mounted in centos 7 lost

Issues related to configuring your network
Post Reply
Blisk
Posts: 316
Joined: 2011/07/04 14:49:51
Contact:

iSCSI disk mounted in centos 7 lost

Post by Blisk » 2017/10/02 10:04:00

Two days ago I maded terrible mistake. I put in server a disk 3Tb and I tried it to erase and format it to be empty for archive.
But instead of disk sdc1 i have deleted sdk1 which is iSCSI mounted disk in centos 7.
I have tried testdisk but it just found out 400Gb partition where I can't mount it.
Is there a way to restore partition on that iSCSI disk. I can connect it but can't mount it.

tunk
Posts: 1206
Joined: 2017/02/22 15:08:17

Re: iSCSI disk mounted in centos 7 lost

Post by tunk » 2017/10/02 11:26:33

How did you "erase and format" it? What was the original file system?
I seem to remember that there exists software that can scan a disk and see if it finds partitions, file systems and files.
Last edited by tunk on 2017/10/02 11:36:59, edited 2 times in total.

Blisk
Posts: 316
Joined: 2011/07/04 14:49:51
Contact:

Re: iSCSI disk mounted in centos 7 lost

Post by Blisk » 2017/10/02 11:29:44

I did it in GUI with program "disks"
yes testdisk program should do that, but can't find whole partition.
If I use photorec I can get files but it is totall mess, all files in one folder.

tunk
Posts: 1206
Joined: 2017/02/22 15:08:17

Re: iSCSI disk mounted in centos 7 lost

Post by tunk » 2017/10/02 11:39:04

First, before doing anything else, you may want to make a raw backup of the whole disk with dd.
Did you erase and format sdk1, or sdk? If the former, then the partition info may still be stored in the MBR.
Run fdisk -l /dev/sdk to see if it's the case. If so, then you may run fs check on the partition to see if it can recover anything.
Or you may want to wait until someone more knowledgable can give advice.

Blisk
Posts: 316
Joined: 2011/07/04 14:49:51
Contact:

Re: iSCSI disk mounted in centos 7 lost

Post by Blisk » 2017/10/02 11:42:59

fdisk -l /dev/sdk
shows me this and size is totally wrong there should be 3Tb
/dev/sdk1 3478184955 4286318714 404066880 ee GPT
Partition 1 does not start on physical sector boundary.

tunk
Posts: 1206
Joined: 2017/02/22 15:08:17

Re: iSCSI disk mounted in centos 7 lost

Post by tunk » 2017/10/02 12:25:11

It may be that fdisk is confused by GPT: Run parted -l and post the full output for sdk.

Blisk
Posts: 316
Joined: 2011/07/04 14:49:51
Contact:

Re: iSCSI disk mounted in centos 7 lost

Post by Blisk » 2017/10/02 13:06:23

This is all what I get
Model: QNAP iSCSI Storage (scsi)
Disk /dev/sdk: 3221GB
Velikost sektorja (logična/fizična): 512B/512B
Preglednica razdelkov: gpt
Disk Flags:

tunk
Posts: 1206
Joined: 2017/02/22 15:08:17

Re: iSCSI disk mounted in centos 7 lost

Post by tunk » 2017/10/02 14:09:31

What filsystem did it have, xfs, ext4 ...?
I haven't used testdisk, but from their home page it says it should be able to find the SuperBlock for ext4.
I've never had to use it; the SuperBlock may/may not include enough info to recreate the partition.
Again, I advise you to make a raw backup of the whole disk with dd before changing anything on the disk.

Blisk
Posts: 316
Joined: 2011/07/04 14:49:51
Contact:

Re: iSCSI disk mounted in centos 7 lost

Post by Blisk » 2017/10/04 11:31:24

I think it was EXT4

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: iSCSI disk mounted in centos 7 lost

Post by hunter86_bg » 2017/10/04 12:24:47

I have successfully used

Code: Select all

extundelete
on Fedora and CentOS.

Post Reply