Edit: I was able to recover my partitions by creating new partition starting and ending with same exact sectors.

I was copying files from my previous installation to my new Gentoo installation. After I was done. I ran wipefs on /dev/nvme0n1 thinking it is my old nvme drive which is connected through usb. I am in disbelief. Lost all of my configuration files. My perfect installation of gentoo. Just gone. How do I never make such mistake again? Thankfully I had backup of passwords file. Rest is gone. I am sad.

  • lemmylemonade@lemmy.mlOP
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    5 hours ago

    Guys, I managed to recover my partitions. I used test disk to write the detected efi partition which was of 500MiB. The gpt partition table backup uses 33 sectors to I created second partition starting from where the previous ended to totalsectors-33. I was able to luksDump the header after this and successfully decrypt and mount my device. I had to grub-install and now my system is up and running. Thank you so much everyone for their help and their kind words.

  • CrayonDevourer@lemmy.world
    link
    fedilink
    English
    arrow-up
    20
    ·
    19 hours ago

    I usually physically take drives out and boot without them before wiping. Just something I do now, because of this exact situation.

  • Creat@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    11
    ·
    17 hours ago

    You never make such a mistake again by having real backups next time. This is how most people learn why they need backups.

  • harsh3466@lemmy.ml
    link
    fedilink
    English
    arrow-up
    4
    ·
    14 hours ago

    I use gnu stow and my self hosted got forge to manage and back up my config files. With a 3-2-1 backup strategy on the gitforge of three copies, at least two mediums, with one offsite.

    • lemmylemonade@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      11 hours ago

      I’ve recovered my boot partition but my other partition was formatted with luks. The boot partition is working and not throwing any errors. How can I restore the luksheader? Is it even possible?

  • LoreSoong@startrek.website
    link
    fedilink
    English
    arrow-up
    9
    ·
    19 hours ago

    Personally, I configure my entire os before signing in to websites or any software (or putting any privacy critical info on my system) then I backup my os to my NAS using rescuezilla, using linux its usually max 30Gb. I also have a private github repo that i backup my dotfiles to just in case my NAS kicks the bucket. Going back to a “clean” install after doing something stupid kinda sucks but at least all your hard work making it look and feel the way you want will persist. I also highly reccomend doing some sort of offline & off network backup for privacy sensative information. Best of luck, I feel your pain I nuked my system once after days of work and i said, never again.

  • Libb@jlai.lu
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    19 hours ago

    I have nothing to offer but some sympathy and one advice: I have two critical backups running: my personal files and the various folders containing my config files.

    As I learned more or less the exact same way you just did how critical it is to backup those files too as, losing them by formatting my drive, I instantly realized they’re as personal and important as my ‘real’ files are.

  • The whole drive? Not just a partition? No snapshots?

    All I can say is that I’ve done similar before, and done exactly what you did, in times before backups were a thing for home gamers; when doing backups meant owning an expensive tape drive and diligence. You’re not alone.

    • lemmylemonade@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      11 hours ago

      I did test disk on the drive and recoverd my boot partition. Seems like the data hasn’t been touched. The problem now is recovering the luks header. As my root partiton was encrypted with luks.

  • msage@programming.dev
    link
    fedilink
    English
    arrow-up
    4
    ·
    18 hours ago

    Perhaps try git for your configuration?

    I haven’t done it yet, but I thought about trying to restore it on another PC and see if it starts.

  • Only Exception@mstdn.plus
    link
    fedilink
    arrow-up
    1
    ·
    19 hours ago

    @lemmylemonade Just read, I am sorry for your wiped drive. The only solution I could think of is having a copy of your drive somewhere else. However I understand that just dropping money on a spare drive isn’t always a practical solution.