Re: [gentoo-user] /boot filesystem, SSDs, TRIM

2018-08-25 Thread Tom H
On Thu, Aug 23, 2018 at 2:54 PM Dale  wrote:


> Correct me if I'm wrong here, it used to be that grub, the original
> version not the current bloated one, had to have ext2.

The upstream version. Various distributions added ext4 support to
grub1 (circa 2009, IIRC). None of the patches were upstreamed because
grub1 development was closed.


> If I recall correctly, a ext4 file system can be *read* the same as
> ext2. The difference is the journal.

That's true for ext3. For ext4, you have to ensure that some
ext4-specific features are off for it to be read as if it were ext2.



Re: [gentoo-user] /boot filesystem, SSDs, TRIM

2018-08-25 Thread Tom H
On Thu, Aug 23, 2018 at 9:20 AM Canek Peláez Valdés  wrote:
> On Wed, Aug 22, 2018 at 10:58 PM Adam Carter  wrote:
>>
>> For a long time people recommended ext2 for /boot. The Gentoo wiki
>> still does. Is there any compelling reason to use ext2 for /boot (on
>> a system whose other filesystems are ext4) these days? AFAIK for
>> systems that have /boot on an SSD, ext4 makes more sense due to
>> discard support, and for non-SSD it doesn't matter either way. Have I
>> missed something?
>
> AFAIU, UEFI systems need a boot partition, and it has to be VFAT.

Only to use systemd-boot.

UEFI needs a VFAT ESP (EFI System Partition). For systemd-boot, the
ESP and "/boot" have to be the same because it cannot read other
filesystems, unlike grub, refind, and whatever other EFI boot
managers/loaders exist.



Re: [gentoo-user] /boot filesystem, SSDs, TRIM

2018-08-24 Thread malloc1337
Thus spoke Adam Carter (adamcart...@gmail.com):
> For a long time people recommended ext2 for /boot. The Gentoo wiki still
> does. Is there any compelling reason to use ext2 for /boot (on a system
> whose other filesystems are ext4) these days? AFAIK for systems that have
> /boot on an SSD, ext4 makes more sense due to discard support, and for
> non-SSD it doesn't matter either way. Have I missed something?

Why not just disable journaling on those partitions altogether?

# Delete has_journal option
tune2fs -O ^has_journal 

# Issue required fsck
e2fsck -f 

# Check fs options
dumpe2fs  | less
-- 
malloc1337

mailto: dis...@mm-no.de




Re: [gentoo-user] /boot filesystem, SSDs, TRIM

2018-08-23 Thread Walter Dnes
On Thu, Aug 23, 2018 at 06:53:14AM -0500, Dale wrote

> Correct me if I'm wrong here, it used to be that grub, the original
> version not the current bloated one, had to have ext2.  At the time,
> that was *the* file system.  If I recall correctly, a ext4 file system
> can be *read* the same as ext2.  The difference is the journal.  So,
> when booting, grub etc is only reading /boot and it shouldn't matter if
> it is ext2, ext3 or ext4.  It's only when being written to that it
> matters.  Am I recalling that right? 

  Actually ext3 is straight ext2+journal.  Ext4 can read ext2.  It may
be able to do small writes, but once it inserts its magic stuff, ext2
can't read it.

  BTW, I see that your system is inserting junk after periods.  Binary
view shows that where there should be 0x2E, it's 0x2E 0xA0

> Another one of those times where Linux provides a ton of options.  :/
> 
> Dale
> 
> :-)  :-) 

  And also after closing parentheses.  Should be 0x29, but is 0x29 0xA0.

-- 
Walter Dnes 
I don't run "desktop environments"; I run useful applications



Re: [gentoo-user] /boot filesystem, SSDs, TRIM

2018-08-23 Thread malloc1337
Thus spoke Adam Carter (adamcart...@gmail.com):
> >
> > Or is it possible to turn off journaling for one partition under ext4?
> >
> 
> My intuition is that the long term damage due to the journal would be far
> less than the damage due to the loss of effective wear levelling that would
> result from not being able to TRIM. Just intuition tho. Let me know if i'm
> misunderstanding something.


Why not just disable journaling on those partitions altogether?

# Delete has_journal option
tune2fs -O ^has_journal 

# Issue required fsck
e2fsck -f 

# Check fs options
dumpe2fs  | less

-- 
malloc1337

mailto: dis...@mm-no.de




Re: [gentoo-user] /boot filesystem, SSDs, TRIM

2018-08-23 Thread Peter Humphrey
On Thursday, 23 August 2018 12:14:49 BST Adam Carter wrote:
> [from Neil Bothwick:]
> > The other question is why use GRUB on a modern system? UEFI boot
> > managers are far simpler to work with than GRUBs monster configuration 
file and
> > in that case it makes sense to combine /boot with the ESP and use VFAT 
for it.
> 
> I couldn't grok the Gentoo UEFI setup instructions before loosing patience
> with them. That's weak, so I will try again.

I haven't been able to reconcile the Wiki with all the other docs out there,
including other Gentoo docs. I finished up with this:

# parted -l /dev/nvme0n1
Model: Unknown (unknown)
Disk /dev/nvme0n1: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End SizeFile system NameFlags
 1  1049kB  3146kB  2097kB  uefibios_grub
 2  3146kB  2147MB  2144MB  fat32   bootboot, esp
 3  2147MB  4295MB  2147MB  linux-swap(v1)  swap
 4  4295MB  19.3GB  15.0GB  ext4rescuesys
 5  19.3GB  36.5GB  17.2GB  ext4gentooroot
--->8

> man mount shows that discard/TRIM is supported by linux vfat driver, as
> vfat also supports all the fat mount options.

I've found that fstrim only works on my VFAT /boot if it's been mounted 
during boot. If it's set to noauto in fstab, and then mounted with
-odiscard, fstrim complains that "discard is not supported"

-- 
Regards,
Peter.






Re: [gentoo-user] /boot filesystem, SSDs, TRIM

2018-08-23 Thread Dale
Neil Bothwick wrote:
> On Thu, 23 Aug 2018 06:01:18 +0100, Klaus Ethgen wrote:
>
>> The question should be if and why to use /boot at all on modern systems.
>>
>> Grub is able to boot from various system combinations. btrfs, lvm,
>> mdraid, even encrypted disks (however, in the last case, it is not that
>> trivial to install grub).
> The other question is why use GRUB on a modern system? UEFI boot managers
> are far simpler to work with than GRUBs monster configuration file and in
> that case it makes sense to combine /boot with the ESP and use VFAT for
> it.
>
> As for the original question, AIUI ext2 was recommended more because there
> was no need for ext3/4 and journalling on such a small filesystem, rather
> than there being any compelling reason for not using ext4, so use what
> you want.
>
>


Correct me if I'm wrong here, it used to be that grub, the original
version not the current bloated one, had to have ext2.  At the time,
that was *the* file system.  If I recall correctly, a ext4 file system
can be *read* the same as ext2.  The difference is the journal.  So,
when booting, grub etc is only reading /boot and it shouldn't matter if
it is ext2, ext3 or ext4.  It's only when being written to that it
matters.  Am I recalling that right? 

Another one of those times where Linux provides a ton of options.  :/

Dale

:-)  :-) 



Re: [gentoo-user] /boot filesystem, SSDs, TRIM

2018-08-23 Thread Adam Carter
>
> The other question is why use GRUB on a modern system? UEFI boot managers
> are far simpler to work with than GRUBs monster configuration file and in
> that case it makes sense to combine /boot with the ESP and use VFAT for
> it.
>

I couldn't grok the Gentoo UEFI setup instructions before loosing patience
with them. That's weak, so I will try again.

man mount shows that discard/TRIM is supported by linux vfat driver, as
vfat also supports all the fat mount options.


Re: [gentoo-user] /boot filesystem, SSDs, TRIM

2018-08-23 Thread Adam Carter
>
>   How often are you writing to /boot anyways?  Journalling is of little
> benefit in that case, and imposes more wear+tear on SSD drives.  Or is
> it possible to turn off journaling for one partition under ext4?
>

I review the Changlog on every point release and update the kernel if
there's anything I find interesting. From the file dates this seems to be
about 3 times a month.

My intuition is that the long term damage due to the journal would be far
less than the damage due to the loss of effective wear levelling that would
result from not being able to TRIM. Just intuition tho. Let me know if i'm
misunderstanding something.


Re: [gentoo-user] /boot filesystem, SSDs, TRIM

2018-08-23 Thread Neil Bothwick
On Thu, 23 Aug 2018 06:01:18 +0100, Klaus Ethgen wrote:

> The question should be if and why to use /boot at all on modern systems.
> 
> Grub is able to boot from various system combinations. btrfs, lvm,
> mdraid, even encrypted disks (however, in the last case, it is not that
> trivial to install grub).

The other question is why use GRUB on a modern system? UEFI boot managers
are far simpler to work with than GRUBs monster configuration file and in
that case it makes sense to combine /boot with the ESP and use VFAT for
it.

As for the original question, AIUI ext2 was recommended more because there
was no need for ext3/4 and journalling on such a small filesystem, rather
than there being any compelling reason for not using ext4, so use what
you want.


-- 
Neil Bothwick

Microbiology: staph only.


pgp3w4iHF2CqL.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] /boot filesystem, SSDs, TRIM

2018-08-23 Thread Canek Peláez Valdés
On Wed, Aug 22, 2018 at 10:58 PM Adam Carter  wrote:
>
> For a long time people recommended ext2 for /boot. The Gentoo wiki still
does. Is there any compelling reason to use ext2 for /boot (on a system
whose other filesystems are ext4) these days? AFAIK for systems that have
/boot on an SSD, ext4 makes more sense due to discard support, and for
non-SSD it doesn't matter either way. Have I missed something?

AFAIU, UEFI systems need a boot partition, and it has to be VFAT. Most
motherboards support a "legacy mode" to boot using the MBR; but it will
eventually go away, and good riddance; UEFI is so much easier and saner to
use.

Regards.
--
Dr. Canek Peláez Valdés
Profesor de Carrera Asociado C
Departamento de Matemáticas
Facultad de Ciencias
Universidad Nacional Autónoma de México


Re: [gentoo-user] /boot filesystem, SSDs, TRIM

2018-08-22 Thread Klaus Ethgen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

The question should be if and why to use /boot at all on modern systems.

Grub is able to boot from various system combinations. btrfs, lvm,
mdraid, even encrypted disks (however, in the last case, it is not that
trivial to install grub).

So for me there is little to no usage for /boot at all.

Regards
   Klaus
- -- 
Klaus Ethgen   http://www.ethgen.ch/
pub  4096R/4E20AF1C 2011-05-16Klaus Ethgen 
Fingerprint: 85D4 CA42 952C 949B 1753  62B3 79D0 B06F 4E20 AF1C
-BEGIN PGP SIGNATURE-
Comment: Charset: ISO-8859-1

iQGzBAEBCgAdFiEEMWF28vh4/UMJJLQEpnwKsYAZ9qwFAlt+P5cACgkQpnwKsYAZ
9qwjuwv9FQaqKiCI7p5rQ+vOFPhfNqM+MbuqcXkyCWxZ+0NyT5+vkRP5TVJTSQA6
p68XdAtHGTAJdBmKxzsXE3wM0Shp6SnhpQJ/QCol/5U+97Ud5O+3GI3fVrFzudXl
qFO31VIizc1jK670sibjcBk8gbUu2Swiz2/2tg1dHpeaJLSKwDQIs7PhoSqiEwOo
Oeexh1OLHDQTLJAMASp4cSWxWH9tsNq+OZBrDI2LKHXvFB668CSnCyQE8JM2OSQF
1XRJQ75rFNVUqdL/EERMF/Q9IrRdQD8Cy2RR6uXTul/2UQBPDogOBgPqzPYXzwy/
SxrAsYNiLGucB4lt5tyLro0IYuBY3pLWB1InJ6W0eAcw1NCgFvOtCjWvTneFhnIN
CHdBl1kLJJLFZp8nstR0U4cBhmcyKJB76hGpAxqNgO3J1rmIPKAmTGvRc4gRaQV5
lbfI5dVi19DvbAgzsF1QBd3F737gIsHu5Cluusp/JMdNa7dq+BC519EYZM2MAgK2
2bjVz2G0
=uyTR
-END PGP SIGNATURE-



Re: [gentoo-user] /boot filesystem, SSDs, TRIM

2018-08-22 Thread Walter Dnes
On Thu, Aug 23, 2018 at 01:58:19PM +1000, Adam Carter wrote
> For a long time people recommended ext2 for /boot. The Gentoo wiki still
> does. Is there any compelling reason to use ext2 for /boot (on a system
> whose other filesystems are ext4) these days? AFAIK for systems that have
> /boot on an SSD, ext4 makes more sense due to discard support, and for
> non-SSD it doesn't matter either way. Have I missed something?

  How often are you writing to /boot anyways?  Journalling is of little
benefit in that case, and imposes more wear+tear on SSD drives.  Or is
it possible to turn off journaling for one partition under ext4?

-- 
Walter Dnes 
I don't run "desktop environments"; I run useful applications