On Sun, Apr 8, 2012 at 1:41 PM, Michael Mol <mike...@gmail.com> wrote:
> On Sun, Apr 8, 2012 at 2:21 PM, Canek Peláez Valdés <can...@gmail.com> wrote:
>> On Sun, Apr 8, 2012 at 11:44 AM,  <meino.cra...@gmx.de> wrote:
>>> Mick <michaelkintz...@gmail.com> [12-04-08 18:40]:
>>>> On Sunday 08 Apr 2012 16:56:23 David W Noon wrote:
>>>> > On Sun, 8 Apr 2012 17:26:03 +0200, meino.cra...@gmx.de wrote about
>>>> >
>>>> > [gentoo-user] Extended file attributes: ext4:
>>>> > > is it possible to go from an ext4-filesystem with no extended file
>>>> > > attributes to one with extended file attributes without reformatting
>>>> > > the disk or other very risky low level things just by adding this
>>>> > > feature to the kenrel (?) ?
>>>> >
>>>> > Yes, it's simple.
>>>> >
>>>> > You need to ensure that your kernel configuration has the extended
>>>> > attribute support (ACL is a good idea too) and you have booted with the
>>>> > ext4 driver so configured.
>>>> >
>>>> > You then add the xattr option in /etc/fstab for the filesystem(s) where
>>>> > you want extended attribute support.  If you do that before you reboot
>>>> > (as above) then you will have full extended attribute support.
>>>>
>>>> I thought that you are meant to pass such options on the CLI at the time 
>>>> you
>>>> are formatting the partition ... is this incorrect?
>>>>
>>>> Of course if you must format the drive with such options then the data 
>>>> won't
>>>> survive.
>>>> --
>>>> Regards,
>>>> Mick
>>>
>>>
>>> Hi,
>>>
>>> thank you very much for all the input.
>>>
>>> To clearify things a little:
>>>
>>> Status quo: System with ext4 and no extended attributes.
>>> Where I want to be: The same system with extended attributes.
>>>
>>> Way to go: No reformatting and mkfs and all that things. Only kernel
>>> reconfiguring / recompiling / rebooting and emerging some tools.
>>>
>>> Possible?
>>
>> As others had said, this is possible. I used this guide:
>>
>> http://www.debian-administration.org/articles/643
>>
>> You need basically to enable the ext4-only features:
>>
>> tune2fs -O extents,uninit_bg,dir_index <partition>
>
> Um, why? Ext3 had extended attribute support, and ISTR the ext4 code
> being able to handle ext3 filesystems.

Didn't we already had this discussion? You can mount an ext3 partition
as ext4, and it will be treated as ext4, but it will keep bein fully
backwards compatible with ext3 (i.e., you can still mount it as ext3).
This, however, negates the purpose of using ext4, as you are not using
extents: From /usr/src/linux/Documentation/ext4.txt:

  - Create a new filesystem using the ext4 filesystem type:

        # mke2fs -t ext4 /dev/hda1

    Or to configure an existing ext3 filesystem to support extents:

        # tune2fs -O extents /dev/hda1


The moment you enable extents on a ext4 partition, you need to fsck
the filesystem, and stops being backwards compatible (i.e., it will no
longer mount as ext3, and in particular GRUB will not be able to read
the kernel inside it).

If the partition has extents support, doesn't necessarily means that
their files use extents: Therefore, if you want to fully convert your
partition to ext4 (i.e., make all the files and directories to use
extents), you need to chattr +e every file and directory in the
filesystem, hence the commands:

> find <directory> -xdev -type f -print0 | xargs -0 chattr +e
> find <directory> -xdev -type d -print0 | xargs -0 chattr +e

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México

Reply via email to