View previous topic :: View next topic |
Author |
Message |
jdgill0 Veteran
Joined: 25 Mar 2003 Posts: 1366 Location: Lexington, Ky -- USA
|
Posted: Tue May 17, 2005 3:21 am Post subject: |
|
|
syrrus,
It seems I am misunderstanding a few things with immutable. Adding acl to my fstab for my /home partition does let root chattr +i somefile, but only root can do this. Also, I was under the impression with ext2,3 that once the immutable bit was set, the file could not be deleted, i.e. could not rm somefile, until the immutable bit was unset. I was able to remove the file with the immutable bit set in my reiserfs file. I thought that was the point of immutable, to not be able to remove the file with that bit set -- only reading or appending the file was allowed. Lastly, I did not think the immutable with ext2,3 was an ACL thing, that it was built into the ext2,3 filesystem?
[EDIT]
I have done some more playing with chattr and lsattr. Under the reiserfs filesytem it "appears" I can set the various bits, however it also appears they hold no meaning, as I can still do whatever I want to the files as root or user that I want regardless of what bits have been set. Unfortunately I do not have an ext2,3 filesystem to play with. _________________ Vim has excellent syntax highlighting for configuration files: emerge gentoo-syntax
Learn how to use Vim: vimtutor
Last edited by jdgill0 on Tue May 17, 2005 3:37 am; edited 2 times in total |
|
Back to top |
|
|
syrrus n00b
Joined: 16 May 2005 Posts: 24 Location: College Station, TX
|
Posted: Tue May 17, 2005 3:34 am Post subject: |
|
|
Ok, acl and immutable are completely different. ACL is access control list, thats just a major enhancement to rwx.
The file system flags mantained by chattr are just like the BSD ones that interact with the Secure level. Now if you
chattr +i the file is immutable but just a simple chattr -i can just make that entire concept null. Using th BSD secure
level implementation for linux accually enforces the rules you set by the file. _________________ Gates Closed,
Windows Broken,
I Found the Source;
And It Was Open. |
|
Back to top |
|
|
jdgill0 Veteran
Joined: 25 Mar 2003 Posts: 1366 Location: Lexington, Ky -- USA
|
Posted: Tue May 17, 2005 3:40 am Post subject: |
|
|
syrrus,
See my [EDIT] that I added to my last post -- guess I was too slow ... anyways, as I said in the edit, it seems to me the chattr bits do nothing under reiserfs from what I can see. Setting chattr +i somefile or even chattr +u somefile (for undeleteable) does not change what I can or can not do to the files, although lsattr somefile clearly shows the bits set.
[EDIT]
I was able to setup an ext3 partition. Under ext3 the immutable bit works as I was expecting it too -- i.e. the file can not be deleted until the immutable bit is unset. Which now brings me back to my original point --> as an example, setting the immutable bit on config files that you modify would help keep you from overwriting them with an etc-update by accident. However, I am still not sure why non-root users should not be allowed to use chattr, as it seems it could be useful to normal users to keep from deleting important files of their own. All the useful things I have seen with ext3, and the compatibility of programs to modify/recover from ext3 is certainly moving me a lot closer to switching from reiserfs to ext3.
[EDIT 2]
(I add this bit just to clear up the confusion on chattr/lsattr with reiserfs)
You can use the BSD levels (i.e. chattr and lsattr) with reiserfs. To do so, you must use the attrs mount option.
I originally posted about chattr/lsattr for ext3 thinking it might be of interest to those who are looking to use ext3, but I wasn't sure if it fit in with codergeek's ext3 howto in this thread. _________________ Vim has excellent syntax highlighting for configuration files: emerge gentoo-syntax
Learn how to use Vim: vimtutor
Last edited by jdgill0 on Tue May 17, 2005 4:57 pm; edited 1 time in total |
|
Back to top |
|
|
syrrus n00b
Joined: 16 May 2005 Posts: 24 Location: College Station, TX
|
Posted: Tue May 17, 2005 12:11 pm Post subject: |
|
|
Most likely the bit's are not obeyed until the BSD secure level is elevated. I will experiment on one of my newer installs and see exactally whats happening.
[This thread isn't exactally the best place to continue this conversation. Feel free to PM me so we can do some more research] _________________ Gates Closed,
Windows Broken,
I Found the Source;
And It Was Open. |
|
Back to top |
|
|
tcostigl Tux's lil' helper
Joined: 28 Jul 2004 Posts: 97
|
Posted: Wed May 18, 2005 1:18 am Post subject: |
|
|
I assume this would also apply to a software raid partition(md raid) on /dev/md* formatted with ext3. |
|
Back to top |
|
|
Juzna n00b
Joined: 03 Jul 2004 Posts: 3
|
Posted: Sat May 21, 2005 3:03 pm Post subject: |
|
|
I just wonder if I can change to full journal without any downtime on my server, with -o remount handle. Will this break my fs or can I do it? |
|
Back to top |
|
|
codergeek42 Bodhisattva
Joined: 05 Apr 2004 Posts: 5142 Location: Anaheim, CA (USA)
|
Posted: Sat May 21, 2005 4:55 pm Post subject: |
|
|
tcostigl wrote: | I assume this would also apply to a software raid partition(md raid) on /dev/md* formatted with ext3. | I've no experience with that but since the tune2fs/e2fsck tools operate on the filesystem itself, it should work just fine on RAID disks or other media which use the ext2 or ext3 filesystem. juzna wrote: | I just wonder if I can change to full journal without any downtime on my server, with -o remount handle. Will this break my fs or can I do it? | I just tried it, and my kernel gave me an error saying I couldn't do that: Quote: | EXT3-fs: cannot change data mode on remount | This was trying to remount my /usr/portage with 'data=ordered'. Unmounting it, then mounting it with 'data=ordered' works just fine though, so what you're trying to do does not seem possible. _________________ ~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF |
|
Back to top |
|
|
fallow Bodhisattva
Joined: 08 Jan 2004 Posts: 2208 Location: Poland
|
Posted: Mon May 23, 2005 7:50 am Post subject: |
|
|
good to see this how-to here maybe more and more users will see the goodies in lower cpu usage and better interactivity of rest of the system in thanks to it [ in comparision to reiser* ] .
I personally using dir_index feauture and writeback mode. Yeah I like less journalling , full journalling for example gives me too higher cpu usage with filiesystems RW operations.
cheers & thanks & greetings _________________ "Time is a companion that goes with us on a journey. It reminds us to cherish each moment, because it will never come again. What we leave behind is not as important as how we have lived" J-L. Picard |
|
Back to top |
|
|
darklegion Guru
Joined: 14 Nov 2004 Posts: 468
|
Posted: Tue Jun 07, 2005 2:29 am Post subject: |
|
|
codergeek42 wrote: | @prymitive: You can adjust your block size and inode count when you initially create the filesystem. Setting it to use 1KB block sizes and 1 inode per 1KB should give you the most effecient space usage: Code: | # /sbin/mkfs.ext3 -b 1024 -i 1024 /dev/hXY | Be warned though that decreased the block size and increasing the inode allocation in this manner can cause a significant performance decrease if the filesystem is store larger files as well (since it has to do more journalling, I/O, and resource allocation).
|
I tried this out and the results were not at all promising.Listed here is the freespace before and after changing the block size/inode count:
Code: |
Before:
/dev/hdc 74G 33M 74G 1% /nxbox
After:
/dev/hdc 66G 8.1M 62G 1% /nxbox
|
Well at least the journal is skightly smaller *laughs*.I'm guessing that larger drives are designed to work with larger blocksizes although I don't know if you can call an 80gb drive *large* anymore. |
|
Back to top |
|
|
darklegion Guru
Joined: 14 Nov 2004 Posts: 468
|
Posted: Tue Jun 07, 2005 2:29 am Post subject: |
|
|
codergeek42 wrote: | @prymitive: You can adjust your block size and inode count when you initially create the filesystem. Setting it to use 1KB block sizes and 1 inode per 1KB should give you the most effecient space usage: Code: | # /sbin/mkfs.ext3 -b 1024 -i 1024 /dev/hXY | Be warned though that decreased the block size and increasing the inode allocation in this manner can cause a significant performance decrease if the filesystem is store larger files as well (since it has to do more journalling, I/O, and resource allocation).
|
I tried this out and the results were not at all promising.Listed here is the freespace before and after changing the block size/inode count:
Code: |
Before:
/dev/hdc 74G 33M 74G 1% /nxbox
After:
/dev/hdc 66G 8.1M 62G 1% /nxbox
|
Well at least the journal is slightly smaller *laughs*.I'm guessing that larger drives are designed to work with larger blocksizes although I don't know if you can call an 80gb drive *large* anymore.
EDIT: I forgot to enable -m0 to get rid of the superuser-reserving-space buillshit,which gave me 66gb but that is still significantly smaller. |
|
Back to top |
|
|
torchZ06 Apprentice
Joined: 01 Nov 2003 Posts: 175 Location: the front range
|
Posted: Thu Jun 16, 2005 9:00 pm Post subject: |
|
|
codergeek42 wrote: |
There are two different ways to activate journal data mode. The first is by adding data=journal as a mount option in /etc/fstab. If you do it this way and want your root filesystem to also use it, you should also pass rootflags=data=journal as a kernel parameter in your bootloader's configuration. In the second method, you will use tune2fs to modify the default mount options in the filesystem's superblock: |
am i correct in interpreting this statement as meaning if you're running a new kernel and set the flags in the superblock that you DON'T have to add anything to /etc/fstab or your grub.conf in order to take advantage of journal data mode?
is there some way to see what mount options are being used-- not reading the superblock with tune2fs, but rather to actually see what mount is using? |
|
Back to top |
|
|
codergeek42 Bodhisattva
Joined: 05 Apr 2004 Posts: 5142 Location: Anaheim, CA (USA)
|
Posted: Thu Jun 16, 2005 9:27 pm Post subject: |
|
|
torchZ06 wrote: | am i correct in interpreting this statement as meaning if you're running a new kernel and set the flags in the superblock that you DON'T have to add anything to /etc/fstab or your grub.conf in order to take advantage of journal data mode? | That's correct. The flags in the superblock are default mount flags. Unless you specify otherwise (via command-line options or /etc/fstab), those options will always be used when mounting. Quote: | 0is there some way to see what mount options are being used-- not reading the superblock with tune2fs, but rather to actually see what mount is using? | You can check your kernel log with `dmesg` and you should see sometrhing similar to the following for each Ext3 partition: Code: | $ dmesg
[...]
EXT3 FS on hda3, internal journal
EXT3-fs: mounted filesystem with journal data mode.
EXT3 FS on hda5, internal journal
EXT3-fs: mounted filesystem with journal data mode.
[...etc...] | Hth! _________________ ~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF |
|
Back to top |
|
|
mauricev Apprentice
Joined: 22 Mar 2004 Posts: 197
|
Posted: Sat Jun 18, 2005 7:27 pm Post subject: Is this statement accurate? |
|
|
codergeek42 wrote: | You don't need to defragment ext2/ext3 because as you use the filesystem file blocks and inodes are moved around and reallocated to keep the data nearly contiguous. It's not perfect, but it works fairly well and you should almost never see a performance degradation caused by the filesystem's fragmentation. |
I posed this statement to the ext3 mailing and asked if it were true. One of the ext3 developers, Theodore Ts'o, responds...
No, not true. (At least not today)
Ext2/3 has advanced algorithms to make sure that the blocks that are allocated avoid fragmentation, but it is not doing any kind of dynamic moving of blocks/inodes.
(At least, not yet; there has been some talk about creating enough kernel hooks so that a user-space program could do dynamic defragmentation of the filesystem, but none of this exists at the moment.)
- Ted |
|
Back to top |
|
|
codergeek42 Bodhisattva
Joined: 05 Apr 2004 Posts: 5142 Location: Anaheim, CA (USA)
|
Posted: Sun Jun 19, 2005 3:15 am Post subject: |
|
|
Hmmm I thought Ext3 did dynamic reallocation like that but I guess not. It still kicks butt as an excellent FS anyhoo. Thanks, mauricev.
EDIT: Link to message: https://www.redhat.com/archives/ext3-users/2005-June/msg00026.html _________________ ~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF
Last edited by codergeek42 on Fri Sep 02, 2005 8:21 pm; edited 1 time in total |
|
Back to top |
|
|
blaster999 l33t
Joined: 09 May 2004 Posts: 902 Location: Between keyboard and chair
|
Posted: Tue Jun 28, 2005 2:15 pm Post subject: |
|
|
Hi codergeek42, great guide! I think I'm gonna dump my reiser3.6 partition and switch to ext3. One question (a little OT): is there a FS which actually does full dynamic relocation? _________________ 60s: sex, drugs, rock'n'roll
90s: sux, bugs, drag'n'drop
---
Some multimedia keys refuse to work? See my mini-howto:
https://forums.gentoo.org/viewtopic.php?p=1896734#1896734 |
|
Back to top |
|
|
codergeek42 Bodhisattva
Joined: 05 Apr 2004 Posts: 5142 Location: Anaheim, CA (USA)
|
Posted: Tue Jun 28, 2005 4:05 pm Post subject: |
|
|
blaster999,
I think Reiser4 is supposed to use dancing trees to achieve this. I'm not too sure, however, if that's for the file data or purely the metadata or what it's for, as I've not read too much about it. _________________ ~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF |
|
Back to top |
|
|
m0p Apprentice
Joined: 20 Jun 2005 Posts: 205 Location: en_GB
|
Posted: Thu Jun 30, 2005 10:03 pm Post subject: |
|
|
I'll try these tweaks tomorrow cause I'm going to bed soon. Another ext3 fan here too |
|
Back to top |
|
|
fbvortex n00b
Joined: 01 Jul 2005 Posts: 22
|
Posted: Fri Jul 08, 2005 3:55 am Post subject: rootflags=data=journal |
|
|
Has anyone here successfully used the rootflags=data=journal kernel command-line parameter for their root partitions? If so, after boot, what does a listing of the "mount" command show for / ? On my setup, after having done that, a mount listing does not show data=ordered in the mount listing for / .
The kernel message log does show that rootflags=data=journal is getting passed in.
How can I tell if / is correctly being mounted with data=journal when it goes rw? |
|
Back to top |
|
|
codergeek42 Bodhisattva
Joined: 05 Apr 2004 Posts: 5142 Location: Anaheim, CA (USA)
|
Posted: Fri Jul 08, 2005 4:16 am Post subject: Re: rootflags=data=journal |
|
|
fbvortex wrote: | How can I tell if / is correctly being mounted with data=journal when it goes rw? | You should see something like the following in your kernel log: Quote: | EXT3-fs: mounted filesystem with journal data mode.
VFS: Mounted root (ext3 filesystem) readonly.
EXT3 FS on hda3, internal journal | When it remounts it as read/write no messages seem to appear in my kernel log. I don't use the "rootflags=data=journal" method though, since I use tune2fs to set the default mount option in my filesystems' superblocks. _________________ ~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF |
|
Back to top |
|
|
fbvortex n00b
Joined: 01 Jul 2005 Posts: 22
|
Posted: Fri Jul 08, 2005 4:35 pm Post subject: |
|
|
codergeek42,
Can you tell me what the output of 'mount' (without any options) is for your / filesystem? I'd like to see if the data=journal is supposed to show up there. |
|
Back to top |
|
|
codergeek42 Bodhisattva
Joined: 05 Apr 2004 Posts: 5142 Location: Anaheim, CA (USA)
|
Posted: Sat Jul 09, 2005 4:04 am Post subject: |
|
|
fbvortex wrote: | codergeek42,
Can you tell me what the output of 'mount' (without any options) is for your / filesystem? I'd like to see if the data=journal is supposed to show up there. | Sure.: Code: | $ mount | grep hda3
/dev/hda3 on / type ext3 (rw) | And the superblock information: Code: | tune2fs 1.37 (21-Mar-2005)
[...]
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal dir_index filetype needs_recovery sparse_super
Default mount options: journal_data user_xattr
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
[...] |
_________________ ~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF |
|
Back to top |
|
|
chevelle n00b
Joined: 01 Apr 2004 Posts: 19
|
Posted: Tue Jul 12, 2005 3:14 am Post subject: |
|
|
dig it
Last edited by chevelle on Thu Jul 14, 2005 5:45 am; edited 1 time in total |
|
Back to top |
|
|
codergeek42 Bodhisattva
Joined: 05 Apr 2004 Posts: 5142 Location: Anaheim, CA (USA)
|
Posted: Tue Jul 12, 2005 3:12 pm Post subject: |
|
|
Err...you have backups I hope? I don't know if those errors are fixable... _________________ ~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF |
|
Back to top |
|
|
alari n00b
Joined: 23 Feb 2004 Posts: 47 Location: Tartu, Estonia
|
Posted: Sun Jul 24, 2005 5:18 pm Post subject: |
|
|
Is the information in the first post up-to-date ?
I'm gonna do a reinstall on my syste, i have used reiser4 for about 18months or so and it's damn slow, (i dont have time to mess with the repacker, heard to be seen in reiser4.1)
Can i use the tips in the first post, after i format my partitions with ext3 during the install ? |
|
Back to top |
|
|
codergeek42 Bodhisattva
Joined: 05 Apr 2004 Posts: 5142 Location: Anaheim, CA (USA)
|
Posted: Sun Jul 24, 2005 6:08 pm Post subject: |
|
|
alari wrote: | Is the information in the first post up-to-date ?
I'm gonna do a reinstall on my syste, i have used reiser4 for about 18months or so and it's damn slow, (i dont have time to mess with the repacker, heard to be seen in reiser4.1)
Can i use the tips in the first post, after i format my partitions with ext3 during the install ? | Yes, the information is up-to-date to my knowledge. I'm using kernel 2.6.12-gentoo-r6 with e2fsprogs version 1.38. _________________ ~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|