"The Linux Gazette...making Linux just a little more fun!"


(?) The Answer Guy (!)


By James T. Dennis, [email protected]
LinuxCare, http://www.linuxcare.com/


(?) Weird Mount Permissions & Where's a Word Processor

From Ilan Tal on Sun, 23 Jan 2000

Hi Jim,

This morning your answer on getting started with Samba was the best thing I've seen to date on Linux. It answered the questions I didn't know how to ask. I still haven't implemented it, but at least now I know which direction to go.

(!) Glad it helped. I have no idea which comment on Samba you're referring to --- after three years and over a thousand questions answered on this column they tend to all be a blur.

(?) I have another couple questions which you might be able to answer. I have a multiple boot machine with win95, win98, win2k and Linux 6.1. Naturally I want Linux to talk to EVERYTHING, including across the LAN (the Samba part).

I have hooked up win95 (fat16) and win98 (fat32), but each time when I boot up and look in the /mnt folder I see both icons with a red band around them (meaning that I can't open the folder).

I go into the terminal, open up a super user and do: ls -ld win98. The result I get back is d----w-w-. That explains why I can't open them. Then I do a umount win98 and immediately mount it back again. Now ls -ld win98 gives me drwxrwxr-x, and I can open the folders. Under linuxconf I have myself as the owner.

The problem is if I reboot, it again goes into the mode where I can't open the folder. My question is: what do I have to do to convince it to boot up with drwxrwxr-x and NOT d---w-w-?

(!) Well that is odd. The initial (boot time) mount fails in a way that marks the permissions absurdly and a remount succeeds and shows sane permissions.
The diagnostics you're giving are pretty sparse. The most useful information in this case would be:
I suspect that the problem is related to your loadable kernel modules and your kmod (kernel module autoloading subsystem). It could be that there is something subtly wrong with your start up sequence so that the vfat.o, msdos.o, and related modules are not properly loading.
Tracking down the problem could be interesting. Basically you'd read through the /etc/rc.d/* scripts to find out where kmod is activated (/etc/rc.d/rc.sysinit?) and where your filesystems are mounted (find /etc/rc.d | xargs grep "mount.*-a").
This is made somewhat more entertaining by the amount of cruft that's accumulated in the Red Hat rc scripts. Some of the other distributions have somewhat cleaner, more elegant rc scripts and some of them have it even worse. When I teach classes in Linux administration, I spend about a half day on /etc/inittab and the rc* scripts.
Read those after digesting _Learning_the_bash_Shell_ (*) by Cameron Newham and Bill Rosenblatt (O'Reilly and Associates) and you'll be well prepared to troubleshoot most Linux configuration problems.
A workaround might be easier than a real fix. One work around would be to simply add the commands:
		umount /mnt/win98 ; mount /mnt/win98
		umount /mnt/win95 ; mount /mnt/win95
... to your /etc/rc.d/rc.local script. If that doesn't work try using something like:
		( sleep 120
		umount /mnt/win98 ; mount /mnt/win98
		umount /mnt/win95 ; mount /mnt/win95
		) &
This encapsulates the previous commands into a subshell (the parentheses), inserts a two minute delay at the beginning of that subshell, and runs the subshell in the background (the ampersand).
The overall effect of this would be that the troublesome mount would be left alone for a couple of minutes, and then cleared up in the background. Obviously, your win '9x filesystems wouldn't be available until after that delay.
As I say. This is a WORKAROUND. Normally installations should NOT have to do this.
Another approach would be to ensure that the modules are loaded BEFORE the mount command occurs. Usually the kmod automatic module loading system is reliable enough. However, we can always add our own 'insmod' or 'modprobe' commands commands to /etc/rc.d/rc.sysinit or to some other point in the rc scripts. Indeed we could even insert a custom rc invocation into the /etc/inittab file --- which would run before ALL of the other rc scripts.
Yet another approach is to link the requisite modules statically into your kernel. You don't have to do this with all of the modules you use (and that might result in kernels that are two big for LILO to use). However, you should statically link in your primary disk controller, primary filesystem, any ethernet driver and then the other drivers that you really care about. This is done by simply building a new kernel from sources.
(Which segues into one of your other questions).

(?) The other question has to do with hooking up to win2k with NTFS. I understand that I have to recompile my kernel, which is a bit scary. My question is: is there a good source of directions on how to do this? If there is something similar to what you showed me for Samba, it would be great!

(!) Well the usual answer for this is to head over to "The Linux Kernel HOWTO" at
http://www.linuxdoc.org/HOWTO/Kernel-HOWTO.html
... and if that seems to shoot over your head then go back to basics by reading the "Installation and Getting Started" guide by Matt Welsh et al:
The Linux Documentation Project Works
http://www.linuxdoc.org/docs.html#guide
... this guide is the first link in the guides section of the LDP (the Linux Documentation Project).
Of course every Linux user should start with the LDP guides and HOWTOs. Every general purpose Linux distribution should have links to the LDP http://www.linuxdoc.org web site prominently evident on their own web sites, in their documentation and installation scripts, in the sample HTML that's installed on any localhost web server, etc.
(Incidentally the Linux Gazette is a part of the LDP. This is relatively obscured by the fact that we run completely autonomously).
If the "Installation and Getting Started" doesn't seem to be quite enough then I'd suggest looking at Henry White's "Basic Linux Training" (http://basiclinux.hypermart.net/info-basic.html)
That's a highly structured online class. Although it requires registration (and a password) to access the content of this course --- the registration seems to be free. This class uses the Getting Started guide as a text book.

(?) Another question is: where can I obtain a decent word processor for Linux? The Redhat 6.1 didn't have anything on the CD. There are all sorts of editors, and even a spread sheet, but no word processor. It is difficult for me to return to the dark ages where I had no control over the font size, or which font I was using, which are the minimum goodies for a word processor.

Thanks,
Ilan

(!) There are several word processors for Linux. However, I should note that the whole word processor paradigm is not the only way to have control over font size and selection. It's also important to understand that word processors existed for years before GUIs and "WYSIWIG" (what you see is what you (hope to) get) were feasible.
One of the earliest uses of UNIX was document preparation and typesetting using the roff (nroff, and troff) system. This is still the format used by Linux and UNIX man pages, and some people still create and maintain their resumes in troff. A troff document consists of text with embedded "dot commands" which identify the document parts (titles, headings, sections, etc) and desired typesettings (font, face, weight, etc).
Another typesetting system which is geared for technical publications and academic work (particularly for dissertations in mathematics, physics, Klingon linguistics, etc) is Donald Knuth's TeX system (pronounced "tech" as in "tau epsilon chi"). TeX is a typesetting language. Many TeXnicians actually use the LaTeX macro package which is built around "plain" TeX. There are hundreds of packages which plug into LaTeX and dozens of TeX alternatives to it.
You can learn far more than you ever wanted to know about this approach to document preparation by browsing around the TUG (TeX Users Group) website http://www.tug.org and by perusing the CTAN (Comprehensive TeX Archive Network) website at http://www.ctan.org.
(If you need to typeset a dissertation comparing Elvish, Goblinoid, and Klingon literature, perhaps with diagrams of their respective approachs to chess, and perhaps you want to have barcode footnotes of your bibliographic references --- if you need that then CTAN is the place to go!)
I've never written anything in *roff. However I do like LaTeX, and I did use it to write my first book. It does represent a significant learning curve, but you do get very good control over the project as a whole.
So, I suggest that you look back into the "dark ages" a bit and see what arcane wisdom might be found thereby.
Now, back to your question:
The most obvious commercial and closed source choices for your word processing needs are:
Word Perfect by Corel software
http://www.corel.com
(I'd give a more specific URL, but they use nasty Javascript redirections to access their products listings so you'll just have to hunt for it yourself).
Star Office by Star Division at http://www.stardivision.com which was purchased by Sun Microsystems http://www.sun.com last year
Applixware for Linux
http://www.applix.com/applixware/linux/main.cfm
... note that you might want to wait a couple weeks for their upcoming release of 5.0
(Then again you might want to also have another word processor handy for that first couple of months after you get Applixware 5.x --- since it is a major commercial sofware release and a ".0"!).
I've used Applix (a couple of minor versions ago) and StarOffice. In fact I decided to install the Sun release of StarOffice 5.1 while I was writing this message. (I'd had a small stack of the free CDs that were given out at some LUG around here sitting next to my computer for about two months, and one of those was sitting in my workstation's CD tray for the last couple of weeks).
So, it's copying files now ... done.
StarOffice does install pretty easily. This workstation (canopus) is on a Debian (Potato) distribution. Here's how:
  1. mount the CD
  2. startx as root
  3. open an xterm
  4. changed to the /mnt/cdrom/linux/office51 directory
  5. run './setup /net'
  6. follow the on screen instructions;
    especially: select an installation path. (I used /opt/StarOffice51/)
... this creates the base system installation (about 150Mb).
Then each local user who intends to use the package must:
  1. login
  2. startx (if necessary)
  3. cd to a (site dependant) directory such as /opt/StarOffice51/bin
  4. run ./setup (without the /net option)
  5. follow the instructions and fill out the forms; pick a personal installation path (I used ~/.Office51/)
(Note: the CD doesn't seem to be required for the user installations).
This seems to install about 3Mb under my home directory. It seems to me that quite a bit of that could be replaced with symlinks but...
Anyway, StarOffice comes with word processing, spreadsheet, database, scheduler, presentation, and drawing programs. It also seems to have some features for accessing your Palm Pilot PDA.
Overall I think the whole StarOffice suite works O.K. but is a bit too cluttered. There are too many tool bars, icon ribbons, rulers, scroll bars, menu bars, status lines etc. Some, possibly most of that could be configured away, but it is not clear how you access those functions without having the various widgets constantly in your face and taking up valuable screen real estate.
When you start StarOffice it creates one window/frame into which all of the others must fit. Thus your document, dialog, spread sheet and other windows don't float on your desktop co-existing with your other X applications. They are "boxed in" and visually isolated from the rest of your desktop. This isn't much of a problem to me. I tend to give each application its own virtual screen in my window manager (mostly I've been using icewm recently --- it's very modest and mostly unobtrusive). So I have no objection to sizing StarOffice to "full screen" and let it take over almost all of my screen. I just leave my icewm menu bar at the bottom (taking up valuable screen real estate) and I use it's little screen buttons to switch to my xterm screen (O.K., I cheat! I have a couple of xterms open on that one), my Navigator screen, or to my "other" (xdvi, gv, whatever) screens.
Of course one of my xterms has a copy of 'screen' (the text mode terminal multiplexer) running in it. This is running my copy of xemacs, with my mailer and most of my other editing buffers. Other screen sessions have shell prompts, root shell prompts, and my lynx sessions. I regularly detach this screen session, yanking it over to whichever terminal session I happen to be on. So it makes rounds from text console, to xterm, to ssh session as I keep re-attaching from various locations and under various modes. (Understanding how I work my help you decide that you don't want to listen to my advice about GUI programs).
Anyway, I consider StarOffice to be acceptable, and certainly no worse then what I've seen of MS Office.
There is a free alternative. StarOffice is free as in "beer" not free as in "speech" -- you can use it around the house without paying any money but you can get the sources (yet), modify it, or redistribute it without a license from Sun).
Abiword is the premier GPL'd GUI word processor. The current version is 0.7.7.
Since you're a Red Hat user you can download the RPM file from the AbiSource web site:
AbiSource -- Linux / Intel Install
http://www.abisource.com/dl_linux_intel.phtml
You can learn lots more about this project and the company that's undertaken it at:
http://www.abisource.com
Under Debian you could install the latest Abiword using the command:
apt-get install abiword
... assuming you have your /etc/apt/sources.list configured correctly. Debian will then handle all of the downloading, installation and dependency resolution for you.
I've played with Abiword and it is pretty nice. However it is missing some fairly key pieces (such as the dialogs to control your margins and page layout. It does seem less cluttered than StarOffice's "writer" and when you use the option to turn of the "ruler" display then you can still find all the options it offered on the pull down menus. (Now if they just offered options to display the display of the tool and menu bars and offered options to pop those up with middle and "other" mouse buttons on the main text display, then we might have a really clean interface).
One of the most aggressive projects to create a new office suite for Linux is KOffice (http://koffice.kde.org) by the KDE folks. I haven't gotten this running yet. I did try to grab the RPMs and use alien to install pre-compiled binaries in the background as I was writing this message --- but I'm missing a few libraries that it wants, so I'll have to get the sources and build it all in order to test it. That will have to happen later.
There are lots of other word processing packages for Linux. Some are under development, others are commercial, some seem to be half done and abandonned projects (like Maxwell, and Papyrus). Here's a couple of URLs to browse some of them:
[freshmeat] X11/Office Applications
http://www.freshmeat.net/appindex/x11/office%20applications.html
Christopher B. Browne's Linux Word Processing
http://www.hex.net/~cbbrowne/wp.html
Goob:Software:Office
http://www.linuxlinks.com/Software/Office
(This last one appears as "Goob" in my book marks file --- so I think that is a historical name for the site).

[ Yes, it used to be called "Linux Links by Goob!" and I always assumed it started life as his personal bookmarks.
-- Heather ]

That should keep you busy for awhile.

(?) thanks

From Ilan Tal on Sun, 30 Jan 2000

Hi Jim,

The diagnostics are pretty sparse because I don't know what I'm doing!

I'm coming from the Windows world, but I'm in unfamiliar territory with Linux.

(!) Don't feel bad. When I was supporting MS Windows users full time I often got sketchy symptomology.
The thing that makes it more frustrating these days is that I'm doing it via e-mail. So the questions I want to ask and the data I need to gather in order to treat the problem involve long delays in both directions.
As Linux increases in popularity there will be many people in the same boat with you. I'll have to refer more people to interactive phone support (which is NOT free). Sometimes that will be the only sane approach.

(?) It will take me a few days to digest your letter. I will look into the problem and see if I can solve it, with the hopes of learning something along the way. If I can't solve it, then I'll go for a work around. In any case, I hope to learn something in the process - and maybe as a result next time my diagnostics won't be quite so sparse.

I VERY much appreciate all the effort you put into your answer. Now I've got to digest it by trying out all the things you suggested.

Thanks again, Ilan

(!) Many people feel a bit overwhelmed by my responses. I'm used to it. Obviously you are motivated and interested in learning more.

(?) More on Strange Mount Permissions

From Ilan Tal on Sun, 30 Jan 2000

Hi Jim,

I don't want to bother you without doing my homework, but I have run into a couple of questions which I just don't know how to solve. You answered my question about the weird file permissions when I log on, which become normal when I umount and then mount again.

First of all, my fstab is:

/dev/hda6               /                       ext2    defaults        1 1
/dev/cdrom              /mnt/cdrom              iso9660 noauto,owner,ro 0 0
/dev/hda5               swap                    swap    defaults        0 0
/dev/fd0                /mnt/floppy             ext2    noauto,owner    0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/pts                devpts  gid=5,mode=620  0 0
/dev/hda4 /mnt/win98 vfat exec,dev,suid,rw,conv=auto,uid=500,gid=500,umask=755 1 1
/dev/hda1 /mnt/win95 msdos exec,dev,suid,rw,conv=auto,uid=500,gid=500,umask=755 1 1
(!) Doh! [self: slaps forehead!]
I should have guessed!
Your problem is with those UMASK settings. I see what you intended but that not how the UMASK works. UMASK is a list of the bits to strip OFF (mask away from) the default 666 file creation permissions (777 for directories).
So a UMASK of 022 is actually what you want!
Basically consider each of the digits in the permissions set to be an octal value (three binary bits). To get the sequence rwx you have to use 4 + 2 + 1 (or 1 * 2 ^ 2 + 1 * 2 ^ 1 + 1 * 2 ^ 0 if you were to look at the binary exponents). 777 in octal is 111 111 111, and 022 is 000 010 010. The complement of your UMASK (each bit is inverted) is 111 101 101. If you and that against your default permissions (777 for directories and 666 for files) then you "strip out" the write permissions for groups and "others."
I know that this is confusing. It's one of those things that makes perfect sense to the programmers who used UNIX early one; and is something that many sysadmins and UNIX users just learn (umasks of 022 or 027 are good, most others are bad) without really understanding the underlying bit manipulations.
The easy way to calculate the effects of a umask are to subtract the desired permissions (755) from 777. That you can do in your head: 777 - 755 = 022.
Anyway, just change those 755's to 022 and everything should be fine.

(?) The other thing which I noticed about the ls -ld win98 with d----w-w- is that the owner is ilan. After I umount and mount again the owner is root. Your message actually gave me a very important clue. If, in fact, I do a simple

umount /mnt/win98; mount /mnt/win98

(!) Of course that wouldn't work. The mount command has been working right all along. It's doing exactly what the options in the fstab are saying.

(?) then nothing good happens! I am still stuck with the same garbage permissions. However if I mount as: mount /dev/hda4 /mnt/win98, THEN the permissions are OK (and the owner is root, not ilan).

(!) Of course. When you specify the device and the mount point then the 'mount' command doesn't perform a lookup in the /etc/fstab. It just mounts the filesystem according to your arguments and its compiled in defaults.

(?) I tried to extend your command (find /etc/rc.d | xargs grep "mount. *-a") to something to find the mount win98 string, but I couldn't make it work correctly. What I tried was find /etc | xargs grep "mount. win98", but aside from telling me that every entry was a directory, I didn't get anything useful. Thus I don't know where or how it mounts win98.

While I'm at such questions, I tried sending you the output of the commands (like ls -ld win98). What I found for redirection was rather complicated:

(command) 2>&1 | tee (output file)

I did all that, but each new command erased the output file. In the DOS days, I used to use (command) > (output file), or (command) >> (output file) to append to an existing file. I'm sure there must be something similar in Linux.

(!) You can use the >> operator under Linux. (Actually the operators are part of the syntax of your shell, bash, or tcsh. Theoretically someone could write a UNIX/Linux shell that used completely different syntax).

(?) Finally I tried recompiling the kernel to accommodate NTFS (read only). Your suggested source helped a lot in adding information to what I had from the official Linux documentation. Still it keeps coming back at me, at the compile stage, telling me the kernel is too big and it can't compile it.

(!) Use the 'make bzImage' option rather than the 'make zImage' choice. This is a bit of a historical artifact.
You can read the Linux Kernel Mailing List (LKML) FAQ at Tux.org (http://www.tux.org/lkml) for more on that.

(?) I suspect that this is a red herring, so I simply had to ask your opinion. I have 926 Mbyte on my Linux partition, of which no less than 95% is in use! This blew my mind, and I have 41 Mbyte free. I suspect that the real problem may be that the disk space just isn't big enough.

(!) No. That's now a problem. You should clear up some space but that's now causing the symptoms you've described to me.

(?) If this be the case, either I have to somehow exploit my win98 disk, which has loads of free space, or I need to figure out what I can dump from my Linux partition.

(!) You can symlink your home and /usr/src/linux directories into directories on one of your MS Windows partitions, though you should use the uvfat filesystem type rather than just vfat. That will impose some UNIX/Linux semantics on your MS FAT filesystems using some hidden files that the Linux uvfat filesystem driver will transparently create and maintain for you.
You might want to hunt around for information on uvfat and it's predecessor/ancestore UMSDOS. I haven't used these in years and haven't read about them recently.

(?) Another very useful suggestion in your letter was to sign up for the Linux course. This I did yesterday. Hopefully it may fill in some of the huge holes in my background. Knowing Windows just isn't enough, not by a long shot!

(!) I just saw an interesting link to Linux training providers at:
LinTraning:
http://www.lintraining.com
... which is currently just a redirection to:
LinSight: Training
http://training.linsight.com
I'm just mentioning that for the benefit of my other readers, though you can check it out if you want to shop around.
I thought about referring you to Linuxcare (which does do some training). Howevever I see from our web site that we don't currently have any classes for individuals scheduled. Our focus at Linuxcare is more on training the instructors of the training facilities, and on corporate training. So we only occasionally offer classes to the general public.
(Many of the facilities listed in LinTraining are coming to Linuxcare for their materials).

(?) Thanks, Ilan


(?) 100% correct!

From Ilan Tal on Mon, 21 Feb 2000

Hi Jim,

It took me a couple of days before I could get rid of my Windows obligations and return to the fun stuff of Linux. In any case I must report to you that YOU are right and the Linux documentation is WRONG. I am referring to your letter:

>>> /dev/hda4 /mnt/win98 vfat >>>	exec,dev,suid,rw,conv=auto,uid=500,gid=500,umask=755 1 1
>>> /dev/hda1 /mnt/win95 msdos >>>	exec,dev,suid,rw,conv=auto,uid=500,gid=500,umask=755 1 1

Doh! [self: slaps forehead!]

I should have guessed!

Your problem is with those UMASK settings. I see what you intended but that not how the UMASK works. UMASK is a list of the bits to strip OFF (mask away from) the default 666 file creation permissions (777 for directories).

Where in hell would I know what permissions to use? I must have read it somewhere, because I know NOTHING. First of all I took your suggestion, went into linuxconf and changed 755 to 22. That solved my problem COMPLETELY! No more problems with logging on, IT WORKS!

The next problem was to figure out where I got the bum steer. I went to the Linux documentation, "Getting started". I wanted to get started, right? There is a section about mounting Windows devices. That is what I needed, right? Well it says to use 755, so that is what I did. I didn't know nothin' about any UMASK, and I didn't change any UMASK. I took YOUR suggestion (in linuxconf) about using 22, and guess what? It works!

Someone should either fix linuxconf, or they should fix the documentation. One of them is simply wrong. Without your telling me where the problem was, I didn't have the chance of a snowball in hell of finding it.

Thanks, Ilan

(!) Hmm. If you could find the passage in "Installation and Getting Started" to which you are referring, we could look up the current maintainer of that LDP guide and suggest a clarification.
Matt Welsh, the original author of GS, knows at least as much about UNIX as I do (probably more). So if the passage was incorrect, it was probably an accident in the wording, or something confusing about the sentence structure. I presume that he was trying to say that you should set your umask value such that the resulting directories end up with mode 755.
As for linuxconf, don't get me started about it. I've tried it a couple of times and it just does things WRONG! I refuse to use it on my systems. I'd like a mode in linuxconf that would just "edit the files" and show me what needs to be put where. In other words it would be nice if it had interactive help, and forms to put the right stuff into the right places in things like zone, hosts, passwd, and other files. Some of these conf files can be pretty picky.
(I once let crackers create directories on a public FTP site and upload "warez" --- pirated software --- all because I had a space following a common in a WU-FTPd ftpaccess file; I was saved by some other settings that prevented them and their ilk from get back into to retrieve the warez --- but that's still a slightly spooking experience).
I suppose I should quit my kvetching and get in there to fix it, or to help with the COAS (Caldera Open Admin System). One problem with UNIX and Linux is that those of us who get good at managing the system with text conf. files have little interest in or incentive to make easier interfaces for those who don't know that a man page that specifies a syntax of "opt1,opt2,opt3..." really MEANS that there should be no spaces after those commas, etc.
Anyway, if you can find the places that lead you astray, please feel free to e-mail the maintainers of those documents and packages (linuxconf included) and let them know.


Copyright © 2000, James T. Dennis
Published in The Linux Gazette Issue 51 March 2000
HTML transformation by Heather Stern of Tuxtops, Inc., http://www.tuxtops.com/


[ Answer Guy Current Index ] [ Index of Past Answers ] greetings 1 2 3 5
5 6 7 8 9
10 11 12 13 14 15 16 17
18 19 20 21 22


[ Table Of Contents ] [ Front Page ] [ Previous Section ] [ Linux Gazette FAQ ] [ Next Section ]