LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-11-2019, 04:35 PM   #1
vadeRetro
LQ Newbie
 
Registered: May 2019
Posts: 7

Rep: Reputation: Disabled
Splitting 1 partition in 2 failed


Hello,

I tried to split a partition of my HDD in 2 but it failed, leaving me with 2 corrupted partition.
I tried to look after lost partitions with testdisk but it doesn't look like it found the original "big" partition despite founding a lot of old partitions.
Running fsck on this partition wasn't succesful.

I would like to know how I could eventually retrieve my data.

If someone can help,

Thanks !
 
Old 08-11-2019, 05:41 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,392

Rep: Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192
No-one can help as you haven't said what you did. We need to know all the commands you issues, and what happened after each command.
 
Old 08-11-2019, 08:59 PM   #3
vadeRetro
LQ Newbie
 
Registered: May 2019
Posts: 7

Original Poster
Rep: Reputation: Disabled
Yes indeed, I kind of posted too quickly, sorry.

The title of the thread is, in fact, not accurate, I tried to shrink a partition (ext4). It failed and gave one corrupted partition and unallowed space.

Here is the result of using fsck (even the commands suggested) on this partition (sorry for the french) :

Code:
[]# e2fsck -b 32768 /dev/sdb3
e2fsck 1.45.3 (14-Jul-2019)
e2fsck: Numéro magique invalide dans le super-bloc lors de la tentative d'ouverture de /dev/sdb3

Le superbloc n'a pu être lu ou ne contient pas un système de fichiers
ext2/ext3/ext4 correct. Si le périphérique est valide et qu'il contient réellement
un système de fichiers ext2/ext3/ext4 (et non pas de type swap, ufs ou autre),
alors le superbloc est corrompu, et vous pourriez tenter d'exécuter
e2fsck avec un autre superbloc*:
    e2fsck -b 8193 <périphérique>
 ou
    e2fsck -b 32768 <périphérique>
The HDD partition structure is currently :

Code:
TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sdb - 250 GB / 232 GiB - CHS 30394 255 63
Current partition structure:
     Partition                  Start        End    Size in sectors

 1 P EFI System                    64    1000063    1000000
 2 P Linux Swap               1000095    8812594    7812500
 3 P Unknown                  8814592  283478015  274663424


                P=Primary  D=Deleted
>[Quick Search]  [ Backup ]
                            Try to locate partition
The partition before the attempt of shrinking ended in sector 488281249

Testdisk doesn't seem to find this original partition (quick or deep search).

I hope this helps better, thanks
 
Old 08-11-2019, 09:27 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,932
Blog Entries: 28

Rep: Reputation: 6353Reputation: 6353Reputation: 6353Reputation: 6353Reputation: 6353Reputation: 6353Reputation: 6353Reputation: 6353Reputation: 6353Reputation: 6353Reputation: 6353
Google translation of the French in the first block of code above:

Quote:
Superblock could not be read or does not contain a file system
ext2 / ext3 / ext4 correct. If the device is valid and it actually contains
an ext2 / ext3 / ext4 filesystem (and not of swap, ufs or other type),
then the superblock is corrupted, and you could try to run
e2fsck with another superblock *:
OP, did you try running the command e2fsck? If so, what was the outcome?

What is the output of

Code:
fdisk -l
What precisely did you do, step-by-step, leading up to this situation?

Last edited by frankbell; 08-11-2019 at 09:29 PM.
 
Old 08-11-2019, 10:54 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,392

Rep: Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192
Quote:
Originally Posted by vadeRetro View Post
The partition before the attempt of shrinking ended in sector 488281249
More importantly, did it start at 8814592 ?. I would be concerned that the partition type indicator for P3 isn't seen as valid.
Usually in these cases you can simply resize the partition again to its old size (or larger), and no damage has been done. This is predicated on nothing having written to any part of that area of the disk - changing primary partition(s) doesn't cause any problems by itself.

In future resize the filesystem first, before the partition if using something like fdisk. If you use gparted, it will manage things properly for you.
 
Old 08-11-2019, 11:21 PM   #6
vadeRetro
LQ Newbie
 
Registered: May 2019
Posts: 7

Original Poster
Rep: Reputation: Disabled
frankbell :

My first quote is in fact the outcome of the command e2fsck, however and oddly, I executed again and now have something new at the end (following what I already sent) (maybe I just didn't notice it the first times or it is because gparted is currently looking for filesystems on the HDD) :

Quote:
/dev/sdb contains a data «*DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,1), end-CHS (0x3ff,254,63), startsector 1, 488281249 sectors, extended partition table (last)*»
(translated)

Here is the output of fdisk -l (only for the concerned HDD)

Quote:
Disque /dev/sdb*: 232,85 GiB, 250000000000*octets, 488281250*secteurs
Modèle de disque*: WDC WD2500JS-75N
Unités*: secteur de 1 × 512 = 512*octets
Taille de secteur (logique / physique)*: 512*octets / 512*octets
taille d'E/S (minimale / optimale)*: 512*octets / 512*octets
Type d'étiquette de disque*: gpt
Identifiant de disque*: CCFEF27F-AE9A-4316-ADCE-E7C51BB97D38

Périphérique Début Fin Secteurs Taille Type
/dev/sdb1 64 1000063 1000000 488,3M Système EFI
/dev/sdb2 1000095 8812594 7812500 3,7G Partition d'échange Linux
/dev/sdb3 8814592 283478015 274663424 131G Système de fichiers Linux
Oddly, the partition is recognized as a "Linux Filesystem" whereas it is not in gparted nor in testdisk and nor in KDE disk utility.

Here is what I did that lead to this situation :

I used the KDE disk utility, which I never used before (should have used gparted), to shrink /dev/sdb3. It freezed and I killed the process (something I should probably never have done)

syg00 :

This is a good question. To be honest I don't know. This HDD isn't mine and I was supposed to switch the OS from Solus to Manjaro KDE.
I guess that, in my case, trying to resize the partition won't work ?
 
Old 08-11-2019, 11:26 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,392

Rep: Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192
Let's see the output from "lsblk -f".
I would go ahead and resize the partition to use the rest of the disk - can't do any harm.
 
Old 08-11-2019, 11:33 PM   #8
vadeRetro
LQ Newbie
 
Registered: May 2019
Posts: 7

Original Poster
Rep: Reputation: Disabled
Here is the output for lsblk -f (/dev/sdb is the one to look but it doesn't show that much for this one)

Code:
NAME   FSTYPE LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda                                                                     
├─sda1 vfat         4466-78C3                               399M     0% /boot/efi
├─sda2 swap         9f7a27fe-9a62-4fa3-aeef-28469d7c8f52                [SWAP]
├─sda3 ext4         b388ff57-3ac9-460e-bc66-dac183e4be98   36,5G    19% /
└─sda4 ext4         ae372bfb-16ac-4650-a768-48865c0bf3d5  350,2G     1% /home
sdb                                                                     
├─sdb1 vfat         7C81-D4D5                                           
├─sdb2 swap         360a8ddd-6d85-41c1-b0f0-7af35fd318ca                
└─sdb3
Okay I will try to do that (I made a backup of the drive with testdisk in case whatever I do makes it even worse) but I will wait for gparted filesystems research to complete before that (it's been running for a very long time (2-3h) whereas testdisk deepsearch was less slower)

Last edited by vadeRetro; 08-11-2019 at 11:38 PM.
 
Old 08-11-2019, 11:39 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,392

Rep: Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192Reputation: 4192
Hmm - that backs up my previous concern about the start of P3. A simple resize (from the "end") should still show a valid Linux partition, and lsblk should find the filesystem header ok even if it can't be mounted.
Is your backup an image (dd or whatever) or another physical disk ?.
 
Old 08-11-2019, 11:55 PM   #10
vadeRetro
LQ Newbie
 
Registered: May 2019
Posts: 7

Original Poster
Rep: Reputation: Disabled
Okay, so resizing the partition is not likely to work if I understand ?
The backup is only a backup of the partition list from testdisk on my main drive.
 
  


Reply


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
Moving several users to a new partition / Splitting home between multiple drives nouse Linux - Hardware 5 04-15-2014 03:59 PM
Splitting LVM partition and then mounting prollocks Linux - Server 4 04-08-2010 06:22 AM
Splitting partition - need help skn Linux - Newbie 4 08-17-2009 06:25 PM
Help! Splitting 1 large partition into 3! sh1ft Linux - Hardware 2 06-30-2004 09:04 AM
splitting a vfat windows partition zLinuxz Linux - General 3 10-07-2002 11:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:39 PM.

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