Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Closed Thread
  Search this Thread
Old 07-20-2015, 02:40 PM   #1
LQ Newbie
Registered: Jul 2015
Posts: 2

Rep: Reputation: Disabled
Ran mke2fs -S on a disk partition and trying to get back the data

Ran mke2fs -S on my disk partition and now trying to get the data back.

Set up
Running a home server with a 2TB HDD. Running VMWare ESXi 5.5 that has 2 guest OS; CentOS 7 and Windows Server 2012 R2.
There are 3 virtual disks (VMDK) thickly provisioned:
  • 20GB CentOS 7 install
  • 40GB Windows 2012 install
  • ~1.9TB data disk for CentOS 7

Original issue
I left no space on the data store when creating the data disk which meant after shutting the Windows VM, there was no room for the swap file to boot it back up. Due to the size of the disk, there was also no room to perform a copy of the data disk to then be able safely convert it.

Attempted solution
Tried to find a way of slightly decreasing the size of the data virtual disk to give Windows enough space to load. Hole punched VMDK following this guide:

In CentOS:

cd /mnt/data 
dd bs=1M count=8192 if=/dev/zero of=zero
In ESXi:

cd /vmfs/volumes/ds1/vma 
vmkfstools -K vma_1.vmdk
Then attempted to shrink the partition after reading the following guide:

umount /dev/sdb1
e2fsck /dev/sdb1
Here I got a message saying "bad magic number in super-block"
I tried the below which didnt work:

e2fsck -b 32768 /dev/sdb1
Followed by:

mke2fs -S /dev/sdb1
Before running the above command my file system was still intact - I could still see the individual folder names when mounting the disk. Now I just had an empty lost+found folder.
I then believed that maybe this issue was happening because my file system was actually XFS and not EXT4. So I tried:

xfs_repair /dev/sdb1
Current and even worse issue
Now inside the lost+found folder its full of numbered folders. One of which has "Led Zeppelin" on it indicating that the underlying data is perhaps still there.
I have stopped tinkering with it now as I don't want to make it any worse, even though I realise the data is probably already corrupt.
Does anybody know of anything else I can try? Unfortunately the partition contains all of my data, most of which is not backed up elsewhere.
Old 07-20-2015, 10:02 PM   #2
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,588

Rep: Reputation: 4058Reputation: 4058Reputation: 4058Reputation: 4058Reputation: 4058Reputation: 4058Reputation: 4058Reputation: 4058Reputation: 4058Reputation: 4058Reputation: 4058
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Closed Thread

centos, hard disk, partition, recovery

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] disk accidentally converted to GPT -what i can get back my data ? WiseDraco Slackware 3 03-18-2015 02:54 PM
host ran out of disk space, guest virtual disk got corrupt help please fedora.linux.64 Linux - Virtualization and Cloud 16 08-09-2010 05:04 PM
mke2fs for large partition amitabhm Linux - Software 1 04-11-2007 06:30 AM
cant format partition using mke2fs linuxbh Linux From Scratch 2 04-04-2005 11:08 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:40 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration