SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
As I am running F2FS for / on my SSD, I am quite pleased at the performance, but now I just have a question and that is about TRIM. As of now I am just running a default setup, and no special parameters in fstab for /. Has anyone tried the TRIM feature, or is that redundant with F2FS, or is there any sort of recommended parameters for further optimizing F2FS?
I noticed you added noatime for swap, so maybe I will add that for mine since swap is also on my SSD. I will not add it for / for F2FS yet until I get more information; and the manual for mkfs.f2fs does not even reference it. So far I have had one unscheduled shutdown (power loss), and when the system came back up, I didn't get any errors or any issues.
I do have a boot ext4 on my SSD obviously, since f2fs just does not support booting from it (yet - who knows if Samsung will add such a feature), but then again, I can just perhaps opt to comment out "/dev/sda1 /boot ext4 " anyways, so then it becomes a moot point in adding noatime if it is not mounted.
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,097
Rep:
Quote:
Originally Posted by Jeebizz
......I do have a boot ext4 on my SSD obviously, since f2fs just does not support booting from it (yet - who knows if Samsung will add such a feature),.....
Is this particular to Samsung?
I know lilo cannot boot a f2fs partition, but grub shouldn't have problem with a SSD.
IIRC, this has all been discussed before and, again, IIRC, f2fs will trim itself automatically when it senses the system is idle. I don't remember if you have to be logged on as root for that to happen.
Is this particular to Samsung?
I know lilo cannot boot a f2fs partition, but grub shouldn't have problem with a SSD.
IIRC, this has all been discussed before and, again, IIRC, f2fs will trim itself automatically when it senses the system is idle. I don't remember if you have to be logged on as root for that to happen.
Unfortunately I just am not well versed with GRUB; I tried setting up GRUB on a VM of Slackware15, and ended up with a non-bootable VM ; which is also why I am hoping Pat might consider adding the option to have the installer setup GRUB when you are installing Slackware.
As for LILO, I remember opening a thread about not being able to boot from F2FS, and it seems LILO and F2FS just do not play nice, and I haven't bothered and just assumed GRUB would have the same issue. As I am also using my main machine I am not prepared to experiment with GRUB and F2FS, but maybe when I have more time I will try in a VM.
I confirm that GRUB handles f2fs without issues. I just needed to modify rc.S to check the root fs periodically (but not at every boot). GRUB also handles btrfs as root fs, including with sub-volumes and on a crypted device and no dedicated partition for boot, but I digress.
This being said, as long that you use an ext4 fs and boot in Legacy mode, lilo fits the bill
Last edited by Didier Spaier; 06-09-2022 at 12:25 PM.
I confirm that GRUB handles f2fs without issues. I just needed to modify rc.S to check the root fs periodically (but not at every boot). GRUB also handles btrfs as root fs, including with sub-volumes and on a crypted device and no dedicated partition for boot, but I digress.
This being said, as long that you use an ext4 fs and boot in Legacy mode, lilo fits the bill
Ah so I retract my statement about Samsung, I was wrong - LILO just doesn't play nice with F2FS, and yes the workaround (separate /boot partition with any other FS (except for XFS too, since I think LILO doesn't play nice with that either)); and yes I do use legacy, and so I have no need for UEFI , which is another moot point if I did use UEFI, I would have a fat32 EFI partition for boot.
if I did use UEFI, I would have a fat32 EFI partition for boot.
To be picky: to store the EFI OS loader, not mounted on /boot but usually on /boot/efi (but you may choose another mount point, you just need to tell GRUB which it is as argument of the --efi-directory option of grub-install.
Further it can stay unmounted and mounted only if you want to reinstall GRUB (but this is not necessary to just update the GRUB config file like following a kernel update or installation of another OS as it is not stored in the EFI partition but (usually) in /boot/grub).
To be picky: to store the EFI OS loader, not mounted on /boot but usually on /boot/efi (but you may choose another mount point, you just need to tell GRUB which it is as argument of the --efi-directory option of grub-install.
Further it can stay unmounted and mounted only if you want to reinstall GRUB (but this is not necessary to just update the GRUB config file like following a kernel update or installation of another OS as it is not stored in the EFI partition but (usually) in /boot/grub).
I dunno, either way I am not planning to use GRUB anytime soon. Just like reading the documentation for encrypted luks on Slackware, my eyes glaze over. I already found out anyways that I can comment out the boot partition in fstab and my system still boots just fine (LILO).
These habits are from 2011 so maybe they're no longer necessary ???
I'm curious about this too. It's difficult to say. I've been using SSD's since about 2009, and back then it was very important to use/enable trim(discard) for SSD's. Until about 2013ish, ssd's were not that common. But after about 2015 they became quite common.
In any case, I'm pretty sure the Kernel generally knows if a disk is SSD or not, so would it not at some point automatically enable trim? There are even pure SSD drivers like nvme, and I would find it a bit strange if trim is not enabled automatically for them.
I've not used trim the last 4-5 years now, generally speaking, and once in awhile I come over articles or other stuff that mentions using trim, and I'm like dang, perhaps I need to use it. So anyways, I've been doing it manually a few times like you show.
I'm curious about this too. It's difficult to say. I've been using SSD's since about 2009, and back then it was very important to use/enable trim(discard) for SSD's. Until about 2013ish, ssd's were not that common. But after about 2015 they became quite common.
In any case, I'm pretty sure the Kernel generally knows if a disk is SSD or not, so would it not at some point automatically enable trim? There are even pure SSD drivers like nvme, and I would find it a bit strange if trim is not enabled automatically for them.
I've not used trim the last 4-5 years now, generally speaking, and once in awhile I come over articles or other stuff that mentions using trim, and I'm like dang, perhaps I need to use it. So anyways, I've been doing it manually a few times like you show.
My rationale about this; while you can use technically any FS; the problem with ext* btrfs, xfs, jfs - is that they were developed mostly when conventional drives were still mostly in play; and flash/NAND devices were an after thought with adding of TRIM. This is also why I pushed during the requests for --Current to have at least F2FS added for install support. I kinda also wish we had JFFS / JFFS2 support for comparison too; but I'll take what I can get and just use F2FS; since it is written from-the-ground-up for SSDs. With that in mind, this was the purpose of this thread - is TRIM even necessary at this point if I am using a FS that is purposed for a NAND device?
-edit
So basically, is TRIM redundant / pointless when using F2FS?
With that in mind, this was the purpose of this thread - is TRIM even necessary at this point if I am using a FS that is purposed for a NAND device?
I hadn't even heard of F2FS before this thread. But from what I know trim is actually a command to the disk to use trim, if it is supported. And if it is included in F2FS, then there is probably a reason for it.
Many things can get optimized for SSD compared to HD, and trim is just one of those things, but technically it isn't a software/FS solution, as far as I understand.
This kind of ties in with trim in general. I've heard alot of he said, she said about trim, and that it basically became redundant as a command (discard) in GNU/Linux when SSD's became popular. That's because the disks themselves would use trim anyways, or some such, and that it was no longer necessary, in most cases, to send a command to the disk to use trim.
And well, these days SSD's are more popular than HD's I think, at least for private individuals and alot has changed in the Kernel too meanwhile. But I don't know if the Kernel sends a message to the disk to use trim if it know that it has support for it. Let's say for a device that use the NVME driver in the Kernel.
But then again, wouldn't trim actually cause more writes to the disk? (which is probably part of what F2FS solves)
Bwah, by the end of the day, it all seems unclear to me.
Quote:
Originally Posted by Jeebizz
which is also why I am hoping Pat might consider adding the option to have the installer setup GRUB when you are installing Slackware.
If he hasn't done it thus far, it seems unlikely he will do it
I hadn't even heard of F2FS before this thread. But from what I know trim is actually a command to the disk to use trim, if it is supported. And if it is included in F2FS, then there is probably a reason for it.
Many things can get optimized for SSD compared to HD, and trim is just one of those things, but technically it isn't a software/FS solution, as far as I understand.
This kind of ties in with trim in general. I've heard alot of he said, she said about trim, and that it basically became redundant as a command (discard) in GNU/Linux when SSD's became popular. That's because the disks themselves would use trim anyways, or some such, and that it was no longer necessary, in most cases, to send a command to the disk to use trim.
And well, these days SSD's are more popular than HD's I think, at least for private individuals and alot has changed in the Kernel too meanwhile. But I don't know if the Kernel sends a message to the disk to use trim if it know that it has support for it. Let's say for a device that use the NVME driver in the Kernel.
But then again, wouldn't trim actually cause more writes to the disk? (which is probably part of what F2FS solves)
Bwah, by the end of the day, it all seems unclear to me.
Ah yes, I also forgot about discard so I suppose now I should append my question: "Is discard/trim redundant when using F2FS" ?
As I understand it F2FS benefit the most to flash devices like SD cards or eMMC drives. Not surprisingly as it has been initially used mainly on SD cards in mobile phones, cf. https://lkml.org/lkml/2012/10/5/205. Caveat: I have seen reports of damaged file systems in case of sudden loss of power as noted in: https://wiki.archlinux.org/title/F2FS For this reason this is the default when installing Slint64-14.2.1 in "auto" mode only if the device name as reported by lsblk includes "mmc", which tells us that this device is either an SD card inserted in a card reader (i.e. not in an USB enclosure) or an eMMC storage device. This avoid the risk of loss of power caused by an inadvertent un-plugging. In Slint 15 we will probably used BTRFS everywhere if installing in "auto" mode, but I digress ("auto" here means that the installer partition the drives and make the file systems.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.