суббота, 26 марта 2016 г.

Enabling G-Journal in FreeBSD

Example 1

First of all, login to your system.
Then look at your fstab file and find a partition to enable geom journal on. Note that it is impossible to enable journal for the root / file system.
I am going to enable journal for the partition of the /var directory located on the ada0p4 geom.

First of all I check if the gjournal kernel module is loaded. If it is not loaded, I add it to the loader configuration (/boot/loader.conf) and load it.
Then I add a new partition for journal provider.
You can see that ada0s6 will become the journal provider.

To enable journaling for a partition you should make sure that the partition is not mounted. If it is mounted, you should to unmount it:
# umount -f /var/
and enable journaling using the next command:
# gjournal label -f ada0p4 ada0s6
where ada0p4 is a data provider and ada0s6 is a journal provider.
After journaling is enabled you should edit the fstab file.
For example if your data provider geom was ada0p4, you should replace its device with /dev/ada0p4.journal. You also should use asynchronous mounting for journaled partition using the async option.
After that you should to disable soft updates for the partition and tune its file system to set gjournal.
This was the last stepping stone to enable journaling for the partition, so you may mount it back now.

Example 2

The full geom journal enabling typescript may look like this.
$ su
# gpart add -t freebsd -a 4k ada0
# umount -f /usr/
# gjournal label -f ada0p5 ada0p7
# cp /etc/fstab /etc/fstab.old
# ed
e e /etc/fstab
e 5c
e /dev/ada0p5    /usr    ufs    rw,async    2    2
e .
e w
e q
# tunefs -J enable -n disable /dev/ada0p5.journal
# mount /usr/

Continue reading -> Bootstrapping package manager.

Комментариев нет:

Отправить комментарий