Gentoo Archives: gentoo-user

From: "Canek Peláez Valdés" <caneko@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Extended file attributes: ext4
Date: Sun, 08 Apr 2012 18:53:42
Message-Id: CADPrc824DR-LTSjpv9oODjPqymQYg9dNeW2EQruSR1WJQJFEdg@mail.gmail.com
In Reply to: Re: [gentoo-user] Extended file attributes: ext4 by Michael Mol
1 On Sun, Apr 8, 2012 at 1:41 PM, Michael Mol <mikemol@×××××.com> wrote:
2 > On Sun, Apr 8, 2012 at 2:21 PM, Canek Peláez Valdés <caneko@×××××.com> wrote:
3 >> On Sun, Apr 8, 2012 at 11:44 AM,  <meino.cramer@×××.de> wrote:
4 >>> Mick <michaelkintzios@×××××.com> [12-04-08 18:40]:
5 >>>> On Sunday 08 Apr 2012 16:56:23 David W Noon wrote:
6 >>>> > On Sun, 8 Apr 2012 17:26:03 +0200, meino.cramer@×××.de wrote about
7 >>>> >
8 >>>> > [gentoo-user] Extended file attributes: ext4:
9 >>>> > > is it possible to go from an ext4-filesystem with no extended file
10 >>>> > > attributes to one with extended file attributes without reformatting
11 >>>> > > the disk or other very risky low level things just by adding this
12 >>>> > > feature to the kenrel (?) ?
13 >>>> >
14 >>>> > Yes, it's simple.
15 >>>> >
16 >>>> > You need to ensure that your kernel configuration has the extended
17 >>>> > attribute support (ACL is a good idea too) and you have booted with the
18 >>>> > ext4 driver so configured.
19 >>>> >
20 >>>> > You then add the xattr option in /etc/fstab for the filesystem(s) where
21 >>>> > you want extended attribute support.  If you do that before you reboot
22 >>>> > (as above) then you will have full extended attribute support.
23 >>>>
24 >>>> I thought that you are meant to pass such options on the CLI at the time you
25 >>>> are formatting the partition ... is this incorrect?
26 >>>>
27 >>>> Of course if you must format the drive with such options then the data won't
28 >>>> survive.
29 >>>> --
30 >>>> Regards,
31 >>>> Mick
32 >>>
33 >>>
34 >>> Hi,
35 >>>
36 >>> thank you very much for all the input.
37 >>>
38 >>> To clearify things a little:
39 >>>
40 >>> Status quo: System with ext4 and no extended attributes.
41 >>> Where I want to be: The same system with extended attributes.
42 >>>
43 >>> Way to go: No reformatting and mkfs and all that things. Only kernel
44 >>> reconfiguring / recompiling / rebooting and emerging some tools.
45 >>>
46 >>> Possible?
47 >>
48 >> As others had said, this is possible. I used this guide:
49 >>
50 >> http://www.debian-administration.org/articles/643
51 >>
52 >> You need basically to enable the ext4-only features:
53 >>
54 >> tune2fs -O extents,uninit_bg,dir_index <partition>
55 >
56 > Um, why? Ext3 had extended attribute support, and ISTR the ext4 code
57 > being able to handle ext3 filesystems.
58
59 Didn't we already had this discussion? You can mount an ext3 partition
60 as ext4, and it will be treated as ext4, but it will keep bein fully
61 backwards compatible with ext3 (i.e., you can still mount it as ext3).
62 This, however, negates the purpose of using ext4, as you are not using
63 extents: From /usr/src/linux/Documentation/ext4.txt:
64
65 - Create a new filesystem using the ext4 filesystem type:
66
67 # mke2fs -t ext4 /dev/hda1
68
69 Or to configure an existing ext3 filesystem to support extents:
70
71 # tune2fs -O extents /dev/hda1
72
73
74 The moment you enable extents on a ext4 partition, you need to fsck
75 the filesystem, and stops being backwards compatible (i.e., it will no
76 longer mount as ext3, and in particular GRUB will not be able to read
77 the kernel inside it).
78
79 If the partition has extents support, doesn't necessarily means that
80 their files use extents: Therefore, if you want to fully convert your
81 partition to ext4 (i.e., make all the files and directories to use
82 extents), you need to chattr +e every file and directory in the
83 filesystem, hence the commands:
84
85 > find <directory> -xdev -type f -print0 | xargs -0 chattr +e
86 > find <directory> -xdev -type d -print0 | xargs -0 chattr +e
87
88 Regards.
89 --
90 Canek Peláez Valdés
91 Posgrado en Ciencia e Ingeniería de la Computación
92 Universidad Nacional Autónoma de México

Replies

Subject Author
Re: [gentoo-user] Extended file attributes: ext4 Michael Mol <mikemol@×××××.com>