Gentoo Archives: gentoo-amd64

From: Beso <givemesugarr@×××××.com>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] Re: Disable fsck on boot, was: How to make watchdog start earlier during bootup?
Date: Thu, 22 Jan 2009 19:06:25
Message-Id: d257c3560901221106n3f1180a2wde394d8cb9537ad2@mail.gmail.com
In Reply to: Re: [gentoo-amd64] Re: Disable fsck on boot, was: How to make watchdog start earlier during bootup? by The Doctor
1 2009/1/22 The Doctor <drwho@××××××××.net>:
2 > Duncan wrote:
3 >
4 >>> and, if you have experiences with it, do you know what could happen
5 >>> without fsck on an unsafely unmounted luks partition?
6 >>
7 >> Luks I know nothing of. Someday when I get the appropriate round tuit...
8 >
9 > I just gave it a try with a 32 megabyte SD card on my laptop. I set up
10 > the LUKS volume like so:
11 >
12 > root@windbringer ~:# cryptsetup -v -y -c aes-cbc-essiv:sha256 luksFormat
13 > /dev/mmcblk0p1
14 >
15 > ...opened it:
16 >
17 > root@windbringer ~:# cryptsetup luksOpen /dev/mmcblk0p1 test
18 >
19 > ...but I wasn't able to create a ReiserFS file system:
20 >
21 > root@windbringer ~:# mkreiserfs -d /dev/mapper/test
22 >
23 > [credits from mkreiserfs snipped]
24 >
25 > Guessing about desired format.. Kernel 2.6.28 is running.
26 > reiserfs_create_journal: cannot create a journal of 8193 blocks with 18
27 > offset on 7456 blocks
28 >
29 > Oops. Too small a device, I guess. So, I tried EXT3:
30 >
31 > root@windbringer ~:# mkfs.ext3 -c -L test -v /dev/mapper/test
32 > ...
33 > root@windbringer ~:# mount /dev/mapper/test /mnt/disk_image
34 >
35 > To see what would happen, I copied a load of .jpg files over to the card
36 > so there would be a test data set:
37 >
38 > root@windbringer ~:# cp ~drwho/*.jpg /mnt/disk_image
39 >
40 > Then I yanked the SD card out of the slot without unmounting it or
41 > running the luksClose command of cryptsetup. Much to my surprise,
42 > nothing complained about it. Upon reinserting it, however, the
43 > following appeared in the kernel message buffer:
44 >
45 > ...
46 > mmc0: card cb93 removed
47 > Buffer I/O error on device dm-3, logical block 539
48 > lost page write due to I/O error on dm-3
49 > Aborting journal on device dm-3.
50 > Buffer I/O error on device dm-3, logical block 369
51 > lost page write due to I/O error on dm-3
52 > journal commit I/O error
53 > mmc0: new SD card at address cb93
54 > mmcblk1: mmc0:cb93 S032B 29.6 MiB
55 > mmcblk1: p1
56 >
57 > Nautilus prompted me to enter the LUKS passphrase to open the device;
58 > checking the kernel message buffer showed that the journal recovery was
59 > complete, and the volume could be properly read. I checked the files
60 > and none of them were corrupted. Next test: delete a few files, don't
61 > run sync(1), yank the card, and try again. Kernel output:
62 >
63 > ...
64 > mmc0: card cb93 removed
65 > Buffer I/O error on device dm-4, logical block 419
66 > lost page write due to I/O error on dm-4
67 > Aborting journal on device dm-4.
68 > Buffer I/O error on device dm-4, logical block 369
69 > lost page write due to I/O error on dm-4
70 > journal commit I/O error
71 > ext3_abort called.
72 > EXT3-fs error (device dm-4): ext3_put_super: Couldn't clean up the journal
73 > Remounting filesystem read-only
74 >
75 > After plugging the card back in:
76 >
77 > ...
78 > mmc0: new SD card at address cb93
79 > mmcblk1: mmc0:cb93 S032B 29.6 MiB
80 > mmcblk1: p1
81 > kjournald starting. Commit interval 5 seconds
82 > EXT3 FS on dm-4, internal journal
83 > EXT3-fs: recovery complete.
84 > EXT3-fs: mounted filesystem with ordered data mode.
85 >
86 > The deletions that took place before I pulled the card seemed to stay
87 > deleted when the journal was replayed. I did this four more times to
88 > see what would happen, and I didn't encounter any file system corruption.
89 >
90 > I haven't tried any other file systems yet, but if there is sufficient
91 > interest I'll start walking through the contents of `cat
92 > /proc/filesystems | grep -v ^nodev`
93 >
94 these tests seem pretty promising. i'll try out using my old 1gb usb
95 key as testing mule is i'll
96 have enough time this week-end and let you know about happenings.
97
98 --
99 dott. ing. beso