Gentoo Archives: gentoo-user

From: meino.cramer@×××.de
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Extended file attributes: ext4
Date: Sun, 08 Apr 2012 18:38:53
Message-Id: 20120408183707.GA4006@solfire
In Reply to: Re: [gentoo-user] Extended file attributes: ext4 by "Canek Peláez Valdés"
1 Canek Peláez Valdés <caneko@×××××.com> [12-04-08 20:28]:
2 > On Sun, Apr 8, 2012 at 11:44 AM, <meino.cramer@×××.de> wrote:
3 > > Mick <michaelkintzios@×××××.com> [12-04-08 18:40]:
4 > >> On Sunday 08 Apr 2012 16:56:23 David W Noon wrote:
5 > >> > On Sun, 8 Apr 2012 17:26:03 +0200, meino.cramer@×××.de wrote about
6 > >> >
7 > >> > [gentoo-user] Extended file attributes: ext4:
8 > >> > > is it possible to go from an ext4-filesystem with no extended file
9 > >> > > attributes to one with extended file attributes without reformatting
10 > >> > > the disk or other very risky low level things just by adding this
11 > >> > > feature to the kenrel (?) ?
12 > >> >
13 > >> > Yes, it's simple.
14 > >> >
15 > >> > You need to ensure that your kernel configuration has the extended
16 > >> > attribute support (ACL is a good idea too) and you have booted with the
17 > >> > ext4 driver so configured.
18 > >> >
19 > >> > You then add the xattr option in /etc/fstab for the filesystem(s) where
20 > >> > you want extended attribute support.  If you do that before you reboot
21 > >> > (as above) then you will have full extended attribute support.
22 > >>
23 > >> I thought that you are meant to pass such options on the CLI at the time you
24 > >> are formatting the partition ... is this incorrect?
25 > >>
26 > >> Of course if you must format the drive with such options then the data won't
27 > >> survive.
28 > >> --
29 > >> Regards,
30 > >> Mick
31 > >
32 > >
33 > > Hi,
34 > >
35 > > thank you very much for all the input.
36 > >
37 > > To clearify things a little:
38 > >
39 > > Status quo: System with ext4 and no extended attributes.
40 > > Where I want to be: The same system with extended attributes.
41 > >
42 > > Way to go: No reformatting and mkfs and all that things. Only kernel
43 > > reconfiguring / recompiling / rebooting and emerging some tools.
44 > >
45 > > Possible?
46 >
47 > As others had said, this is possible. I used this guide:
48 >
49 > http://www.debian-administration.org/articles/643
50 >
51 > You need basically to enable the ext4-only features:
52 >
53 > tune2fs -O extents,uninit_bg,dir_index <partition>
54 >
55 > Do the fsck:
56 >
57 > fsck.ext4 -yfD <partition>
58 >
59 > And (optionally) convert all the files and directories to use extends:
60 >
61 > find <directory> -xdev -type f -print0 | xargs -0 chattr +e
62 > find <directory> -xdev -type d -print0 | xargs -0 chattr +e
63 >
64 > I did this on my laptop and desktop (including the root filesystem,
65 > booting into emergency mode with systemd), and everything worked
66 > perfectly.
67 >
68 > Note, however, that you *need* GRUB2 if your kernel lives in an ext4
69 > partition that it's not longer compatible with ext3. Don't do the
70 > change without migrating to GRUB2 before.
71 >
72 > Regards.
73 > --
74 > Canek Peláez Valdés
75 > Posgrado en Ciencia e Ingeniería de la Computación
76 > Universidad Nacional Autónoma de México
77 >
78
79 Ok, thanks for the introduction and the link, Canek! :)
80
81 Best regards,
82 mcc