Improving Ubuntu 16.04 with an F2FS root filesystem:
F2FS offers major benefits and advantages over other filesystems when used on a flash device like an SSD.
Ubuntu has had the ability to read F2FS for quite some time (12.04), but the provided installers (even 16.04) don't have F2FS modules loaded;
One caot select F2FS partitions as an install destination even if they are created beforehand...
Thankfully, we can still use an F2FS root without too much effort, we just need the keel to load the f2fs module at boot, then point grub to an f2fs partition.
There may be other ways to accomplish this, but I was not able to find any working solutions via Google-fu.
Start the ubuntu installer normally,
At the selection for install destination, select 'Something else', then manually partition:
sda1 /boot 512MB ext4
sda2 /swap 8GB (Whatever ram size is)
sda3 DNU 10GB RAW (prevents you having to move it or have a gap later when you delete the ext4 partition)
sda4 / 10GB ext4
If you have a separate disk installed:
sda1 /boot 512MB ext4
sda2 /swap 8GB
sda3 DNU Rest of drive space
sdb1 / 10GB ext4
If you have a separate disk, be sure to adjust the mount points listed below.
Complete the installation normally, then reboot
Editing the grub defaults is optional, but if you mess up somewhere you'll be able to see where things went kerfuffle.
leaving the splash and quiet options on mean you'll only see the error and not what was happening before it.
Open (alt+f2, gksudo gnome-terminal) or switch to a terminal (Ctrl+F1-F5, F6 retus to GUI)
Code:
sudo gedit /etc/default/grub
GRUB_DEFAULT=0
Code:
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
Code:
GRUB_TIMEOUT=3
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="text"
GRUB_CMDLINE_LINUX=""
Code:
GRUB_GFXMODE=1366x768x32
Code:
GRUB_TERMINAL=console
Code:
update-grub
now we install f2fs and setup the module in initramfs
The next two lines prepare the current installation to boot a F2FS root.
We want to do this before we copy the installation to the F2FS root.
Without the f2fs module, grub will fail to mount the f2fs partition, leaving you stuck at an initramfs prompt.
Update apt's sources, then install f2fs-tools and gparted
Code:
sudo apt update && sudo apt install f2fs-tools gparted
Code:
sudo echo f2fs >> /etc/initramfs-tools/modules && sudo update-initramfs -u
sudo reboot
Code:
sudo gparted
Code:
sudo gedit /etc/fstab
Code:
/ f2fs rw,relatime,background_gc=on,user_xattr,acl,active_logs=6 0 0
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda4 during installation
#UUID=71f42e33-6984-4905-9932-17cd4adb7b41 / ext4 errors=remount-ro 0 1
UUID=84e54b79-8671-4acb-9dbc-f89b17667cf6 / f2fs rw,relatime,background_gc=on,user_xattr,acl,active_logs=6 0 0
# swap was on /dev/sda2 during installation
UUID=0a3b409b-f7bf-4a22-a05f-0dc35e1bb111 none swap sw 0 0
We can't update-grub yet because the f2fs partition is still empty; grub-probe will ignore it for obvious reasons.
So, we need to copy the current root to the new f2fs root;
Reboot to Live USB/CD
switch to a terminal.
make dirs and mount our stuff to them
Code:
sudo mkdir /media/ext4
sudo mkdir /media/f2fs
sudo mount /dev/sda4 /media/ext4
sudo mount /dev/sda3 /media/f2fs
Code:
sudo cp -a /media/ext4/* /media/f2fs
Code:
sudo mkdir /media/f2fs
sudo mount /dev/sda3 /media/f2fs
sudo mount /dev/sda1 /media/f2fs/boot
sudo mount --bind /dev /media/f2fs/dev
sudo mount --bind /proc /media/f2fs/proc
sudo mount --bind /sys /media/f2fs/sys
sudo chroot /media/f2fs
Code:
update-grub
If you're feeling saucy, delete the ext4 partition in gparted and run update-grub inside the chroot again.
This removes uecessary entries in the grub menu.
Exit the chroot, make sure to cross those stubby fingers.
Code:
exit umount /media/f2fs/*
Code:
sudo reboot
if you reboot and end up at an initramfs prompt with the following error:
Target filesystem doesn't have requested /sbin/init.
No init found. Try passing init=bootarg.
Check to be sure you are
installing f2fs, and apt is not failing for whatever reason
inserting f2fs into /etc/initramfs-tools/modules
inserting the new UUID and options into /etc/fstab
ruing update-grub from chroot after copying the installation to sda3
برچسب:
نویسنده: استخدام کار