1

I just wanted to reformat my USB stick. But I was tired enough to manipulate my /dev/sda2 where my whole operating system is installed.

Because this partition was used (since I am running it now), the changes take not effect (immediately). So I can still work. But I am not sure what would happen if I restart my machine :-|

How to revert my changes? And how to check then?

Edit: What I forgot: My partition is encrypted. Does this help? :-)

Edit2: I did different random things in gparted, because I was thinking that I operate on the USB stick. Operations included deleting partition, reformating it in FAT32 and so on. I do not remember the order nor the detailed things I did :-(

lsblk gives the following output. It seems to be the layout like it used to be before I did the changes. And since I did no restart, the ones that I somehow still have:

NAME                         MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                            8:0    0 465.8G  0 disk  
├─sda1                         8:1    0   243M  0 part  /boot
└─sda5                         8:5    0 465.5G  0 part  
  └─sda5_crypt (dm-0)        252:0    0 465.5G  0 crypt 
    ├─mint--vg-root (dm-1)   252:1    0 461.7G  0 lvm   /
    └─mint--vg-swap_1 (dm-2) 252:2    0   3.8G  0 lvm   [SWAP]

Output from fdisk -l. Here you see the changes already. For example that /dev/sda2 is FAT32:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 Köpfe, 63 Sektoren/Spur, 60801 Zylinder, zusammen 976773168 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Festplattenidentifikation: 0x000a5d8e

   Gerät  boot.     Anfang        Ende     Blöcke   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          499712   976773119   488136704    b  W95 FAT32

Disk /dev/mapper/sda5_crypt: 499.8 GB, 499847790592 bytes
255 Köpfe, 63 Sektoren/Spur, 60769 Zylinder, zusammen 976265216 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Festplattenidentifikation: 0x00000000

Festplatte /dev/mapper/sda5_crypt enthält keine gültige Partitionstabelle

Disk /dev/mapper/mint--vg-root: 495.7 GB, 495716401152 bytes
255 Köpfe, 63 Sektoren/Spur, 60267 Zylinder, zusammen 968196096 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Festplattenidentifikation: 0x00000000

Festplatte /dev/mapper/mint--vg-root enthält keine gültige Partitionstabelle

Platte /dev/mapper/mint--vg-swap_1: 4076 MByte, 4076863488 Byte
255 Köpfe, 63 Sektoren/Spur, 495 Zylinder, zusammen 7962624 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Festplattenidentifikation: 0x00000000

Festplatte /dev/mapper/mint--vg-swap_1 enthält keine gültige Partitionstabelle

migrated from stackoverflow.com Sep 4 '15 at 17:29

This question came from our site for professional and enthusiast programmers.

  • 2
    First: do not restart. If you still have access to your data on your encrypted disk, you should copy it to an external device now as a backup measure in case some manipulation goes wrong. Also, your question is a better fit to superuser, maybe you will have more answers there (maybe some mod can move this post there?). – gaborous Sep 3 '15 at 9:53
  • Yep, I definitely will NOT restart :-| But thanks anyway! – Michael Sep 3 '15 at 9:54
  • 1
    Can you please give the exact layout of your disks and partitions (fdisk -l) and the commands you entered? – gaborous Sep 3 '15 at 10:03
  • See the layout in the edit. but fdisk -l did not work for me, so I used lsblk. Also see the comments on the operations I made. Edit: I needed sudo for fdisk -l. I added this to the questions above. – Michael Sep 3 '15 at 10:41
  • I believe that, with the way gparted works, it doesn't touch the actual disks until you click "Apply Changes", and then it'll refuse to operate on mounted FSs. It's possible there's no problem at all. – Tom Hunt Sep 4 '15 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.