From 11a5725b5a7e475d3b8a5386801bb682440249a7 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Mon, 28 Dec 2009 07:44:52 +0100 Subject: [PATCH] TestDisk: when search an ext[234] superblock, display the corresponding fsck.ext3 command to use the superblock parameters --- src/ext2_sb.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ext2_sb.c b/src/ext2_sb.c index d1f65855..074a404d 100644 --- a/src/ext2_sb.c +++ b/src/ext2_sb.c @@ -79,6 +79,15 @@ int interface_superblock(disk_t *disk_car,list_part_t *list_part, char**current_ (long unsigned)(partition->sb_offset/partition->blocksize), partition->blocksize, partition->fsname); } + if(list_part!=NULL) + { + const partition_t *partition=list_part->part; + screen_buffer_add("\n"); + screen_buffer_add("To repair the filesystem using alternate superblock, run\n"); + screen_buffer_add("fsck.ext%u -p -b superblock -B blocksize device\n", + (partition->upart_type==UP_EXT2?2: + (partition->upart_type==UP_EXT3?3:4))); + } screen_buffer_to_log(); if(*current_cmd==NULL) {