summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-12-28 07:44:52 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2009-12-28 07:44:52 +0100
commit11a5725b5a7e475d3b8a5386801bb682440249a7 (patch)
tree7c33f21368e370a3d7fbe9e26e4da41348cc9c27
parent5d07b7dee024b0c808a92ca849a079d041150e32 (diff)
TestDisk: when search an ext[234] superblock, display the corresponding
fsck.ext3 command to use the superblock parameters
-rw-r--r--src/ext2_sb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ext2_sb.c b/src/ext2_sb.c
index d1f6585..074a404 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)
{