Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

setup journaling for root partition

30 views
Skip to first unread message

s m

unread,
May 21, 2013, 1:59:54 AM5/21/13
to
hello everybody

i want to setup a journal partition for my root partition. but i do not
know how to do that. in FreeBSD handbook, it is done in single user mode,
unmount the desired partition and assign the journal partition to it. i
test this procedure and it is done for /usr partition but for root
partition, it can not be unmount in single user mode.

i try to do it in fixiit mode, but i can not load gjournal.

do i use gpart to partitioning my system and enable journaling for root
partition? isn't there any way to setup journaling for my existing root
partition? which command should be used (or is better to used) to enable
journaling? tunefs, gjournal or newfs?

please help me to setup a journal partition for my root.
thanks in advance
SAM
_______________________________________________
freebsd-...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"

Michael Sierchio

unread,
May 21, 2013, 2:06:18 AM5/21/13
to
On Mon, May 20, 2013 at 10:59 PM, s m <sam.g...@gmail.com> wrote:

> hello everybody
>
> i want to setup a journal partition for my root partition. but i do not
> know how to do that. in FreeBSD handbook, it is done in single user mode,
> unmount the desired partition and assign the journal partition to it. i
> test this procedure and it is done for /usr partition but for root
> partition, it can not be unmount in single user mode.
>
>
See the man page on gjournal

To configure journaling on the UFS file system using gjournal, one
should
first create a gjournal provider using the gjournal utility, then run
newfs(8) or tunefs(8) on it with the -J flag which instructs UFS to
coop-
erate with the gjournal provider below.

s m

unread,
May 21, 2013, 5:24:27 AM5/21/13
to
thanks Michael

this is what i've done (based on the FreeBSD handbook): creating a
partition for journal, go to single user mode, unmount desired partition
(for example /usr), load gjournal, add journal partition to /usr partition.
this procedure works well for user and other partitions except root because
i can not unmount it.

should i set up journaling in fixit mode with gpart? how? i try different
ways but none of them work for me:((

Julien Cigar

unread,
May 21, 2013, 5:39:36 AM5/21/13
to
gjournal should not be used anymore as it has been implemented in the
file system code ...
--
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.

s m

unread,
May 21, 2013, 6:10:34 AM5/21/13
to
you mean that journaling is enabled by default???? i don't think so. i
think i misunderstanding. may i ask you to explain it more clear?
>>> ______________________________**_________________
>> freebsd-...@freebsd.org mailing list
>> http://lists.freebsd.org/**mailman/listinfo/freebsd-**questions<http://lists.freebsd.org/mailman/listinfo/freebsd-questions>
>> To unsubscribe, send any mail to "freebsd-questions-**
>> unsub...@freebsd.org <freebsd-questi...@freebsd.org>"
>>
>
>
> --
> No trees were killed in the creation of this message.
> However, many electrons were terribly inconvenienced.
>
> ______________________________**_________________
> freebsd-...@freebsd.org mailing list
> http://lists.freebsd.org/**mailman/listinfo/freebsd-**questions<http://lists.freebsd.org/mailman/listinfo/freebsd-questions>
> To unsubscribe, send any mail to "freebsd-questions-**
> unsub...@freebsd.org <freebsd-questi...@freebsd.org>"

Julien Cigar

unread,
May 21, 2013, 6:40:17 AM5/21/13
to
On 05/21/2013 12:10, s m wrote:
> you mean that journaling is enabled by default???? i don't think so. i
> think i misunderstanding. may i ask you to explain it more clear?
>

gjournal is journaling through GEOM. Since Freebsd 9 soft-updates
journaling has been implemented for UFS. So if you want journaling for
an UFS FS there is no reason to use gjournal anymore. (check manpages of
newfs and/or tunefs and the "-j" and the "-J" flags)

>
> On Tue, May 21, 2013 at 2:09 PM, Julien Cigar <jci...@ulb.ac.be
> <mailto:jci...@ulb.ac.be>> wrote:
>
> gjournal should not be used anymore as it has been implemented in
> the file system code ...
>
>
> On 05/21/2013 11:24, s m wrote:
>
> thanks Michael
>
> this is what i've done (based on the FreeBSD handbook): creating a
> partition for journal, go to single user mode, unmount desired
> partition
> (for example /usr), load gjournal, add journal partition to
> /usr partition.
> this procedure works well for user and other partitions except
> root because
> i can not unmount it.
>
> should i set up journaling in fixit mode with gpart? how? i
> try different
> ways but none of them work for me:((
>
>
>
> On Tue, May 21, 2013 at 10:36 AM, Michael Sierchio
> <ku...@tenebras.com <mailto:ku...@tenebras.com>>wrote:
>
> On Mon, May 20, 2013 at 10:59 PM, s m
> <sam.g...@gmail.com <mailto:sam.g...@gmail.com>> wrote:
>
> hello everybody
>
> i want to setup a journal partition for my root
> partition. but i do not
> know how to do that. in FreeBSD handbook, it is done
> in single user mode,
> unmount the desired partition and assign the journal
> partition to it. i
> test this procedure and it is done for /usr partition
> but for root
> partition, it can not be unmount in single user mode.
>
>
> See the man page on gjournal
>
> To configure journaling on the UFS file system using
> gjournal, one
> should
> first create a gjournal provider using the gjournal
> utility, then run
> newfs(8) or tunefs(8) on it with the -J flag which
> instructs UFS to
> coop-
> erate with the gjournal provider below.
>
>
>
> _______________________________________________
> freebsd-...@freebsd.org
> <mailto:freebsd-...@freebsd.org> mailing list
> <mailto:freebsd-questi...@freebsd.org>"
>
>
>
> --
> No trees were killed in the creation of this message.
> However, many electrons were terribly inconvenienced.
>
> _______________________________________________
> freebsd-...@freebsd.org
> <mailto:freebsd-...@freebsd.org> mailing list
> <mailto:freebsd-questi...@freebsd.org>"
>
>


--
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.

saeedeh motlagh

unread,
May 21, 2013, 7:43:34 AM5/21/13
to
thanks Julien, but i think it's not true. man page for newfs seys that
journaling is done via gjournal and in freebsd handbook it says do
journaling with gjournal for UFS file system.

you mean i should create a partition and just enable journaling for it with
-J flag?

i think my problem is, my gjournal can not act correctly in fixit mode
because i can load it in single user mode and every thing is ok but in
fixit mode, i can not load it and all commands return errors.

please help me to make a journal for my root:(((
>> <ku...@tenebras.com <mailto:ku...@tenebras.com>>**wrote:
>>
>>
>> On Mon, May 20, 2013 at 10:59 PM, s m
>> <sam.g...@gmail.com <mailto:sam.g...@gmail.com>> wrote:
>>
>> hello everybody
>>
>> i want to setup a journal partition for my root
>> partition. but i do not
>> know how to do that. in FreeBSD handbook, it is done
>> in single user mode,
>> unmount the desired partition and assign the journal
>> partition to it. i
>> test this procedure and it is done for /usr partition
>> but for root
>> partition, it can not be unmount in single user mode.
>>
>>
>> See the man page on gjournal
>>
>> To configure journaling on the UFS file system using
>> gjournal, one
>> should
>> first create a gjournal provider using the gjournal
>> utility, then run
>> newfs(8) or tunefs(8) on it with the -J flag which
>> instructs UFS to
>> coop-
>> erate with the gjournal provider below.
>>
>>
>>
>> ______________________________**_________________
>> freebsd-...@freebsd.org
>> <mailto:freebsd-questions@**freebsd.org<freebsd-...@freebsd.org>>
>> mailing list
>>
>> http://lists.freebsd.org/**mailman/listinfo/freebsd-**questions<http://lists.freebsd.org/mailman/listinfo/freebsd-questions>
>> To unsubscribe, send any mail to
>> "freebsd-questions-**unsub...@freebsd.org<freebsd-questi...@freebsd.org>
>> <mailto:freebsd-questions-**unsub...@freebsd.org<freebsd-questi...@freebsd.org>
>> >"
>>
>>
>>
>>
>> -- No trees were killed in the creation of this message.
>> However, many electrons were terribly inconvenienced.
>>
>> ______________________________**_________________
>> freebsd-...@freebsd.org
>> <mailto:freebsd-questions@**freebsd.org<freebsd-...@freebsd.org>>
>> mailing list
>>
>> http://lists.freebsd.org/**mailman/listinfo/freebsd-**questions<http://lists.freebsd.org/mailman/listinfo/freebsd-questions>
>> To unsubscribe, send any mail to
>> "freebsd-questions-**unsub...@freebsd.org<freebsd-questi...@freebsd.org>
>> <mailto:freebsd-questions-**unsub...@freebsd.org<freebsd-questi...@freebsd.org>
>> >"
>>
>>
>>
>
> --
> No trees were killed in the creation of this message.
> However, many electrons were terribly inconvenienced.
>
> ______________________________**_________________
> freebsd-...@freebsd.org mailing list
> http://lists.freebsd.org/**mailman/listinfo/freebsd-**questions<http://lists.freebsd.org/mailman/listinfo/freebsd-questions>
> To unsubscribe, send any mail to "freebsd-questions-**
> unsub...@freebsd.org <freebsd-questi...@freebsd.org>"
>



--
*Sa.M*

Mark Felder

unread,
May 21, 2013, 8:35:32 AM5/21/13
to
On Tue, 21 May 2013 06:43:34 -0500, saeedeh motlagh
<saeedeh...@gmail.com> wrote:

> thanks Julien, but i think it's not true. man page for newfs seys that
> journaling is done via gjournal and in freebsd handbook it says do
> journaling with gjournal for UFS file system.

No, he's right. It's generally not recommended to use gjournal anymore.
It's still supported for those that have existing implementations and want
to be able to update their FreeBSD install without breaking their
filesystems.

UFS' SUJ (soft updates journaling) is what you should be using.

Arthur Chance

unread,
May 21, 2013, 10:42:04 AM5/21/13
to
On 05/21/13 12:43, saeedeh motlagh wrote:
> thanks Julien, but i think it's not true. man page for newfs seys that
> journaling is done via gjournal and in freebsd handbook it says do
> journaling with gjournal for UFS file system.
>
> you mean i should create a partition and just enable journaling for it with
> -J flag?
>
> i think my problem is, my gjournal can not act correctly in fixit mode
> because i can load it in single user mode and every thing is ok but in
> fixit mode, i can not load it and all commands return errors.
>
> please help me to make a journal for my root:(((

Look more carefully at the newfs man page. Option -J (upper case) is
gjournal type journalling, option -j (lower case) is native UFS soft
update journalling. It's the latter one you want.

This is on RELEASE-9.1 though. What version are you on?

--
In the dungeons of Mordor, Sauron bred Orcs with LOLcats to create a
new race of servants. Called Uruk-Oh-Hai in the Black Speech, they
were cruel and delighted in torturing spelling and grammar.

_Lord of the Rings 2.0, the Web Edition_

Michael Sierchio

unread,
May 21, 2013, 10:46:22 AM5/21/13
to
AFAIK Softupdates journaling still breaks snapshot functionality - which
makes it unusable for me. I wouldn't assume that the O.P. doesn't want we
he's asking for.

- M


On Tue, May 21, 2013 at 7:42 AM, Arthur Chance <fre...@qeng-ho.org> wrote:

> On 05/21/13 12:43, saeedeh motlagh wrote:
>
>> thanks Julien, but i think it's not true. man page for newfs seys that
>> journaling is done via gjournal and in freebsd handbook it says do
>> journaling with gjournal for UFS file system.
>>
>> you mean i should create a partition and just enable journaling for it
>> with
>> -J flag?
>>
>> i think my problem is, my gjournal can not act correctly in fixit mode
>> because i can load it in single user mode and every thing is ok but in
>> fixit mode, i can not load it and all commands return errors.
>>
>> please help me to make a journal for my root:(((
>>
>
> Look more carefully at the newfs man page. Option -J (upper case) is
> gjournal type journalling, option -j (lower case) is native UFS soft update
> journalling. It's the latter one you want.
>
> This is on RELEASE-9.1 though. What version are you on?
>
> --
> In the dungeons of Mordor, Sauron bred Orcs with LOLcats to create a
> new race of servants. Called Uruk-Oh-Hai in the Black Speech, they
> were cruel and delighted in torturing spelling and grammar.
>
> _Lord of the Rings 2.0, the Web Edition_
>
> ______________________________**_________________
> freebsd-...@freebsd.org mailing list
> http://lists.freebsd.org/**mailman/listinfo/freebsd-**questions<http://lists.freebsd.org/mailman/listinfo/freebsd-questions>
> To unsubscribe, send any mail to "freebsd-questions-**
> unsub...@freebsd.org <freebsd-questi...@freebsd.org>"

Arthur Chance

unread,
May 21, 2013, 11:18:26 AM5/21/13
to
On 05/21/13 15:46, Michael Sierchio wrote:
> AFAIK Softupdates journaling still breaks snapshot functionality - which
> makes it unusable for me. I wouldn't assume that the O.P. doesn't want we
> he's asking for.

Good point, I'd forgotten that problem as I don't use UFS snapshots. I
can imagine it would be a killer for some people.

--
In the dungeons of Mordor, Sauron bred Orcs with LOLcats to create a
new race of servants. Called Uruk-Oh-Hai in the Black Speech, they
were cruel and delighted in torturing spelling and grammar.

_Lord of the Rings 2.0, the Web Edition_

Warren Block

unread,
May 21, 2013, 11:20:29 AM5/21/13
to
On Tue, 21 May 2013, Arthur Chance wrote:

> On 05/21/13 15:46, Michael Sierchio wrote:
>> AFAIK Softupdates journaling still breaks snapshot functionality - which
>> makes it unusable for me. I wouldn't assume that the O.P. doesn't want we
>> he's asking for.
>
> Good point, I'd forgotten that problem as I don't use UFS snapshots. I can
> imagine it would be a killer for some people.

It is, especially if you use dump/restore.

Michael Sierchio

unread,
May 21, 2013, 1:08:20 PM5/21/13
to
On Tue, May 21, 2013 at 8:20 AM, Warren Block <wbl...@wonkity.com> wrote:

On Tue, 21 May 2013, Arthur Chance wrote:
>
> On 05/21/13 15:46, Michael Sierchio wrote:
>>
>>> AFAIK Softupdates journaling still breaks snapshot functionality - which
>>> makes it unusable for me. I wouldn't assume that the O.P. doesn't want we
>>> he's asking for.
>>>
>>
>> Good point, I'd forgotten that problem as I don't use UFS snapshots. I
>> can imagine it would be a killer for some people.
>>
>
> It is, especially if you use dump/restore.
>

Or tarsnap (which is what we use for backups here), or... there are many
use cases for snapshots.

- M

s m

unread,
May 22, 2013, 1:14:45 AM5/22/13
to
thanks guys for your attentions.

i want to setup journaling in FreeBSD 8.2. i compare soft-update and
journaling and choose journaling (it is more suitable for my goals).

i want to enable journaling for all my partitions. i can do it for all
partitions except root in single user mode. i can not do it for root
because i can not unmount root in single user mode.
please let me know how set a journal provider for my root partition in
FreeBSD 8.2.
thank you so much

Michael Sierchio

unread,
May 22, 2013, 1:53:25 AM5/22/13
to
On Tue, May 21, 2013 at 10:14 PM, s m <sam.g...@gmail.com> wrote:

> thanks guys for your attentions.
>
> i want to setup journaling in FreeBSD 8.2. i compare soft-update and
> journaling and choose journaling (it is more suitable for my goals).
>
> i want to enable journaling for all my partitions. i can do it for all
> partitions except root in single user mode. i can not do it for root
> because i can not unmount root in single user mode.
>
>
No, but you don't need to. In single user mode, root is mounted read-only.
You can run tunefs on the root fs device.

s m

unread,
May 23, 2013, 1:27:50 AM5/23/13
to
thanks Michael, but in all documentation about journaling, tunefs is used
as below: "tunefs -J enable ad3s1X.journal". ad3s1X.journal is created by
gjournal command: "gjournal label ad3s1a ad3s1g" that assign ad3s1g as
journal provider for ad3s1a and create ad3s1a.journal which contains ad3s1a
as data provider and ad3s1g as journal provider.

my problem is, i can not run gjournal command for root partition in fixit
mode nor single user mode. you mean, i should just use tunefs command on
ad3s1X (root partition)? if yes, then where journal provider for root
partition is located? in root partition?

Michael Sierchio

unread,
May 23, 2013, 1:42:19 AM5/23/13
to
On Wed, May 22, 2013 at 10:27 PM, s m <sam.g...@gmail.com> wrote:

> thanks Michael, but in all documentation about journaling, tunefs is used
> as below: "tunefs -J enable ad3s1X.journal". ad3s1X.journal is created by
> gjournal command: "gjournal label ad3s1a ad3s1g" that assign ad3s1g as
> journal provider for ad3s1a and create ad3s1a.journal which contains ad3s1a
> as data provider and ad3s1g as journal provider.
>
> my problem is, i can not run gjournal command for root partition in fixit
> mode nor single user mode. you mean, i should just use tunefs command on
> ad3s1X (root partition)? if yes, then where journal provider for root
> partition is located? in root partition?
>
>
Ah, sorry - lack of careful reading on my part. Can you boot from
installation media and use the fixit mode? This still won't work if the
last sector of the partition is in use by the filesystem.... You'll need a
spare partition of some size to be the journal provider, as in the example.

The very best approach is to create a gjournal and then newfs. How is your
disk organized? One big root partition with everything on it?

s m

unread,
May 23, 2013, 1:53:47 AM5/23/13
to
thanks Michael for your quick reply:)
yes, i can boot from usb freebsd flash and use fixit mode.
i have root, var, tmp, usr and swap on my system. i create an extra swap
partition to use it as journal provider for root partition.

in fixit mode, first i run two below command in order to abel load gjournal:

ln -s /dist/lib /lib
ls -s /dist/boot/kernel /boot/modules

then
"gjournal load"

and after that: "gjournal label -f ad3s1a ad3s1g" (ad3s1a is root partition
and ad3s1g is swap partition for journal provider)

but this error is shown:
"gjournal cannot clear metadata on ad3s1a: operation not permitted"
what is wrong here??? i really don't know how to fix it:((((

Michael Sierchio

unread,
May 23, 2013, 2:11:48 AM5/23/13
to
On Wed, May 22, 2013 at 10:53 PM, s m <sam.g...@gmail.com> wrote:

> thanks Michael for your quick reply:)
> yes, i can boot from usb freebsd flash and use fixit mode.
> i have root, var, tmp, usr and swap on my system. i create an extra swap
> partition to use it as journal provider for root partition.
>
> in fixit mode, first i run two below command in order to abel load
> gjournal:
>
> ln -s /dist/lib /lib
> ls -s /dist/boot/kernel /boot/modules
>
> then
> "gjournal load"
>
> and after that: "gjournal label -f ad3s1a ad3s1g" (ad3s1a is root
> partition and ad3s1g is swap partition for journal provider)
>
> but this error is shown:
> "gjournal cannot clear metadata on ad3s1a: operation not permitted"
> what is wrong here??? i really don't know how to fix it:((((
>

Try using -v to get more verbose output. I am at a loss here, too.
Perhaps you can try

gjournal load
dd if=/dev/zero of=/dev/ad3s1g bs=1m
gjournal clear -v ad3s1a
gjournal label -vf ad3s1a ad3s1g

and see what it says, if anything.

s m

unread,
May 23, 2013, 2:36:51 AM5/23/13
to
thanks,

i do as you said, but after loading gjournal, dd says "operation not
permitted".
gjournal clear says "operation not permitted" too and therefore "gjournal
label" is not done and say previous error (gjournal cannot clear metadata
on ad3s1a: operation not permitted). and -v return no extra log.

i don't know why i can not do any thing in fixit mode:(

is this a true procedure? i mean maybe i should do any thing else because
freebsd handbook set journaling for user partition in single user mode not
in fixit mode. i test it and it works well, but for root partition i can
not do the same because root partition can not be unmount in single user
mode.

any hints or comments are really appreciated.
thanks in advance

Torsten Hantzsche

unread,
May 23, 2013, 6:13:13 AM5/23/13
to
On Thu, 23 May 2013, s m wrote:


> thanks,
>
> i do as you said, but after loading gjournal, dd says "operation not
> permitted".
> gjournal clear says "operation not permitted" too and therefore "gjournal
> label" is not done and say previous error (gjournal cannot clear metadata
> on ad3s1a: operation not permitted). and -v return no extra log.
>
> i don't know why i can not do any thing in fixit mode:(
>
> is this a true procedure? i mean maybe i should do any thing else because
> freebsd handbook set journaling for user partition in single user mode not
> in fixit mode. i test it and it works well, but for root partition i can
> not do the same because root partition can not be unmount in single user
> mode.
>
> any hints or comments are really appreciated.
> thanks in advance
>

Hi,

i remember having similar error messages with glabel some years ago.
The solution was found in "man 4 geom" in section DIAGNOSTICS:

I had to set "kern.geom.debugflags=0x10" to enable the "foot shooting" mode.

Maybe this could help you too?


Torsten

RW

unread,
May 23, 2013, 7:04:44 AM5/23/13
to
On Thu, 23 May 2013 09:57:50 +0430
s m wrote:


> my problem is, i can not run gjournal command for root partition in
> fixit mode nor single user mode.

Just to check, you did boot into single user mode rather than shut-down
into single user mode?

s m

unread,
May 23, 2013, 7:44:07 AM5/23/13
to
thanks Torsten but it can't help me:((

and RW, yes i can boot to single user mode, but i can't do anything
there!!! i mean when i run command "gjournal label -f ad3s1a ad3s1g" some
errors returned and all my partition disappear!!!!!!

what do you do if you want to set a journal partition for your root
partition? can you tell me step by step to compare it with my steps?

i really don't know how to set a journal partition for my root:(( i think
it is so simple but it make me busy more than a week:(

Warren Block

unread,
May 23, 2013, 7:53:48 AM5/23/13
to
On Thu, 23 May 2013, Torsten Hantzsche wrote:

> On Thu, 23 May 2013, s m wrote:
>
>
>> thanks,
>>
>> i do as you said, but after loading gjournal, dd says "operation not
>> permitted".
>> gjournal clear says "operation not permitted" too and therefore "gjournal
>> label" is not done and say previous error (gjournal cannot clear metadata
>> on ad3s1a: operation not permitted). and -v return no extra log.
>>
>> i don't know why i can not do any thing in fixit mode:(
>>
>> is this a true procedure? i mean maybe i should do any thing else because
>> freebsd handbook set journaling for user partition in single user mode not
>> in fixit mode. i test it and it works well, but for root partition i can
>> not do the same because root partition can not be unmount in single user
>> mode.
>>
>> any hints or comments are really appreciated.
>> thanks in advance
>>
>
> Hi,
>
> i remember having similar error messages with glabel some years ago.
> The solution was found in "man 4 geom" in section DIAGNOSTICS:
>
> I had to set "kern.geom.debugflags=0x10" to enable the "foot shooting" mode.
>
> Maybe this could help you too?

For certain values of "help". :)

If geom won't let you write to part of a disk, it's because it thinks
that part of the disk is already in use, usually by a mounted
filesystem. Overwriting part of a filesystem is not guaranteed to lose
data. But why take the chance?

Better to boot from mfsBSD (http://mfsbsd.vx.sk/). Possibly better yet
to use SUJ, which can be enabled with tunefs with the root partition
mounted read-only in single user mode. SUJ has its own problems,
though.

s m

unread,
May 25, 2013, 1:51:36 AM5/25/13
to
thanks Warren, you're right but i want to set journaling in fixit
mode!!!! in fixit mode none of my partitions are mounted (mount
command show no partition) but geom returns error yet.

is there any way to tell geom that my partitions are unmounted?

Adam Vande More

unread,
Jun 3, 2013, 10:18:58 PM6/3/13
to
On Tue, May 21, 2013 at 9:46 AM, Michael Sierchio <ku...@tenebras.com> wrote:
> AFAIK Softupdates journaling still breaks snapshot functionality - which
> makes it unusable for me. I wouldn't assume that the O.P. doesn't want we
> he's asking for.

Fixed awhile ago unless there is new bug on that. Haven't tried.

http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/161674


--
Adam Vande More
0 new messages