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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-11-2019, 04:35 PM
|
#1
|
LQ Newbie
Registered: May 2019
Posts: 7
Rep: 
|
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 !
|
|
|
08-11-2019, 05:41 PM
|
#2
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,392
|
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.
|
|
|
08-11-2019, 08:59 PM
|
#3
|
LQ Newbie
Registered: May 2019
Posts: 7
Original Poster
Rep: 
|
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
|
|
|
08-11-2019, 09:27 PM
|
#4
|
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
|
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
What precisely did you do, step-by-step, leading up to this situation?
Last edited by frankbell; 08-11-2019 at 09:29 PM.
|
|
|
08-11-2019, 10:54 PM
|
#5
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,392
|
Quote:
Originally Posted by vadeRetro
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.
|
|
|
08-11-2019, 11:21 PM
|
#6
|
LQ Newbie
Registered: May 2019
Posts: 7
Original Poster
Rep: 
|
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 ?
|
|
|
08-11-2019, 11:26 PM
|
#7
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,392
|
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.
|
|
|
08-11-2019, 11:33 PM
|
#8
|
LQ Newbie
Registered: May 2019
Posts: 7
Original Poster
Rep: 
|
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.
|
|
|
08-11-2019, 11:39 PM
|
#9
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,392
|
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 ?.
|
|
|
08-11-2019, 11:55 PM
|
#10
|
LQ Newbie
Registered: May 2019
Posts: 7
Original Poster
Rep: 
|
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.
|
|
|
All times are GMT -5. The time now is 05:39 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|