Results 1 to 6 of 6

Thread: [HOW-TO] Install/migrate Ubuntu on F2FS

  1. #1
    Join Date
    Jan 2013
    Beans
    33

    Exclamation [HOW-TO] Install/migrate Ubuntu on F2FS

    So, it's my first tutorial on ubuntuforums!
    Samsung's F2FS was introduced at 05 October 2012 and merged into Linux at version 3.8. Its generally developed for NAND based systems, like smartphones and computers with ssd.
    After almost 2 years of the announcement, theres still no support in Ubuntu Installer.

    So, first of all, its better if you will make a clear install and/or make a backup from your existing system.

    Trusty has an updated util-linux package since 22-09-2014!
    Ignore add-apt step if the output is at least 2.25 for the followint terminal command:

    Code:
    blkid -v
    ---IGNORE---

    If you are running from the LiveCD/USB(this package will go to the installed system too) or a working system, install one of the newer package of util-linux from Ivan Larinov's PPA:

    Code:
    sudo add-apt-repository ppa:xeron-oskom/util-linux
    Update your repos:

    Code:
    sudo apt-get update
    If you get error, you should modify the distro value to "trusty"!

    Install the util-linux(currently 2.25) and f2fs-tools, gparted packages. Just the "newerthan2.20util-linux" is able to get the uuid at F2FS partition. I use Ivan's repo, works like charm!

    Code:
    sudo apt-get install util-linux --reinstall
    ---IGNORE---

    Code:
    sudo apt-get install f2fs-tools gparted


    Install the system (ignore this step if you have a working one), you must have a separated EXT2/3/4 (i have EXT2 and 200MB) boot partition and a normal ROOT (I had a 32GB EXT4, but it could be anything)!

    Boot you fresh distro, and add the f2fs module to intramfs: add "f2fs" after the #(in a new row at the end of the text file).

    Code:
    sudo gedit /etc/initramfs-tools/modules
    Update your initramfs

    Code:
    sudo update-initramfs -u
    Now your distro is able to boot any F2F2 partition. You can check it with adding an F2FS entry at the fstab. (Ignore this step if you want to have you f2fs system ASAP)

    Make a new partition at gparted, format with f2fs file-system(for this you must have f2fs-tools) and add a new line to the fstab:

    Code:
    UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx     /media/f2fs             f2fs          rw,relatime,background_gc=on,user_xattr,acl,active_logs=6    0 0
    You can get the UUID at gparted or run the blkid as root, make sure you have the /media/f2fs directory!

    Now start another distro or a live system and copy your existing system to somewhere, mostly i use ramdisk for that kind of procedures. Gparted, util-linux(blkid) 2.25 and f2fs-tools are helpful!

    Code:
    sudo mkdir /media/ext4
    sudo mount /dev/sdxx /media/ext4
    sudo cp -a /media/ext4/* /media/ramdisk
    After the partition save, unmount the volume at gparted.
    Format you ex-root partition with gparted to f2fs file-system and check for the UUID(double click on the freshly-formatted f2fs system or run blkid as root).

    Mount, than copy the already f2fs capable system.

    Code:
    sudo mkdir /media/f2fs
    sudo mount /dev/sdx /media/f2fs
    sudo cp -a /media/ramdisk/* /media/f2fs
    Check your mounted f2fs directory, maybe you have to cut-paste the content to the root of the /media/f2fs partiton.

    So probably, now you have a f2fs formatted partition with a bootable system, now you have to edit the fstab

    Code:
    sudo gedit /media/f2fs/etc/fstab
    Writeover the existing / row with the following one:

    Code:
    Code:
    UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx     /            f2fs          rw,relatime,background_gc=on,user_xattr,acl,active_logs=6    0 0
    Its a normal, fstab entry from a working arch. Later you can edit the options, now just replace the UUID "double click on the freshly-formatted f2fs system or run blkid as root" as we did.

    After you already format, than copy the partition and edited the fstab, just have to update the boot partition.
    Mostly i use chroot for this, but first mount the boot volume too!

    Code:
    sudo mount /dev/sdx /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
    Now you have chrooted the F2FS system, just update the grub:

    Code:
    sudo update-grub
    Probably, you will able to boot up your F2FS powered Ubuntu now. Dont worry, maybe one(many) or you grub options have gone, but after the F2FS system boots, rerun the update-grub command.

    After this very crazy-safe tutor, i hope i dont miswrite any of the rows, and many of you(us) will happy to use the F2FS powered system.
    In generally the system boot feels to have the same speed as a tweaked EXT4(on my Samsung 840 non-EVO 120GB drive), but forex: the Libreoffice loads faster !
    f2fs.jpg
    Last edited by vinibali; October 22nd, 2014 at 10:41 PM. Reason: update

  2. #2
    Join Date
    Apr 2006
    Beans
    62
    Distro
    Ubuntu Gnome 16.04 Xenial Xerus

    Re: [HOW-TO] Install/migrate Ubuntu on F2FS

    Good job!

    Don't forget to sustain the ticket to add F2FS support to the Ubuntu installer: https://bugs.launchpad.net/ubuntu/+s...y/+bug/1261175

  3. #3
    Join Date
    Jan 2013
    Beans
    33

    Re: [HOW-TO] Install/migrate Ubuntu on F2FS

    post updated, util-linux 2.25 on the way

  4. #4
    Join Date
    Jan 2013
    Beans
    33

    Re: [HOW-TO] Install/migrate Ubuntu on F2FS

    post updated, fine tunes

  5. #5
    Join Date
    May 2010
    Beans
    73
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: [HOW-TO] Install/migrate Ubuntu on F2FS

    Thanks to this guide I've successfully installed Lubuntu with f2fs; but now I got a problem when update the kernel to 3.19.0-20 from 3.19.0-15

    on 3.19.0-15 Lubuntu boots fine, but from3.19.0-20 it drops me on busybox with initramfs.

    I've run sudo update-initramfs -u (which shows only "update-initramfs: Generating /boot/initrd.img-3.19.0-20-generic" without any errors) but problem seems to persist
    What if someday login in your facebook account you're required to accept yet-another-update license agreement saying you're a total idiot? Quit Facebook, join Diaspora*
    my webcomics ~ my diasp*

  6. #6
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: [HOW-TO] Install/migrate Ubuntu on F2FS

    This has nothing to do with wily.Closed

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •