FreeBSD 7.0: gjournal on root filesystem problems

Gabriel Lavoie glavoie at gmail.com
Sat Nov 1 16:16:13 PDT 2008


Hello,
     I'm currently making some test to know how to setup a new home
fileserver using two 500GB hard drives. I want to create a gmirror/gjournal
setup on the complete filesystem. I've been able to setup everything and it
works well. Now the problem I have is with the failure test. I create a file
with random data on the / filesystem using "dd" and while whe file is being
created, I hit the reset button of the computer. Now, it won't boot
anymore... I get the following message:

GEOM_MIRROR: Device mirror/gm launched (2/2)
GEOM_JOURNAL: Journal 3672855181: mirror/gma contains data.
GEOM_JOURNAL: Journal 3672855181: mirror/gma contains journal.
GEOM_JOURNAL: Journal 3868799910: mirror/gmd contains data.
GEOM_JOURNAL: Journal 3868799910: mirror/gmd contains journal.
GEOM_JOURNAL: Journal mirror/gmd consistent.
Trying to mount root from ufs:/dev/mirror/gma.journal

Manual root filesystem specification:
    <fstype>:<device>  Mount <device> using filesystem <fstype>
                                           eg. ufs:da0s1a
    ?                             List valid disk boot devices
    <empty line>          Abort manual input


mountroot> ?

List of GEOM managed disk devices:
     mirror/gmd.journal mirror/gmd mirror/gmc mirror/gma mirror/gm ad10s1c
ad10s1b ad8s1c ad8s1b ad10s2 ad10s1 ad8s1 ad10 ad8 acd0

If I boot on the FixIt CD and I try to mount the device, it tells me that it
isn't clean and that I must run fsck on it. I do it then I try to mount it
again, everything is now OK and now the system will boot again.

If I do the same thing on my /usr filesystem (writing random data then
reset), there is no problem. The difference is that the GEOM_JOURNAL
messages on boot tells me that the journal is consistent instead of clean.

When the journalized filesystem isn't clean, I also noticed that "gjournal
list" gives me the following line on the provider:

Mode: r0w0e0

instead of this line:

Mode: r1w1e1

Is it possible that the kernel becomes unable to mount the filesystem
read-only to access fsck then remount it read-write to boot the rest of the
system when this happens?

Here is my configuration. Take note that this setup isn't optimal and I'm
making it for testing purpose before making the real thing:

/etc/fstab:
# Device                Mountpoint      FStype  Options         Dump
Pass#
/dev/ad10s1b            none            swap    sw              0       0
/dev/ad8s1b             none            swap    sw              0       0
/dev/mirror/gma.journal /               ufs     rw,async        1       1
/dev/mirror/gmd.journal /usr            ufs     rw,async        2       2
/dev/acd0               /cdrom          cd9660  ro,noauto       0       0


/boot/loader.conf
geom_mirror_load="YES"
geom_journal_load="YES"


headless# gmirror status
     Name    Status  Components
mirror/gm  COMPLETE  ad8s2
                     ad10s2


headless# gmirror list
Geom name: gm
State: COMPLETE
Components: 2
Balance: split
Slice: 4096
Flags: NOFAILSYNC
GenID: 0
SyncID: 1
ID: 1602936318
Providers:
1. Name: mirror/gm
   Mediasize: 4293595648 (4.0G)
   Sectorsize: 512
   Mode: r2w2e3
Consumers:
1. Name: ad8s2
   Mediasize: 4293596160 (4.0G)
   Sectorsize: 512
   Mode: r1w1e1
   State: ACTIVE
   Priority: 0
   Flags: HARDCODED
   GenID: 0
   SyncID: 1
   ID: 2559388791
2. Name: ad10s2
   Mediasize: 4293596160 (4.0G)
   Sectorsize: 512
   Mode: r1w1e1
   State: ACTIVE
   Priority: 0
   Flags: HARDCODED
   GenID: 0
   SyncID: 1
   ID: 1481264275


headless# gjournal status
              Name  Status  Components
mirror/gma.journal     N/A  mirror/gma
mirror/gmd.journal     N/A  mirror/gmd


headless# gjournal list
Geom name: gjournal 3672855181
ID: 3672855181
Providers:
1. Name: mirror/gma.journal
   Mediasize: 1073741312 (1.0G)
   Sectorsize: 512
   Mode: r1w1e1
Consumers:
1. Name: mirror/gma
   Mediasize: 2147483648 (2.0G)
   Sectorsize: 512
   Mode: r1w1e1
   Jend: 2147483136
   Jstart: 1073741312
   Role: Data,Journal

Geom name: gjournal 3868799910
ID: 3868799910
Providers:
1. Name: mirror/gmd.journal
   Mediasize: 1072361472 (1.0G)
   Sectorsize: 512
   Mode: r1w1e1
Consumers:
1. Name: mirror/gmd
   Mediasize: 2146103808 (2.0G)
   Sectorsize: 512
   Mode: r1w1e1
   Jend: 2146103296
   Jstart: 1072361472
   Role: Data,Journal


headless# mount
/dev/mirror/gma.journal on / (ufs, asynchronous, local, gjournal)
devfs on /dev (devfs, local)
/dev/mirror/gmd.journal on /usr (ufs, asynchronous, local, gjournal)


Thanks

Gabriel Lavoie

-- 
Gabriel Lavoie
glavoie at gmail.com


More information about the freebsd-fs mailing list