General :: Change Umask For Files Created In Ext2/ext3
Oct 28, 2009
I have ext3 partition mounted on /mnt/shared/ as follows
Permissions above are of the actual mounted fs.
Goal is to have all files created on the fs
1) to belong to group 'users'
2) to have this groups permissions set to rw (rwx for directories) so that all users who belong to group 'users' have full read/write access to data and everyone else to have only read access.
Now because of setgid bit (s) in group permissions every file created has group 'users' and additionally setgid bit is set for directories. Because every users umask by default (on my system) is set to 0022 all created files will have permissions 644 for ordinary files and 755 for directories.
Net result of above means that users A and B who both belong to group 'users' won't be able to modify files created by the other.
So how can I make files created on the fs to be created always with umask 0002 WITHOUT changing default umask for users that is used elsewhere (like in their home directory) ?
I have several directories, each owned by root and a group of the same name,By setting the sgid bit, I made sure that newly created files and directories are owned by the correct group, and that directories have the sgid bit set too.On each newly created directory or file, the permissions are set to 755. This is because this is the default umask, and I cannot change a users umask. I actually only want files created below a particular directory to have group write access, inheriting this behaviour to newly created directories properly.I'm not on samba or NFS, I have to do this for SSH users.The filesystem is ext3.I started to fool around with ACLs, but couldn't find what I was looking for.
I would like to convert my /tmp and /boot partitions from Ext3 to Ext2 on my Arch Linux setup. I don't see any use in having journaling for either partition. I want to make sure that I have the right steps lined up so could someone verify that this is correct (from a live cd):
Code: #sudo tune2fs -O ^has_journal /dev/sda7 #sudo e2fsck /dev/sda7 #sudo tune2fs -O ^has_journal /dev/sda5 #sudo e2fsck /dev/sda5 I then edit /etc/fstab to reflect these changes (ext3 to ext2 for both lines)
Does it matter what order I do it in (/dev/sda7 is /tmp and /dev/sda5 is /boot).
We are running debian off of an SD card and want to know what's best for /var?
- Plenty of room on 2GB SD card, so do we, make /var as large as possible (everything else is read only) to reduce block overwrites, or do we make /var as small as possible, hopefully reducing the load 'pdflush' places on the 200 Mhz system?
That said, why not ext2? Is there damage that can happen in /var due to insta-crash or power loss that will prevent proper system function? We heard ext4 is more optimized, but ext4 on 2.6.29, not sure.
If we must use a journaled file system for /var, then which is lowest load on system, or "better": jfs, ext3, jffs2 ...
i m not able to copy a file over 16 gigs on an EXT2 or EXT3 partition. Is there a way to do this. I even tried to split my iso file too. I splitted my iso file in 4 files then copy them on the ext2 or ext3 partition. But as soon as I was trying to join the files together it never went over 16 gigs. Actually it stops at 16,843,020 kb exactly. is there a limit for those partitions or is there an another way to see my 20gigs iso file in one piece?
I am planning on dual-booting Windows XP and Ubuntu on a new laptop, and because I have a program that lets me mount an ext2 filesystem on Windows, I was thinking of installing Ubuntu with ext2 instead of ext3. I am concerned, however, that it might open up a security risk for my Ubuntu partition. Would this cause a problem? (In case it's relevant, I use AVG Free antivirus in Windows.)
I use 8GB USB sticks for backup of Ubuntu 10.04. I have had a variety of problems with ext3 format (security tar file not readable, etc) and have reformatted to ext2, so far without a problem.
But - am I missing something by not using ext3 (or even ext4)? Should I be sticking with ext3 and try to resolve the problems - bearing in mind that as the USB stick is my backup I need it to be secure!
I have 2 Oracle users that generate .tmp files under /var/tmp. By default, the files have the permissions 644. Now, a need has arisen whereby the files created by these users have to have the permission bits as 664. Obviously, I changed the UMASK value for these users from 022 to 02. But the files are still getting created with 644 as the permission.
I tried restarting the application as I read that a relogin is required for the UMASK change to take effect. Even that hasn't helped.
My Debian system has by default umask permissions of 0022, which I never liked. One user can read all the files of another seems very insecure to me.
I am planing to set it to 007, so that user and group have rw but all others have none.
Are there any side effects to that? I have noticed from a trial I did where I was changing permissions on the filesystem that some system stuff in the OS does not work anymore, if "others" have no read permission anymore, so that is why I am asking.
And why are chmod / umask permissions sometimes stated as 4 digits? What is this "all" group in the end? Isn't that already covered by "others"?
I run an upgrade and an update on a lucid lynx beta 2. --- got no problems. but about the filesystems i have some questions because it seems for me that at every system boot the system will run an fsck. somtimes it's shown up, somtimes not. but in /var/log/messages and in syslog
I have always following messages ( occured in beta 2 too ).
But first before i continue - here my disk layout:
And here my filesystem types:
This is my problem because those values are seems to be static ! ( note: this partiton is mounted but not in use ) and last not least: the drive is an external usb scsi disk. but on the other side lucid lynx is running fine on my box.
I have a new Vertex2 Solid State Drive. When I try to install any distributions, formating the drive in EXT3 or EXT4 (or LUKS with EXT3, or EXT4). My hard drive times out during a copy process. (OpenSUSE 11.2 for example would crash after the 2nd file of X11. Debian got ~12% done when it crashed.)
I am facing a serious problem.I installed UBUNTU 10.04 and encrypted it during installation. I accidentally erased some of the necessary files from root folder. now the the OS is NOT booting.luckily i still have the encryption key i have some important documents in that drive (desktop folder).
PS: I have tried to run Live Ubuntu it shows the Root, but it does not enter any of the folder.
I have a question, i accidentally formatted an lvm volume as ext2 after creating it. Then of course, we copied a ton of data to it before I realized it was ext2. (I guess ext2 was the default when using mkfs without a -t) Anyway - can I just use tune2fs -j on the LVM just like I would a /dev/sdx device?
I am student of MCS and working on final project. I am the user of windows xp. I am new in Linux. I am working on a project that titles "Hard disk data Recovery of ext2 and ext3 in linux". In windows, including dos.h and bios.h header files in program of c language I can send interrupt to bios and access most of the devices like parallel port, hard disks etc. But problem is that there is no bios.h and dos.h files in gcc. Now how can I access my hard drive using c program. How can I call int13h interrupt in linux or there is any other function in the linux to access the hard disk. In fact I want to access sectors of my hard disk using c language program. How can I do it?
I want to convert my swap space 8GB to usable formatHere is the output of sudo fdisk -l command$sudo fdisk -lDisk /dev/sda: 80.0 GB, 80026361856 bytes255 heads, 63 sectors/track, 9729 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDisk identifier: 0x26af26ae
Device Boot Start End Blocks Id System /dev/sda1 * 1 2295 18434556 7 HPFS/NTFS /dev/sda2 2296 9728 59705572+ f W95 Ext'd (LBA)
During the file system check of an ext3 partition at boot I get the following output:
The super-block could not be read or does not describe a correct ext2 filesystem. If the device is still valid and it really contains an ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate super-block:
I'm then forced to login in as root and given the following prompt:
I'm reluctant to do as advised by the output and run e2fsck -b because it is not an ext2 filesystem.
Although I can still enter runlevel 5, it doesn't seem to recognise mouse and keyboard input in KDE so my system is effectively redundant at the mo. For this reason any short term workarounds are welcome, but a fix is needed. This problem is part of a longer saga to do with recovering a Windows Vista installation which started failing to boot. I have used both Vista and SUSE tools to try and recover my bootloader to no avail, and this has been the result. If more detail about this is needed please ask and I can explain what I have done.
I have a NFS shared directory between two linux machines, one with RedHat3 and one with CentOS 5.4.On the CentOS 5.4 machine I have InfoBright installed. In that directory, I want to create files with InfoBright and then to select from them with MySQL on the RedHat3 machine.The problem is that InfoBright creates files with 660 permissions and mysql with 666, and I cannot SELECT from any file due to the fact that is not "readable by all"(this is the actual error). I can change the permissions manually, but I need them to be created with 666 permissions, so that I can import them automatically on the other side with a script.Is there any way to change the permissions of the InfoBright created files?
I just rebuild the kernel for slackware 13, everything works, but root file system which is ext3 is mounted as ext2. Normally I've build ext3, ext4 and so on as modules, not in the kernel... but if I do this, then the kernel mounts the file system as ext2, which is build in the kernel. I also modified rc.modules so I can make sure that ext3,ext4,jbd are loaded, but it doesnt work.
I have dual boot system..i.e, windows XP and ubuntu 9.10(insatlled side by side). when i try to boot ubuntu, Im gettin sh:grub > prompt
I am getting something like this.. root mount file system failed.. ext2 ext3 ext4 ....... kernel panic message and hanged at kenelthreadhelpper+ what can i do.. I cant reinstall ubuntu again.. Because I have installed nany application there..
CentOS 5.4 install, likewise open standard install (For active directory authentication).I have a license service which requires a license.txt be in the users home directory.The group owner for license.txt must be the same as the license service. Whenever a new domain user logs in, it creates the all the appropriate files but the group owner for license.txt is the users domain group. My current workaround seems like more effort than it's worth, is there another way to get this process solved easier/more secure?
- copy the license.txt into /etc/skel
- created a script to check for the presence of license.txt, check it's permissions and change them if necessary
- gave the domain's group sudo [nopasswd] access to the script (the script is not writable)
I want to set permissions to a folder as rwx-r-x-r-x in such a way that whenever a new file or folder is created under it, it will automatically inherit the parent folders default permissions.So,what I need to do know, do I have to change the umask value??
I have a daemon running as a local user account on my red hat box. The problem is the daemon creates directories using a umask of 022. I need group write access to the directories the daemon is creating. I need the daemon to use a umask of 002. I've edited the daemons startup script in /etc/init.d I've changed the umask in the /etc/init.d/functions file. I've added the line "umask 002" in the user's ~/.bashrc and ~/.bash_profile files. I've also setup /etc/bashrc to assign all users a 002 umask (just for kicks)