View previous topic :: View next topic |
Author |
Message |
Lokesh Apprentice
Joined: 01 Apr 2012 Posts: 161
|
Posted: Thu Aug 17, 2017 1:35 pm Post subject: GRUB2 and F2FS root partition |
|
|
Hello again,
I would like to try the F2FS for my root partition. There are both vigorous opponents and convinced supporters of the file system around. I would like to find out for myself whether this is something worth or not.
However, I could not find out how to make the system bootable. There is a Funtoo and an Arch howto available, both of which seem to me not applicable because of using their specific scripts. Else I did not find a good description.
What I did:
1) partitioned in such a way that /boot resides on a ext4 partition Code: | cat /etc/fstab
# <fs> <mountpoint> <type> <opts> <dump/pass>
# boot Partition
UUID="667a24ab-88af-4cbc-b72c-2752997b8b86" /boot ext4 rw,noatime 0 1
# efi Partition
UUID="B05A-EACF" /boot/efi vfat umask=0077,noatime 0 0
# Root
UUID="9e97f1a8-9b6e-4ac8-8836-758dd18e58a3" / f2fs error=remount-ro,noatime 0 0 | 2. activated the kernels for F2FS Code: | cat /boot/config-4.12.5-gentoo |grep F2FS
CONFIG_F2FS_FS=y
CONFIG_F2FS_STAT_FS=y
CONFIG_F2FS_FS_XATTR=y
CONFIG_F2FS_FS_POSIX_ACL=y
CONFIG_F2FS_FS_SECURITY=y
# CONFIG_F2FS_CHECK_FS is not set
# CONFIG_F2FS_FS_ENCRYPTION is not set
# CONFIG_F2FS_FAULT_INJECTION is not set
| 3. Updated Grub using grub-mkconfig -o /boot/grb/grub.cfg
This gives me an error from the os-prober complaining about an unknown file system. It does recognise Gentoo though, and the vmlinuz file in the boot directory. The grub command line should however mention a line with rootfs=F2FS, which is not the case, see here last post. Code: | GRUB_DISTRIBUTOR="Gentoo"
# Default menu entry
#GRUB_DEFAULT=0
...
....
# Append parameters to the linux kernel command line
#GRUB_CMDLINE_LINUX=""
#
# Examples:
#
# Boot with network interface renaming disabled
# GRUB_CMDLINE_LINUX="net.ifnames=0"
#
# Boot with systemd instead of sysvinit (openrc)
# GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd"
# Append parameters to the linux kernel command line for non-recovery entries
#GRUB_CMDLINE_LINUX_DEFAULT="" |
Please do not advise against using F2FS, this is my playground. All I want is to learn how to install it.
Thanks
Lokesh _________________ Sometimes frustrated Linux User
Last edited by Lokesh on Fri Aug 18, 2017 7:45 am; edited 1 time in total |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
Posted: Thu Aug 17, 2017 3:22 pm Post subject: Re: Howto install on F2FS partition needed |
|
|
Lokesh wrote: | 3. Updated Grub using grub-mkconfig -o /boot/grb/grub.cfg
This gives me an error from the os-prober complaining about an unknown file system. It does recognise Gentoo though, and the vmlinuz file in the boot directory. The grub command line should however mention a line with rootfs=F2FS, which is not the case, see here last post. |
If you do not need an initramfs and grub makes trouble, try without grub. EFI stub kernel is fairly simple and once your computer's UEFI setup provides something to create a boot entry you can even forget about efibootmgr. |
|
Back to top |
|
|
Lokesh Apprentice
Joined: 01 Apr 2012 Posts: 161
|
Posted: Thu Aug 17, 2017 3:53 pm Post subject: |
|
|
According to the Arch Wiki Grub should work. There are a couple of examples also on this forum, but unfortunately they did not describe their setup in detail.
I will look into your links, but I am really curious to see how it works with Grub. _________________ Sometimes frustrated Linux User |
|
Back to top |
|
|
Lokesh Apprentice
Joined: 01 Apr 2012 Posts: 161
|
Posted: Thu Aug 17, 2017 3:55 pm Post subject: |
|
|
Jaglover wrote: | So grub-mkconfig -o /boot/grb/grub.cfg is failing. Any reason you can't set up your grub.cfg by hand? | I don't think it is predominantly a grub issue, something else "beforehand" is missing, I believe. _________________ Sometimes frustrated Linux User |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
Posted: Thu Aug 17, 2017 4:11 pm Post subject: |
|
|
Lokesh wrote: | I don't think it is predominantly a grub issue, something else "beforehand" is missing, I believe. |
Can your system be booted from sysresccd instead from your own kernel?
What in detail have you done to solve this? |
|
Back to top |
|
|
Skinjob2707 n00b
Joined: 07 Aug 2013 Posts: 57
|
Posted: Thu Aug 17, 2017 4:57 pm Post subject: |
|
|
I'm currently using f2fs as the root partition on my system. Here are the relevant lines in my /etc/fstab file:
Code: | UUID=a1344e58-5322-419c-9cc7-5d0d4c3bed75 / f2fs rw,noatime 1 2
UUID=3BA3-17EC /boot vfat rw,noatime 1 2
|
Here is the fdisk -l output from my bootable m2 drive:
Code: | Disk /dev/sda: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8DA04DB9-EAB4-4D3F-85DE-2CEDB82BB84E
Device Start End Sectors Size Type
/dev/sda1 2048 6143 4096 2M BIOS boot
/dev/sda2 6144 268287 262144 128M EFI System
/dev/sda3 268288 500117503 499849216 238.4G Linux filesystem
|
|
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Thu Aug 17, 2017 5:32 pm Post subject: |
|
|
Lokesh wrote: | Jaglover wrote: | So grub-mkconfig -o /boot/grb/grub.cfg is failing. Any reason you can't set up your grub.cfg by hand? | I don't think it is predominantly a grub issue, something else "beforehand" is missing, I believe. |
And that would be completely irrelevant if your goal is to boot your system. Of course, if you are out there to troubleshoot Grub automated scripts then you have to dig into it. _________________ My Gentoo installation notes.
Please learn how to denote units correctly! |
|
Back to top |
|
|
Lokesh Apprentice
Joined: 01 Apr 2012 Posts: 161
|
Posted: Fri Aug 18, 2017 5:37 am Post subject: |
|
|
charles17 wrote: | What in detail have you done to solve this? | That is probably the cause for the trouble. As mentionend in my initial post, a line should appear in grub saying "root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx". It does not. In the Arch wiki it is said, oddly enough: you might have to manually edit /boot/grub/grub.cfg. I think the edit should be rather made to /etc/default/grub.
Question 1: correct?
Question 2: how? _________________ Sometimes frustrated Linux User
Last edited by Lokesh on Fri Aug 18, 2017 5:41 am; edited 1 time in total |
|
Back to top |
|
|
Lokesh Apprentice
Joined: 01 Apr 2012 Posts: 161
|
Posted: Fri Aug 18, 2017 5:40 am Post subject: |
|
|
Skinjob2707 wrote: | I'm currently using f2fs as the root partition on my system. | Hello Skinjob2707, can you post your /etc/default/grub please? _________________ Sometimes frustrated Linux User |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Fri Aug 18, 2017 6:06 am Post subject: |
|
|
I think you need rootfstype=f2fs on the boot line. Can't offer any advice about GRUB, but since your /boot is already ext4 other bootloaders would probably have a good chance of working. |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
Posted: Fri Aug 18, 2017 6:26 am Post subject: |
|
|
Lokesh wrote: | Question 1: correct? | Wrong. It is about /boot/grub/grub.cfg
Lokesh wrote: | Question 2: how? | Please check wiki.gentoo.org or upstream for grub2 documentation.
Lokesh wrote: | Code: | cat /etc/fstab
# <fs> <mountpoint> <type> <opts> <dump/pass>
# boot Partition
UUID="667a24ab-88af-4cbc-b72c-2752997b8b86" /boot ext4 rw,noatime 0 1
# efi Partition
UUID="B05A-EACF" /boot/efi vfat umask=0077,noatime 0 0
...
... |
|
What is the reason for using such strange construction?
If the /boot/efi is - a directory on the /boot partition, the efi partition can be mounted only if /boot is mounted
- a path on the / (Root) partition, the efi partition gets inaccessible when /boot gets mounted
P.S.:
For getting answers here, you'd better adjust the topic to "Need help with GRUB2" or so. |
|
Back to top |
|
|
Lokesh Apprentice
Joined: 01 Apr 2012 Posts: 161
|
Posted: Fri Aug 18, 2017 7:44 am Post subject: |
|
|
charles17 wrote: | What is the reason for using such strange construction? |
The ESP needs a Fat32 partition. The boot partition must not be F2FS because it cannot be read from at boot time. In my view only 2 options:
1. a FAT32 partition mounted to /boot, including the efi directory
OR
2. a non-FAT32 boot partition plus a FAT32-partition mounted to /boot/efi. Normally (i.e. when using ext4 for the root partition), my /boot is ext4, residing on the same partition as /.
Skinjob2707 opted for 1. (if he is using GPT/EFI), me 2. Why is it strange? _________________ Sometimes frustrated Linux User |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
Posted: Fri Aug 18, 2017 8:00 am Post subject: |
|
|
Maybe »strange« is the wrong wording. In fact is makes things more complicated as for any manipulation in the ESP you have to check the mount situation very carefully. And, the additional /boot partition is superfluous as any boot stuff could go into the ESP. |
|
Back to top |
|
|
Lokesh Apprentice
Joined: 01 Apr 2012 Posts: 161
|
Posted: Fri Aug 18, 2017 8:20 am Post subject: |
|
|
Skinjob2707 wrote: | I'm currently using f2fs as the root partition on my system. | Just saw that you had the very same problem a few months ago. How did you go on with the patches you were mentioning. Are they required? _________________ Sometimes frustrated Linux User |
|
Back to top |
|
|
Skinjob2707 n00b
Joined: 07 Aug 2013 Posts: 57
|
Posted: Fri Aug 18, 2017 12:16 pm Post subject: |
|
|
My issue was that I hadn't included the generic SCSI driver in the kernel. Since it was only compiled a module, the kernel couldn't access the drive at all. Once I built the kernel to include the SCSI/AHCI drivers, everything worked. The file system was irrelevant.
Here is the contents of /etc/default/grub:
Code: | # Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
# 'grub2-mkconfig -o /boot/grub/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.
GRUB_DISTRIBUTOR="Gentoo"
# Default menu entry
#GRUB_DEFAULT=0
# Boot the default entry this many seconds after the menu is displayed
#GRUB_TIMEOUT=5
#GRUB_TIMEOUT_STYLE=menu
# Append parameters to the linux kernel command line
GRUB_CMDLINE_LINUX="rootfstype=f2fs init=/usr/lib/systemd/systemd"
#
# Examples:
#
# Boot with network interface renaming disabled
# GRUB_CMDLINE_LINUX="net.ifnames=0"
#
# Boot with systemd instead of sysvinit (openrc)
# GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd"
# Append parameters to the linux kernel command line for non-recovery entries
#GRUB_CMDLINE_LINUX_DEFAULT=""
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal.
# Note that you can use only modes which your graphic card supports via VBE.
# You can see them in real GRUB with the command `vbeinfo'.
#GRUB_GFXMODE=640x480
# Set to 'text' to force the Linux kernel to boot in normal text
# mode, 'keep' to preserve the graphics mode set using
# 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular
# graphics mode, or a sequence of these separated by commas or
# semicolons to try several modes in sequence.
#GRUB_GFXPAYLOAD_LINUX=
# Path to theme spec txt file.
# The starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub/themes/starfield/theme.txt"
# Background image used on graphical terminal.
# Can be in various bitmap formats.
#GRUB_BACKGROUND="/boot/grub/mybackground.png"
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
GRUB_DISABLE_LINUX_UUID=false
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY=true
# Uncomment to disable generation of the submenu and put all choices on
# the top-level menu.
# Besides the visual affect of no sub menu, this makes navigation of the
# menu easier for a user who can't see the screen.
#GRUB_DISABLE_SUBMENU=y
# Uncomment to play a tone when the main menu is displayed.
# This is useful, for example, to allow users who can't see the screen
# to know when they can make a choice on the menu.
#GRUB_INIT_TUNE="60 800 1"
|
|
|
Back to top |
|
|
n05ph3r42 Tux's lil' helper
Joined: 11 Jul 2016 Posts: 134
|
Posted: Sun Aug 20, 2017 2:53 pm Post subject: |
|
|
Hi. Everything workls like a charm, since 2k14. Using grub, parted and f2fs-tools.
Here is my config.
Code: | # parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: ATA Samsung SSD 840 (scsi)
Disk /dev/sda: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 4194kB 3146kB bios_grub bios_grub
2 4194kB 32.0GB 32.0GB msftdata
3 32.0GB 32.1GB 128MB ext4 boot boot, esp
4 32.1GB 200GB 168GB rootfs msftdata
5 200GB 216GB 16.0GB linux-swap(v1) swap msftdata
|
Have no idea what magic line you talking about:
Code: |
# cat /boot/grub/grub.cfg | grep root=
set root='hd0,gpt3'
linux /vmlinuz-4.12.8-gentoo root=/dev/sda4 ro
set root='hd0,gpt3'
linux /vmlinuz-4.12.8-gentoo root=/dev/sda4 ro
set root='hd0,gpt3'
linux /vmlinuz-4.12.8-gentoo root=/dev/sda4 ro single
set root='hd0,gpt3'
linux /vmlinuz-4.12.6-gentoo root=/dev/sda4 ro
set root='hd0,gpt3'
linux /vmlinuz-4.12.6-gentoo root=/dev/sda4 ro single
set root='hd0,gpt3'
linux /vmlinuz-4.12.5-gentoo root=/dev/sda4 ro
set root='hd0,gpt3'
linux /vmlinuz-4.12.5-gentoo root=/dev/sda4 ro single
set root='hd0,gpt3'
linux /vmlinuz-4.12.4-gentoo root=/dev/sda4 ro
set root='hd0,gpt3'
linux /vmlinuz-4.12.4-gentoo root=/dev/sda4 ro single
set root='hd0,gpt3'
linux /vmlinuz-4.12.2-gentoo root=/dev/sda4 ro
set root='hd0,gpt3'
linux /vmlinuz-4.12.2-gentoo root=/dev/sda4 ro single
set root='hd0,gpt3'
linux /vmlinuz-4.12.0-gentoo root=/dev/sda4 ro
set root='hd0,gpt3'
linux /vmlinuz-4.12.0-gentoo root=/dev/sda4 ro single
|
Code: | # cat /etc/fstab
# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed); notail increases performance of ReiserFS (at the expense of storage
# efficiency). It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
# <fs> <mountpoint> <type> <opts> <dump/pass>
# SDD
#/dev/sda3
UUID="f941dbff-8dff-4c06-b6dd-5fb31c540be5" /boot ext4 discard,noatime 1 2
#/dev/sda4
UUID="f38fc996-aa88-4026-9e50-c3050f3031ba" / f2fs noatime 0 1
#/dev/sda5
UUID="bc7ee52a-e4cf-4c1d-b8e8-9457564c95b6" none swap sw 0 0
# zalman
# external hdd case
#/dev/sdb1
UUID="42E87FAD1EB1B231" /mnt/zalman_ntfs ntfs noatime,user,nofail,nobootwait 0 0
#/dev/sdb5
UUID="F0BF-9B80" /mnt/zalman_exfat exfat noatime,user,nofail,nobootwait 0 0
#/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
|
Code: |
# cat /boot/grub/grub.cfg | grep f2fs
# cat /boot/grub/grub.cfg | grep F2FS
|
Code: | # cat /usr/src/linux-4.12.8-gentoo/.config | grep F2FS
CONFIG_F2FS_FS=y
CONFIG_F2FS_STAT_FS=y
CONFIG_F2FS_FS_XATTR=y
CONFIG_F2FS_FS_POSIX_ACL=y
CONFIG_F2FS_FS_SECURITY=y
CONFIG_F2FS_CHECK_FS=y
# CONFIG_F2FS_FS_ENCRYPTION is not set
# CONFIG_F2FS_FAULT_INJECTION is not set
|
|
|
Back to top |
|
|
Lokesh Apprentice
Joined: 01 Apr 2012 Posts: 161
|
Posted: Mon Aug 21, 2017 6:36 pm Post subject: |
|
|
n05ph3r42 wrote: | Hi. Everything workls like a charm, since 2k14. Using grub, parted and f2fs-tools.
Here is my config. | Thank you, I will give it a try. As I see to it the differences, if any, are marginal. So I am setting up my system from scratch - maybe something has been done wrong - and use a slightly different partition scheme with both /boot and esp on a FAT32 formated partition.
Will report back hopefully tomorrow.
Lokesh _________________ Sometimes frustrated Linux User |
|
Back to top |
|
|
Lokesh Apprentice
Joined: 01 Apr 2012 Posts: 161
|
Posted: Thu Aug 24, 2017 10:44 am Post subject: |
|
|
Back again, it takes a lot of time to test this carefulley since it requires repeated installations of the entire system.
Thanks to the replies of n05ph3r42 and Skinjob2707 I suspected there is no magical treatment of grub required. I can confirm this now. I did two scenarios:
1.) ESP (efi system partition) and the /boot partion together on a single FAT32 partition which is mounted to /boot
2.) /boot as ext2 partition, mounted to /boot. ESP as FAT32 partition mounted to /boot/efi
Both installations worked without any particular modification to grub or anything else. Previously I installed the system onto the hard drive attached through usb to another Gentoo run system. This time I attached the hard drive to the internal SATA. Maybe the cause ....
The only annoying thing is a message cascade during boot (each line starting with "Info:"), which delays the boot proces for several seconds. These two guys here are having the same trouble, it does not seems to have any impact on the functionality though.
Do you, n05ph3r42 and Skinjob2707, see the same at startup?
Code: | * Checking local filesystems ...
Info: Fix the reported corruption.
Info: Mounted device!
Info: Check FS only due to RO
Info: sector size = 512
Info: total sectors = 209715200 (102400 MB) # this corresponds to my root partition
Info: MKFS version
"Linux version 4.12.5 (root@Gentoo) (gcc version 5.4..0 ...."
Info: FSCK version
from "Linux version 4.12.5-gentoo (root@archiso) (gcc version 5.4.0 (Gentoo .... # archiso was the starting OS on the thumb drive
to "Linux version 4.12.5-gentoo (root@archiso) (gcc version 5.4.0 (Gentoo ....
Info: superblock features = 0 :
...... # and so on for another 4 lines |
EDIT: for those who stumble across this : the a.m. delay at boot is the normal file system check, which seem to take much longer than on a ext4 file system. I turned it off by setting the last number in the correponding line for the root drive in my fstab to zero. Boot up is pretty fast, so I will stick to it.
Cheers
Lokesh _________________ Sometimes frustrated Linux User |
|
Back to top |
|
|
Massimo B. Veteran
Joined: 09 Feb 2005 Posts: 1771 Location: PB, Germany
|
Posted: Mon Nov 13, 2017 7:02 am Post subject: |
|
|
As my grub and initramfs is on a SD card, I'm looking for F2FS as well. Does grub support it today? Last thing I read about it, that it was planned for 2.02, which we have today:
https://www.phoronix.com/scan.php?page=news_item&px=F2FS-For-GRUB2
Concerning this it has not arrived yet: Code: | xzgrep -i f2fs /usr/share/doc/grub-2.02/NEWS.xz |
_________________ HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
|
|