More Misc Linux Questions...
1. What would happen if I did a swapoff when other
processes are running? A Bad Thing? 2. What happens if I kill init (if possible)? 3. Are the settings in /etc/fstab visible only to the mount command does the mount() system call itself read this file? 4. How to check what kernel modules are active ( loadable types or otherwise)? 5. I can't access a device which I created w/ mknod. for eg after I mknod myfile b 7 16 to create my own loopback device file, I can't access it. Any operations on myfile would give a 'not a valid device' error message. I noticed that when I do an ls -l, the owner is listed as my userid (root), but when I ls -al the /dev dir, the owner is given as 'floppy' or 'disk' etc. How do I fix this? |
1) I would hazard a guess that you could possibly get away with it if you have enough RAM and you aren't doing anything memory intensive.
4) I don't know what you mean by 'or otherwise', but to view what modules are being used, you type lsmod. |
2 I guess it'll restart. But I'm not sure (haven't tried it).
|
1. If you have enough memory available then swapoff is save to do even if the swapfile is being used. If however it's swapping because there is not enough memory available then running swapoff could cause problems.
2. Init is the parent of most processes so it has to stay running. That's why it's also impossible to kill it. Not even with a SIGKILL. 3. The /etc/fstab file is just a text file. Usually the mount command will look in this file but it isn't necessary. The mount command keeps record of the mounted filesystems in the /etc/mtab file. This is also just a text file so you can just view the contents. 4. Like Thymox said lsmod lists the loaded modules. If you want to see which modules are available. Just run the following command to go to the kernels module directory and browse around: cd /lib/modules/`uname -r` 5. Just making a device file is usually not enough. You have to either enable the support for it in the kernel or load the appropriate module. If you want to change the owner/group of a file then run the command: chown username.groupname filename |
Quote:
|
All times are GMT -5. The time now is 06:13 PM. |