Skip to content

Commit

Permalink
✨ Add blog post for partition recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher-Hayes committed Nov 30, 2022
1 parent e138377 commit 099db12
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/_includes/layouts/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
<p style="font-size: 48px; line-height: 100%;">{{ intro.emoji }}</p>
<p class="text-xl self-center pt-1">{{ intro.desc }}</p>
</div>
<!-- grid of blog posts made in 11ty -->
<header class="mb-4">
<h2 class="text-3xl text-bg dark:text-fg py-1 px-2 inline-block bg-fg-dark bg-opacity-40 dark:bg-opacity-30 rounded-md font-bold">latest</h2>
</header>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
{% for post in collections.blog %}
<div class="bg-bg-dark rounded-xl p-4 text-fg hover:text-secondary hover:bg-primary transition duration-300 hover:duration-100 ease-out">
<a href="{{ post.url }}">
<h2 class="text-2xl font-bold">{{ post.data.title }}</h2>
<p class="text-base">{{ post.data.description }}</p>
<!-- show date -->
<p class="mt-2 text-sm opacity-50">{{ post.date | date: "%B %d, %Y" }}</p>
</a>
</div>
{% endfor %}
Expand Down
6 changes: 3 additions & 3 deletions src/blog/ddcutil.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
layout: layouts/post.html
title: Switching monitor display source from your phone
title: 📱 Switching monitor display source from your phone
meta:
desc: Using ddcutil to switch monitor display source from your phone
tag:
date: 2022-11-28
tag:
date: 2022-11-29
intro:
title: Switching monitor display source from your phone
emoji: 📱
Expand Down
28 changes: 28 additions & 0 deletions src/blog/partition-recovery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
layout: layouts/post.html
title: 💾 Recovering Files from a Corrupt Linux Partition
meta:
desc: How to recover files from a corrupt Linux partition
tag:
date: 2022-11-18
intro:
title: Recovering Files from a Corrupt Linux Partition
emoji: 💾
desc: How to recover files from a corrupt Linux partition
---

A few days ago, I encountered a strange issue with my Windows computer. After restarting, I noticed that my Linux partition had been corrupted and was now a “Sun” type partition. I was at a loss and wasn’t sure how to fully recover the partition's filesystem structure.

I decided to take a step back and try to recover my files instead. Here’s how I went about it:

1. I used the `dd` command to copy the corrupt partition onto an external SSD for recovery purposes.

2. I then used `mke2fs` to search for superblocks backups within the partition (these are essentially scattered throughout the partition).

3. I used `fsck -b` to attempt a recovery using a superblock backup.

Unfortunately, I couldn’t recover the full filesystem folder structure. But, after running `fsck`, I noticed a ton of numbered folders appear in the ext4’s “Lost + Found” folder. I was able to search for folders from there and eventually locate the files I was looking for.

The biggest takeaway from this experience is to make partition table backups. For GPT, use `gdisk --backup=backup.txt` to backup and `gdisk --load-backup=backup.txt` to recover. This way, you’ll be able to restore your partition table in the event of a corrupt partition.

I’m glad I was able to recover my files and learn a few new commands along the way. Always remember to keep a backup of your partition table to avoid any potential data loss. 📁
2 changes: 2 additions & 0 deletions src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ Static generation with 11ty, hosted on Netlify, coded by Copilot.
🚧 I recently [rebuilt this site with 11ty](https://fosstodon.org/@chris_hayes/109397203151251787). From boilerplate to live site was a single evening thanks to 11ty. There's still some `todo` items left, so please pardon the lack of content.

</span>

Edit this site [on github](https://github.com/Christopher-Hayes/hayes.software)
4 changes: 4 additions & 0 deletions src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@

.prose a {
@apply underline font-bold;
}

.prose ol li::marker{
@apply font-bold;
}
4 changes: 2 additions & 2 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ module.exports = {
'--tw-prose-invert-lead': theme('colors.fg.DEFAULT'),
'--tw-prose-invert-links': theme('white'),
'--tw-prose-invert-bold': theme('white'),
'--tw-prose-invert-counters': theme('colors.secondary.DEFAULT'),
'--tw-prose-invert-bullets': theme('colors.secondary.DEFAULT'),
'--tw-prose-invert-counters': theme('colors.primary.DEFAULT'),
'--tw-prose-invert-bullets': theme('colors.primary.DEFAULT'),
'--tw-prose-invert-hr': theme('colors.secondary.DEFAULT'),
'--tw-prose-invert-quotes': theme('colors.fg.dark'),
'--tw-prose-invert-quote-borders': theme('colors.fg.DEFAULT'),
Expand Down

0 comments on commit 099db12

Please sign in to comment.