blob: 73042fafe06cedd46b858ec76afb86b65fa5902f [file] [log] [blame]
Theodore Ts'o3839e651997-04-26 13:21:57 +00001/*
2 * dumpe2fs.c - List the control structures of a second
3 * extended filesystem
4 *
5 * Copyright (C) 1992, 1993, 1994 Remy Card <card@masi.ibp.fr>
6 * Laboratoire MASI, Institut Blaise Pascal
7 * Universite Pierre et Marie Curie (Paris VI)
8 *
Theodore Ts'o19c78dc1997-04-29 16:17:09 +00009 * Copyright 1995, 1996, 1997 by Theodore Ts'o.
10 *
11 * %Begin-Header%
12 * This file may be redistributed under the terms of the GNU Public
13 * License.
14 * %End-Header%
Theodore Ts'o3839e651997-04-26 13:21:57 +000015 */
16
17/*
18 * History:
19 * 94/01/09 - Creation
20 * 94/02/27 - Ported to use the ext2fs library
21 */
22
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000023#ifdef HAVE_GETOPT_H
Theodore Ts'o3839e651997-04-26 13:21:57 +000024#include <getopt.h>
Theodore Ts'o373b8332000-04-03 16:22:35 +000025#else
26extern char *optarg;
27extern int optind;
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000028#endif
Theodore Ts'o3839e651997-04-26 13:21:57 +000029#include <fcntl.h>
30#include <stdio.h>
31#include <stdlib.h>
32#include <string.h>
33#include <unistd.h>
34
Theodore Ts'o54c637d2001-05-14 11:45:38 +000035#include "ext2fs/ext2_fs.h"
Theodore Ts'o3839e651997-04-26 13:21:57 +000036
37#include "ext2fs/ext2fs.h"
38#include "e2p/e2p.h"
Theodore Ts'o16ed5b32001-01-16 07:47:31 +000039#include "jfs_user.h"
Theodore Ts'o4ea7bd02001-12-16 23:23:37 -050040#include <uuid/uuid.h>
Theodore Ts'o3839e651997-04-26 13:21:57 +000041
42#include "../version.h"
Theodore Ts'od9c56d32000-02-08 00:47:55 +000043#include "nls-enable.h"
Theodore Ts'o3839e651997-04-26 13:21:57 +000044
Theodore Ts'o74becf31997-04-26 14:37:06 +000045#define in_use(m, x) (ext2fs_test_bit ((x), (m)))
Theodore Ts'o3839e651997-04-26 13:21:57 +000046
47const char * program_name = "dumpe2fs";
48char * device_name = NULL;
Theodore Ts'o4ea7bd02001-12-16 23:23:37 -050049const char *num_format = "%lu";
Theodore Ts'o0655b102001-12-21 23:59:46 -050050char range_format[16];
Theodore Ts'o3839e651997-04-26 13:21:57 +000051
Theodore Ts'o818180c1998-06-27 05:11:14 +000052static void usage(void)
Theodore Ts'o3839e651997-04-26 13:21:57 +000053{
Theodore Ts'o348e43d2001-05-03 14:43:43 +000054 fprintf (stderr, _("Usage: %s [-bfhixV] [-ob superblock] "
Theodore Ts'od9c56d32000-02-08 00:47:55 +000055 "[-oB blocksize] device\n"), program_name);
Theodore Ts'o3839e651997-04-26 13:21:57 +000056 exit (1);
57}
58
Theodore Ts'o54434922003-12-07 01:28:50 -050059static void print_number (unsigned long num)
60{
61 printf(num_format, num);
62}
63
Theodore Ts'o3839e651997-04-26 13:21:57 +000064static void print_free (unsigned long group, char * bitmap,
65 unsigned long nbytes, unsigned long offset)
66{
67 int p = 0;
68 unsigned long i;
69 unsigned long j;
70
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +010071 offset += group * nbytes;
Theodore Ts'o3839e651997-04-26 13:21:57 +000072 for (i = 0; i < nbytes; i++)
73 if (!in_use (bitmap, i))
74 {
75 if (p)
76 printf (", ");
Theodore Ts'o54434922003-12-07 01:28:50 -050077 print_number(i + offset);
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +010078 for (j = i; j < nbytes && !in_use (bitmap, j); j++)
79 ;
80 if (--j != i) {
81 fputc('-', stdout);
Theodore Ts'o54434922003-12-07 01:28:50 -050082 print_number(j + offset);
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +010083 i = j;
Theodore Ts'o3839e651997-04-26 13:21:57 +000084 }
85 p = 1;
86 }
87}
88
89static void list_desc (ext2_filsys fs)
90{
91 unsigned long i;
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +010092 long diff;
Theodore Ts'o521e3681997-04-29 17:48:10 +000093 blk_t group_blk, next_blk;
Theodore Ts'oef344e12003-11-21 09:02:21 -050094 blk_t super_blk, old_desc_blk, new_desc_blk;
Theodore Ts'od90a23e2002-10-25 17:07:11 -040095 char *block_bitmap=NULL, *inode_bitmap=NULL;
Theodore Ts'o35238dd2004-12-23 13:54:28 -050096 int inode_blocks_per_group, old_desc_blocks, reserved_gdt;
Theodore Ts'oef344e12003-11-21 09:02:21 -050097 int has_super;
Theodore Ts'o80c22c92000-08-14 15:32:11 +000098
Theodore Ts'od90a23e2002-10-25 17:07:11 -040099 if (fs->block_map)
100 block_bitmap = fs->block_map->bitmap;
101 if (fs->inode_map)
102 inode_bitmap = fs->inode_map->bitmap;
103
Theodore Ts'o80c22c92000-08-14 15:32:11 +0000104 inode_blocks_per_group = ((fs->super->s_inodes_per_group *
105 EXT2_INODE_SIZE(fs->super)) +
106 EXT2_BLOCK_SIZE(fs->super) - 1) /
107 EXT2_BLOCK_SIZE(fs->super);
Theodore Ts'o35238dd2004-12-23 13:54:28 -0500108 reserved_gdt = fs->super->s_reserved_gdt_blocks;
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100109 fputc('\n', stdout);
Theodore Ts'o521e3681997-04-29 17:48:10 +0000110 group_blk = fs->super->s_first_data_block;
Theodore Ts'o76dd5e52002-10-30 23:07:21 -0500111 if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
112 old_desc_blocks = fs->super->s_first_meta_bg;
113 else
114 old_desc_blocks = fs->desc_blocks;
Theodore Ts'o521e3681997-04-29 17:48:10 +0000115 for (i = 0; i < fs->group_desc_count; i++) {
Theodore Ts'oef344e12003-11-21 09:02:21 -0500116 ext2fs_super_and_bgd_loc(fs, i, &super_blk,
117 &old_desc_blk, &new_desc_blk, 0);
Theodore Ts'o521e3681997-04-29 17:48:10 +0000118 next_blk = group_blk + fs->super->s_blocks_per_group;
119 if (next_blk > fs->super->s_blocks_count)
120 next_blk = fs->super->s_blocks_count;
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100121 printf (_("Group %lu: (Blocks "), i);
Theodore Ts'o0655b102001-12-21 23:59:46 -0500122 printf(range_format, group_blk, next_blk - 1);
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100123 fputs(")\n", stdout);
Theodore Ts'oef344e12003-11-21 09:02:21 -0500124 has_super = ((i==0) || super_blk);
Theodore Ts'oc046ac72002-10-20 00:38:57 -0400125 if (has_super) {
126 printf (_(" %s superblock at "),
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100127 i == 0 ? _("Primary") : _("Backup"));
Theodore Ts'o54434922003-12-07 01:28:50 -0500128 print_number(super_blk);
Theodore Ts'oc046ac72002-10-20 00:38:57 -0400129 }
Theodore Ts'oef344e12003-11-21 09:02:21 -0500130 if (old_desc_blk) {
131 printf(_(", Group descriptors at "));
132 printf(range_format, old_desc_blk,
133 old_desc_blk + old_desc_blocks - 1);
Theodore Ts'o35238dd2004-12-23 13:54:28 -0500134 if (reserved_gdt) {
135 printf(_("\n Reserved GDT blocks at "));
136 printf(range_format,
137 old_desc_blk + old_desc_blocks,
138 old_desc_blk + old_desc_blocks +
139 reserved_gdt - 1);
140 }
Theodore Ts'oef344e12003-11-21 09:02:21 -0500141 } else if (new_desc_blk) {
142 fputc(has_super ? ',' : ' ', stdout);
143 printf(_(" Group descriptor at "));
Theodore Ts'o54434922003-12-07 01:28:50 -0500144 print_number(new_desc_blk);
Theodore Ts'oef344e12003-11-21 09:02:21 -0500145 has_super++;
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100146 }
Theodore Ts'oef344e12003-11-21 09:02:21 -0500147 if (has_super)
148 fputc('\n', stdout);
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100149 fputs(_(" Block bitmap at "), stdout);
Theodore Ts'o54434922003-12-07 01:28:50 -0500150 print_number(fs->group_desc[i].bg_block_bitmap);
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100151 diff = fs->group_desc[i].bg_block_bitmap - group_blk;
152 if (diff >= 0)
Theodore Ts'o4ea7bd02001-12-16 23:23:37 -0500153 printf(" (+%ld)", diff);
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100154 fputs(_(", Inode bitmap at "), stdout);
Theodore Ts'o54434922003-12-07 01:28:50 -0500155 print_number(fs->group_desc[i].bg_inode_bitmap);
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100156 diff = fs->group_desc[i].bg_inode_bitmap - group_blk;
157 if (diff >= 0)
Theodore Ts'o4ea7bd02001-12-16 23:23:37 -0500158 printf(" (+%ld)", diff);
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100159 fputs(_("\n Inode table at "), stdout);
Theodore Ts'o0655b102001-12-21 23:59:46 -0500160 printf(range_format, fs->group_desc[i].bg_inode_table,
161 fs->group_desc[i].bg_inode_table +
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100162 inode_blocks_per_group - 1);
163 diff = fs->group_desc[i].bg_inode_table - group_blk;
164 if (diff > 0)
Theodore Ts'o4ea7bd02001-12-16 23:23:37 -0500165 printf(" (+%ld)", diff);
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100166 printf (_("\n %d free blocks, %d free inodes, "
Theodore Ts'od90a23e2002-10-25 17:07:11 -0400167 "%d directories\n"),
Theodore Ts'o3839e651997-04-26 13:21:57 +0000168 fs->group_desc[i].bg_free_blocks_count,
169 fs->group_desc[i].bg_free_inodes_count,
170 fs->group_desc[i].bg_used_dirs_count);
Theodore Ts'od90a23e2002-10-25 17:07:11 -0400171 if (block_bitmap) {
172 fputs(_(" Free blocks: "), stdout);
173 print_free (i, block_bitmap,
174 fs->super->s_blocks_per_group,
175 fs->super->s_first_data_block);
176 fputc('\n', stdout);
177 block_bitmap += fs->super->s_blocks_per_group / 8;
178 }
179 if (inode_bitmap) {
180 fputs(_(" Free inodes: "), stdout);
181 print_free (i, inode_bitmap,
182 fs->super->s_inodes_per_group, 1);
183 fputc('\n', stdout);
184 inode_bitmap += fs->super->s_inodes_per_group / 8;
185 }
Theodore Ts'o521e3681997-04-29 17:48:10 +0000186 group_blk = next_blk;
Theodore Ts'o3839e651997-04-26 13:21:57 +0000187 }
188}
189
Theodore Ts'o0655b102001-12-21 23:59:46 -0500190static void list_bad_blocks(ext2_filsys fs, int dump)
Theodore Ts'o3839e651997-04-26 13:21:57 +0000191{
192 badblocks_list bb_list = 0;
193 badblocks_iterate bb_iter;
194 blk_t blk;
195 errcode_t retval;
Theodore Ts'o0655b102001-12-21 23:59:46 -0500196 const char *header, *fmt;
Theodore Ts'o3839e651997-04-26 13:21:57 +0000197
198 retval = ext2fs_read_bb_inode(fs, &bb_list);
199 if (retval) {
200 com_err("ext2fs_read_bb_inode", retval, "");
Theodore Ts'o0655b102001-12-21 23:59:46 -0500201 return;
Theodore Ts'o3839e651997-04-26 13:21:57 +0000202 }
Theodore Ts'ocbbf0312001-06-13 00:12:04 +0000203 retval = ext2fs_badblocks_list_iterate_begin(bb_list, &bb_iter);
Theodore Ts'o3839e651997-04-26 13:21:57 +0000204 if (retval) {
Theodore Ts'ocbbf0312001-06-13 00:12:04 +0000205 com_err("ext2fs_badblocks_list_iterate_begin", retval,
Theodore Ts'od9c56d32000-02-08 00:47:55 +0000206 _("while printing bad block list"));
Theodore Ts'o0655b102001-12-21 23:59:46 -0500207 return;
Theodore Ts'o3839e651997-04-26 13:21:57 +0000208 }
Theodore Ts'o0655b102001-12-21 23:59:46 -0500209 if (dump) {
210 header = fmt = "%d\n";
211 } else {
212 header = _("Bad blocks: %d");
213 fmt = ", %d";
214 }
215 while (ext2fs_badblocks_list_iterate(bb_iter, &blk)) {
216 printf(header ? header : fmt, blk);
217 header = 0;
218 }
Theodore Ts'ocbbf0312001-06-13 00:12:04 +0000219 ext2fs_badblocks_list_iterate_end(bb_iter);
Theodore Ts'o0655b102001-12-21 23:59:46 -0500220 if (!dump)
221 fputc('\n', stdout);
Theodore Ts'o1e3472c1997-04-29 14:53:37 +0000222}
Theodore Ts'of3db3561997-04-26 13:34:30 +0000223
Theodore Ts'o16ed5b32001-01-16 07:47:31 +0000224static void print_journal_information(ext2_filsys fs)
225{
226 errcode_t retval;
227 char buf[1024];
228 char str[80];
Theodore Ts'o54434922003-12-07 01:28:50 -0500229 unsigned int i;
Theodore Ts'o16ed5b32001-01-16 07:47:31 +0000230 journal_superblock_t *jsb;
231
232 /* Get the journal superblock */
Theodore Ts'o02088862001-01-18 01:44:19 +0000233 if ((retval = io_channel_read_blk(fs->io, fs->super->s_first_data_block+1, -1024, buf))) {
Theodore Ts'o16ed5b32001-01-16 07:47:31 +0000234 com_err(program_name, retval,
235 _("while reading journal superblock"));
236 exit(1);
237 }
238 jsb = (journal_superblock_t *) buf;
239 if ((jsb->s_header.h_magic != (unsigned) ntohl(JFS_MAGIC_NUMBER)) ||
240 (jsb->s_header.h_blocktype !=
241 (unsigned) ntohl(JFS_SUPERBLOCK_V2))) {
242 com_err(program_name, 0,
243 _("Couldn't find journal superblock magic numbers"));
244 exit(1);
245 }
246
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100247 printf(_("\nJournal block size: %d\n"
248 "Journal length: %d\n"
249 "Journal first block: %d\n"
250 "Journal sequence: 0x%08x\n"
251 "Journal start: %d\n"
252 "Journal number of users: %d\n"),
253 ntohl(jsb->s_blocksize), ntohl(jsb->s_maxlen),
254 ntohl(jsb->s_first), ntohl(jsb->s_sequence),
255 ntohl(jsb->s_start), ntohl(jsb->s_nr_users));
256
Theodore Ts'o16ed5b32001-01-16 07:47:31 +0000257 for (i=0; i < ntohl(jsb->s_nr_users); i++) {
Theodore Ts'o16ed5b32001-01-16 07:47:31 +0000258 uuid_unparse(&jsb->s_users[i*16], str);
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100259 printf(i ? " %s\n"
260 : "Journal users: %s\n",
261 str);
Theodore Ts'o16ed5b32001-01-16 07:47:31 +0000262 }
263}
264
Theodore Ts'o00e54331997-09-16 02:13:52 +0000265int main (int argc, char ** argv)
Theodore Ts'o3839e651997-04-26 13:21:57 +0000266{
267 errcode_t retval;
268 ext2_filsys fs;
Theodore Ts'of3db3561997-04-26 13:34:30 +0000269 int print_badblocks = 0;
Theodore Ts'o02e7dd91999-06-18 00:48:41 +0000270 int use_superblock = 0;
271 int use_blocksize = 0;
Theodore Ts'o348e43d2001-05-03 14:43:43 +0000272 int image_dump = 0;
Theodore Ts'o27401561999-09-14 20:11:19 +0000273 int force = 0;
Theodore Ts'o16ed5b32001-01-16 07:47:31 +0000274 int flags;
Theodore Ts'o27401561999-09-14 20:11:19 +0000275 int header_only = 0;
Theodore Ts'o1e3472c1997-04-29 14:53:37 +0000276 int big_endian;
Theodore Ts'o519149f1997-10-25 03:49:49 +0000277 int c;
Theodore Ts'o3839e651997-04-26 13:21:57 +0000278
Theodore Ts'od9c56d32000-02-08 00:47:55 +0000279#ifdef ENABLE_NLS
280 setlocale(LC_MESSAGES, "");
Theodore Ts'o14308a52002-03-05 03:26:52 -0500281 setlocale(LC_CTYPE, "");
Theodore Ts'od9c56d32000-02-08 00:47:55 +0000282 bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
283 textdomain(NLS_CAT_NAME);
284#endif
Theodore Ts'o5c576471997-04-29 15:29:49 +0000285 initialize_ext2_error_table();
Theodore Ts'o0f8973f2001-08-27 12:44:23 -0400286 fprintf (stderr, "dumpe2fs %s (%s)\n", E2FSPROGS_VERSION,
287 E2FSPROGS_DATE);
Theodore Ts'o3839e651997-04-26 13:21:57 +0000288 if (argc && *argv)
289 program_name = *argv;
Theodore Ts'of3db3561997-04-26 13:34:30 +0000290
Theodore Ts'o348e43d2001-05-03 14:43:43 +0000291 while ((c = getopt (argc, argv, "bfhixVo:")) != EOF) {
Theodore Ts'of3db3561997-04-26 13:34:30 +0000292 switch (c) {
293 case 'b':
294 print_badblocks++;
295 break;
Theodore Ts'o27401561999-09-14 20:11:19 +0000296 case 'f':
297 force++;
298 break;
299 case 'h':
300 header_only++;
301 break;
Theodore Ts'o348e43d2001-05-03 14:43:43 +0000302 case 'i':
303 image_dump++;
304 break;
Theodore Ts'o02e7dd91999-06-18 00:48:41 +0000305 case 'o':
306 if (optarg[0] == 'b')
307 use_superblock = atoi(optarg+1);
308 else if (optarg[0] == 'B')
309 use_blocksize = atoi(optarg+1);
310 else
311 usage();
312 break;
Theodore Ts'o5c576471997-04-29 15:29:49 +0000313 case 'V':
314 /* Print version number and exit */
Theodore Ts'od9c56d32000-02-08 00:47:55 +0000315 fprintf(stderr, _("\tUsing %s\n"),
Theodore Ts'o5c576471997-04-29 15:29:49 +0000316 error_message(EXT2_ET_BASE));
317 exit(0);
Theodore Ts'o80c22c92000-08-14 15:32:11 +0000318 case 'x':
Theodore Ts'oa5f0bb92001-12-02 19:29:35 +0100319 num_format = "0x%04x";
Theodore Ts'o80c22c92000-08-14 15:32:11 +0000320 break;
Theodore Ts'of3db3561997-04-26 13:34:30 +0000321 default:
Theodore Ts'o818180c1998-06-27 05:11:14 +0000322 usage();
Theodore Ts'of3db3561997-04-26 13:34:30 +0000323 }
324 }
325 if (optind > argc - 1)
Theodore Ts'o818180c1998-06-27 05:11:14 +0000326 usage();
Theodore Ts'o0655b102001-12-21 23:59:46 -0500327 sprintf(range_format, "%s-%s", num_format, num_format);
Theodore Ts'of3db3561997-04-26 13:34:30 +0000328 device_name = argv[optind++];
Theodore Ts'o02e7dd91999-06-18 00:48:41 +0000329 if (use_superblock && !use_blocksize)
330 use_blocksize = 1024;
Theodore Ts'o16ed5b32001-01-16 07:47:31 +0000331 flags = EXT2_FLAG_JOURNAL_DEV_OK;
332 if (force)
333 flags |= EXT2_FLAG_FORCE;
Theodore Ts'o348e43d2001-05-03 14:43:43 +0000334 if (image_dump)
335 flags |= EXT2_FLAG_IMAGE_FILE;
336
Theodore Ts'o16ed5b32001-01-16 07:47:31 +0000337 retval = ext2fs_open (device_name, flags, use_superblock,
338 use_blocksize, unix_io_manager, &fs);
Theodore Ts'of3db3561997-04-26 13:34:30 +0000339 if (retval) {
Theodore Ts'od9c56d32000-02-08 00:47:55 +0000340 com_err (program_name, retval, _("while trying to open %s"),
Theodore Ts'o3839e651997-04-26 13:21:57 +0000341 device_name);
Theodore Ts'od9c56d32000-02-08 00:47:55 +0000342 printf (_("Couldn't find valid filesystem superblock.\n"));
Theodore Ts'o3839e651997-04-26 13:21:57 +0000343 exit (1);
344 }
Theodore Ts'of3db3561997-04-26 13:34:30 +0000345 if (print_badblocks) {
Theodore Ts'o0655b102001-12-21 23:59:46 -0500346 list_bad_blocks(fs, 1);
Theodore Ts'of3db3561997-04-26 13:34:30 +0000347 } else {
Theodore Ts'o27401561999-09-14 20:11:19 +0000348 big_endian = ((fs->flags & EXT2_FLAG_SWAP_BYTES) != 0);
Theodore Ts'ocbbf0312001-06-13 00:12:04 +0000349#ifdef WORDS_BIGENDIAN
350 big_endian = !big_endian;
351#endif
Theodore Ts'o27401561999-09-14 20:11:19 +0000352 if (big_endian)
Theodore Ts'od9c56d32000-02-08 00:47:55 +0000353 printf(_("Note: This is a byte-swapped filesystem\n"));
Theodore Ts'o27401561999-09-14 20:11:19 +0000354 list_super (fs->super);
Theodore Ts'o16ed5b32001-01-16 07:47:31 +0000355 if (fs->super->s_feature_incompat &
356 EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) {
357 print_journal_information(fs);
358 ext2fs_close(fs);
359 exit(0);
360 }
Theodore Ts'o0655b102001-12-21 23:59:46 -0500361 list_bad_blocks(fs, 0);
Theodore Ts'o27401561999-09-14 20:11:19 +0000362 if (header_only) {
363 ext2fs_close (fs);
364 exit (0);
365 }
Theodore Ts'of3db3561997-04-26 13:34:30 +0000366 retval = ext2fs_read_bitmaps (fs);
Theodore Ts'of3db3561997-04-26 13:34:30 +0000367 list_desc (fs);
Theodore Ts'od90a23e2002-10-25 17:07:11 -0400368 if (retval) {
369 printf(_("\n%s: %s: error reading bitmaps: %s\n"),
370 program_name, device_name,
371 error_message(retval));
372 }
Theodore Ts'o3839e651997-04-26 13:21:57 +0000373 }
Theodore Ts'o3839e651997-04-26 13:21:57 +0000374 ext2fs_close (fs);
375 exit (0);
376}