Softpanorama

May the source be with you, but remember the KISS principle ;-)
Contents Bulletin Scripting in shell and Perl Network troubleshooting History Humor

Suse Tips

News

Linux Tips

Shell Tips

VIM Tips

Screen tips

MC tips

Humor

Etc

There are several large collection of Linux Tips on the Internet. Among them:

For YUM tips one can look at Yum - Linux@Duke Project Wiki

LinuxGazette regularly publishes tips column. See for example More 2 Cent Tips! LG #106


Top Visited
Switchboard
Latest
Past week
Past month

NEWS CONTENTS

Old News ;-)

[ Jan 28, 2013] Dumping tmp

27-Nov-2010

please_try_again

You can also instruct the system to delete them automatically at boot:
in YaST, select : System -> /etc/sysconfig Editor
+ System
+ Cron
CLEAR_TMP_DIRS_AT_BOOT = yes

caleb782734:

> Can I just go in a delete all the files in tmp? Or, do I need to be
> more careful? I noticed that a lot of flv fragments go in there. I did
> just delete those because I couldn't see how they could be useful again.
> What about all the other stuff? Any advice would be awesome...
>
>

You can install tmpwatch from the OSS repo.

Then just run a cron job like

@hourly /usr/sbin/tmpwatch -maf 72 /tmp

This will once an hour remove all files older than 72 hours.

You can change the parameters to your liking, man tmpwatch.

Vahis
--
http://waxborg.servepics.com
openSUSE 11.3 (x86_64)
2.6.34.7-0.5-default

DenverD

NO you can not just delete the files in /tmp in a running system!

you MUST boot from another system (say a live CD) and mount then
navigate to the /tmp directory and delete..

that is to say that a LOT of the files and directories under /tmp
*ARE* in use by the system...deleting them WILL cause problems..

do NOT do it..

the below will work:

> You can also instruct the system to delete them automatically at boot:
> in YaST, select : System -> /etc/sysconfig Editor
> + System
> + Cron
> CLEAR_TMP_DIRS_AT_BOOT = yes

[Jan 28, 2013] Remote Control on SLED 10 Novell User Communities

Novell Support TID: TID#3527459: Remote Control on SLED 10

Here's a new tip from Novell Support that explains how to use the Remote Control option (vnc server component) in the gnome-control-center and the terminal server client (vnc-viewer component).

[May 11, 2010] DenyHosts to secure from SSH Brut force attacks

March 24, 2010

DenyHosts is a free opensource utility to secure your SuSE server or your openSUSE system from Brut-force attacks on the SSH server running on your system. DenyHosts works by updating the /etc/hosts.deny file on your SuSE or openSUSE system with the IP address of a host after a set number of failed login attempt from it.

[May 10, 2010] Suse Tips Microsoft Web Fonts in openSUSE 11.0

In order to use the Microsoft Web Fonts in openSUSE 11.0 do the following

Open a terminal

cd
wget http://download.opensuse.org/update/10.3/scripts/fetchmsttfonts.sh
sudo sh fetchmsttfonts.sh

When done, remove fetchmsttfonts.sh

[Feb 8, 2010] Reset your SLES-openSUSE Linux default file system permissions

Novell User Communities

Let's say you've cd to / and chown -R me:users * and you now have a system that has corrupted permissions. Have no fear, the SUSE team is here to the rescue. Simple run this command as root and you'll be back up and running in no time:

SuSEconfig --module permissions

[Aug 7, 2009] atd daemon is not running on Suse 10 SP2 by default, so command at fails

It needs to be manually enabled, if we need consistency with the Solaris behavior.

Configuring Apache using YaST, openSUSE 10.2

YaST « Bozzie Software

Filed under: Apache, SUSE, Subversion, SysAdmin, YaST, opensuse — Bozzie @ 3:36 am

I configure Apache2 on openSUSE with YaST rather than editing the configuration files directly. If this is your first time installing Apache on openSUSE, I highly recommend it. YaST is a big time-saver for two aspects of Apache configuration: the initial installation and adding, enabling, and disabling server modules. A default server configuration supporting Perl and PHP can be up and running in less than an hour using YaST.

YaST isn’t good at all facets of Apache configuration so some editing of conf files may eventually be needed. If manual editing is required, why not use it exclusively? Because once you go manual, you can’t switch back to YaST when major changes are needed. I like the fact that if I install a new web application that needs several additional Apache modules, I can use YaST to enable them in a couple of minutes, often without having to learn anything about them.

I also like the fact that using YaST to configure Apache will give me a configuration closely matched to thousands of other openSUSE Apache servers. This makes it likely that I will get a functional, robust httpd set up at the start. Then I can incrementally add modules and customizations as needed, testing as I go.

Following is a YaST-based recipe to install a straightforward httpd configuration with Perl, PHP, and mod_userdir enabled. Subversion, WebDAV, and virtual host support are also added (using some conf file editing). Finally, the added bookkeeping steps that allow YaST and hand-edited conf files to co-exist are presented.

Part I: Content-Independent Configuration

Part 1 installs a functional (but empty) httpd server with all modules and parameters properly configured. Connections to the site-specific content are discussed in Part 2.

  1. OpenSUSE scatters Apache conf files among /etc/apache2 and its conf.d, sysconfig.d and vhosts.d sub-directories. Keep a copy of the original conf files to determine what YaST has done and add source code control repositories to manage manually edited files:
    • cd /etc/apache2
    • mkdir ORIG; cp -p *.conf ORIG
    • mkdir RCS
    • Repeat for the three “.d” subdirectories.
  2. Start YaST/ Network Services/ HTTP Server:
    • Turn on php, perl, python and/or ruby in a special configuration page that only appears once (one can still turn these on/off later, but it’s easier to do here).
    • Accept defaults in the Server Wizard (5 pages), except choose Start When Booting on page 5.
    • Click Advanced Configuration.
    • In the Server Modules tab, enable dav, dav_fs, info, rewrite and status.
    • Needed to Add Module for dav_svn but the YaST screen would not accept input, so I hit Finish (will add in Step 3).
    • The server starts. http://localhost just says “It works!” instead of the normal Apache welcome page. Didn’t like this so I copied index.html from an old SUSE 10.0 installation.
    • Read the comments in all of the /etc/apache2/conf.d/*.conf files, some of which are controlled by IfDefine blocks. For my installation, I learned I needed to add the SVN_DOC and SVN_VIEWCVS flags (next step).
  3. Start YaST/ System/ sysconfig Editor:
    • Select Network, WWW, Apache2.
    • Highlight APACHE_MODULES. Add dav_svn into the Modules line. Note: Don’t hand-edit dav_svn into /etc/apache2/sysconfig.d/loadmodule.conf, as YaST will just remove it next time it runs.
    • Highlight APACHE_SERVER_FLAGS. Type “SVN_DOC SVN_VIEWCVS” into the text field.
    • Finish.
  4. A diff of ORIG/default-server.conf with the one YaST created shows that YaST removed the mod_userdir section, changed indents, and added ServerName and ServerAdmin. Thus I chose the original distribution .conf as my starting point:
    • mv default-server.conf{,.YAST}
    • cp ORIG/default-server.conf .
    • ci -l default-server.conf
    • Edit with a text editor and copy the ServerName and ServerAdmin directives from the YaST version into default-server.conf.
    • ci -l default-server.conf
  5. Restart YaST/ Network Services/ HTTP Server:
    • Select the Server Modules tab and verify that the dav_svn module appears.
    • Exit or Abort.
    • Note: from this point forward, if YaST/HTTP Server is re-run and Finish is clicked, default-server.conf and /etc/sysconfig/apache2 will be overwritten. Capture a snapshot before running or retrieve original from RCS archive afterward.
  6. Check the syntax of all configuration files and reload httpd:
    rcapache2 restart-hup
  7. Browse http://localhost/server-info and server-status. Verify all desired modules are present and running.
  8. Browse //localhost/manual and localhost/svn-manual to see documentation.

The content-independent phase of installation is complete.

Part II: Serving Local Site Content

To prepare for Part 2, load all content files that are outside of the server document root (e.g. Subversion repositories, WebDAV directories, and user public_html areas). I keep my Subversion repositories under /home/wwwrun/svn, giving them the same owner and group as the httpd process.

  1. Verify that browsing a http://localhost/~<username> directory works.
  2. Subversion repository configuration goes in the /etc/apache2/conf.d/subversion.conf file. I piggybacked the WebDAV configuration into this file rather than creating a separate file: subversion.conf. Also, I add Basic Auth to ViewVC in subversion.viewvc.conf (see earlier blog entry for an explanation).
  3. Use htpasswd2 to create the basic authentication password file.
  4. Create a /var/lock/apache2 directory (user wwwrun, group www).
  5. rcapache2 configtest
  6. rcapache2 restart-hup
  7. Browse http://localhost/svn/<reponame>. Username and password are requested and the repository appears. Run RapidSVN from a Windows machine to verify connectivity.
  8. Edit /srv/viewvc/viewvc.conf to add root or root_parents, default root, and mailto.
  9. Browse http://localhost/viewvc , username and password are requested, then the ViewVC page appears. Click on the “ViewVC Help” hyperlink and the documentation appears.
  10. Using Konqueror, browse webdav://localhost/fs and a folder view of the WebDAV folder appears.
  11. See this blog entry for details of connecting to WebDAV via WindowsXP.

All of my local Subversion, WebDAV, and web page content is now available via Apache.

Part III: Virtual Hosts

Finally I’ll add virtual hosts for my various development, prototype, and staging areas. The YaST HTTP Server GUI offers a screen to do this, but I chose to start with the as-delivered file just as with default-server.conf.

  1. Create a new conf file in /etc/apache2/vhosts.d (e.g. LLvhost.conf in my case). I copied the vhost.template as the starting point.
  2. I defined four virtual servers:
    • localhost - contains only a ServerName statement to serve as the default server.
    • llxxx - three name-based servers that have document roots in various code development sub-directories. Each of these gets a separate set of error and access log files.
  3. Uncomment the NameVirtualHost *:80 line in /etc/apache2/listen.conf.
  4. Add the three name-based server names to /etc/hosts as synonyms for localhost.
  5. rcapache2 configtest
  6. rcapache2 restart-hup
  7. Browse http://llxxx and the virtual host content appears. Verify that log information appears in the correct file pair in /var/log/apache2.

Part IV: Configuration Control and Maintenance

The Apache server installation is now complete. But adding source code control is necessary to safely re-run YaST/ Network Services/ HTTP Server Configuration in the future. Whenever HTTP Server Configuration is ended with Save or Finish, any of the conf files may be overwritten, obliterating prior manual edits. Source code control allows us to manage and resolve this conflict.

Using the unaltered conf files in the ORIG directories as references, perform a diff of all of the conf files to learn which have been customized. Any altered conf files that were hand-edited should be placed under configuration control (e.g. CVS, Subversion, RCS). Consider controlling the YaST-altered files as well.

I maintain five files in RCS: default-server.conf, mod_userdir.conf, subversion.conf, subversion.viewvc.conf, LLvhost.conf. After saving any new HTTP Server Configuration session, I use rcsdiff to learn what changes have been made to these files. Review the changes and either restore the last version from RCS or check in a new revision as appropriate.

How To Disable ZENworks ZMD, openSUSE 10.2

Filed under: SUSE, SysAdmin, opensuse — Bozzie @ 5:41 pm

The openSUSE 10.2 update repository that I was connected to stopped receiving updates from the mother ship in late November. I checked some other mirrors and found them to be in the same state. Only the main ftp.suse.com repository is current (as of this post). I could find no mention of this problem on openSUSE.org.

This problem plus the announcement of openSUSE 11.0 Alpha caused me to reconsider my upgrade plans. I am happy with 10.2 but was planning to upgrade to 10.3 solely to eliminate the nightly 1.5 hour zmd update runs (which I’ve complained about at length in a previous post).

Since I am now going to have to poke around with updating anyway, I decided to look once more for instructions on how to disable the ZENworks ZEN management daemon (zmd). If I succeed in turning off zmd, I may skip the 10.3 release entirely and go directly from 10.2 to 11.0.

I found this openSUSE-Community.org article which provides simple instructions for disabling and removing zmd. Using it as a guide, I performed the following steps:

  1. rczmd stop - this stopped zmd. Hallelujah! I’ve never known how to do this before now.
  2. Start the YaST, Software, Installation Source GUI.
  3. Add ftp.suse.com/pub/suse/update/10.2 as a new catalog.
  4. Disable (status = Off, update = Off) the old (utah.edu) mirror catalog. This catalog can be removed once the ftp catalog is working.
  5. Uncheck the “Synchronize with ZENworks” check box.
  6. Click Finish.
  7. The catalog information was successfully downloaded from ftp.suse.com, new updates appeared in the updater applet, and were successfully applied. Everything seems to be working.
  8. I restarted the Installation Source GUI and was dismayed to see the “Synchronize with ZENworks” box still checked. Don’t know if it is still turned on, or if the GUI is just urging me to turn it back on.
  9. Leaving zmd turned off but still installed, I let the system run for a few days until I verified that newly released updates from openSUSE were reported in the updater applet.
  10. Once verified, I removed the zmd related packages as described in the article:
    rpm -e zmd libzypp-zmd-backend sqlite-zmd rug zen-updater
  11. Restarted the Installation Source GUI: the “Synchronize with ZENworks” box is now grayed out.
  12. Rebooted; start-up works fine without ZENworks zmd.

Updater Applet:

If you are running KDE, you may need to perform the following step:

  1. Switch the panel updater applet (controlled by /etc/sysconfig/sw_management) from zlm (the zen-updater update manager) to opensuse.

I had already done this manually during my previous battles with zmd, but I have some recollection that it will happen automatically if the zen-updater application isn’t found. For Gnome, I don’t know what applet (if any) will appear in the panel.

SMART smartd Configuration, openSUSE 10.2

Filed under: SUSE, SysAdmin, opensuse — Bozzie @ 8:10 pm

Stumbled across smartd in YaST/System/System Services (runlevel) and turned it on. In addition to monitoring the long-term health trend of the disk, SMART also provides interesting real-time information about the hard drive: total hours, number of power cycles, current temperature, etc. I liked smartmontools so much that I also installed it on my WindowsXP machines, along with HDD Health.

I configured /etc/smartd.conf after reading the smartd.conf and smartctl man pages, the smartd log entries in the messages file, and comments within the file itself. Current setup:

  /dev/sda -d sat \
  -a -o off -S on \
  -s (O/../.././07|S/../.[27]/./08|L/.[02468]/15/./08) \
  -m root@localhost -M test

Notes on the configuration parameters:

  1. -d sat - lots of testing to determine this should be sat (SCSI to ATA Translation) and not ata. The various man pages are vague, with one saying “follow the hints appearing in the log file.” Well, the hint in my log file said “use -d ata or -d sat” (sigh). Both seemed to work, so I began with sat since the libata library is present. Subsequent tests of ata produced command failure messages in the log, thus sat is correct.
  2. -a - turn on the default recommended set of monitoring functions.
  3. -S on - “S” is variously described as “turning on SMART” or “turning on Attribute Autosave”. I believe this is a modal parameter within the disk drive itself, and starting smartd turns this on by default. The manual recommends adding to the configuration to ensure it doesn’t get shut off. It echoes “enabled SMART Attribute Autosave” to messages, reassuring me that SMART is running.
  4. -o off - “o” controls “SMART Automatic Offline Testing” (data collection really, not testing). The man page says this command is obsolete and that the collection intervals are chosen by the disk manufacturer. The “O” offline test (discussed next) causes the same data to be collected.
  5. -s REGEXP - schedule various off-line tests My schedule: O (offline immediate), every day, 7am; S (Short), every 5 days, 8am; L (Long) - 15th of alternate months. I haven’t discovered what the differences are between the short and long tests (for my disk the short test takes 2 minutes vs. 98 minutes for the long test).
  6. -m, -M - email address for important messages. “-M test” sends an email on startup to confirm everything is working.
  7. -i N - (command line only, not conf file) set the interval for polling the disk. Seems like this shoud be controllable from the conf file, but since it isn’t I’m staying with the default of 30 minutes.

Notes:

On Linux, “smartctl -c” always showed a failure in the offline data collection status:

(0×05) Offline data collection activity was aborted by an interrupting command from host.
Auto Offline Data Collection: Disabled.

Examining the messages file shows auto-collection being enabled and the scheduled offline collection being started. Everything seems normal, but auto-collection becomes disabled at some point. On two WindowsXP PCs, data collection activity completes normally and Offline Collection is enabled. I don’t know how auto-collection was enabled on these two machines; perhaps HDD Health did it.

Is the Linux collection failure connected with auto-collection becoming disabled? First attempt at solution: switched from “-o on” to off after realizing that my scheduled testing ran the same test. Changed short test schedule to one per week in case it was causing the interruption. The problem has gone away and smartctl now reports “data collection activity was completed without error”.

References:

[Dec 14, 2008] Cool Solutions Using ClusterSSH to Perform Tasks on Multiple Servers Simultaneously By Martijn Pepping

Problem:

As an administrator of SLES/OES Linux clusters or multiple SUSE Linux servers you are probably familiar with that fact that you have to make an identical change on more than one server. Those can be things like editing files, execute commands, collect data or some other administrative task.

There are a couple of way to do this. You can write a script that performs the change for you, or you can SSH into a server, make the change and repeat that task manually for every server.

Now both ways can cost an extended amount of time. Writing and testing a shell script takes some time and performing the task by hand on lets say five or more servers also costs time.

Now, wouldn't it be a real timesaver when you have only one console in which you can perform tasks on multiple servers simultaneously? This solution can be found in ClusterSSH.

Solution:

With ClusterSSH it is possible to make a SSH connection to multiple servers and perform tasks from one single command window, without any scripting. The 'cssh' command lets you connect to any server specified as a command line argument, or to groups of servers (or cluster nodes) defined in a configuration file.

The 'cssh' command opens a terminal window to every server which can be used to review the output sent from the cssh-console, or to edit a single host directly. Commands given in to the cssh-console are executed on every connected host. When you start typing in the cssh-console you'll see that the same command also show up on the commandline of the connected systems.

The state of connected systems can be toggled from the cssh-console. So if you want to exclude certain hosts temporarily from specific command, you can do this with a single mouseclick. Also, hosts can be added on the fly and open terminal windows can automatically be rearranged.

One caveat to be aware of is when editing files. Never assume that file is identical on all systems. For example, lines in a file you are editing may be in a different order. Don't just go to a certain line in a file and start editing. Instead search for the text you want to exit, just to be sure the correct text is edited on all connected systems.

Example:

Configuration files section from the man-page:

/etc/clusters

This file contains a list of tags to server names mappings. When any name is used on the command line it is checked to see if it is a tag in /etc/clusters (or the .csshrc file, or any additional cluster file specified by -c). If it is a tag, then the tag is replaced with the list of servers from the file. The file is formatted as follows:

<tag> [user@]<server> [user@]<server> [...]

i.e.

# List of servers in live

live admin1@server1 admin2@server2 server3 server4

Clusters may also be specified within the users .csshrc file, as documented below.

/etc/csshrc & $HOME/.csshrc

This file contains configuration overrides - the defaults are as marked. Default options are overwritten first by the global file, and then by the user file.

Environment:

ClusterSSH can be used to any system running the SSH daemon.

[Nov 30, 2007] freshmeat.net Project details for Expect-lite

About:
Expect-lite is a wrapper for expect, created to make expect programming even easier. The wrapper permits the creation of expect script command files by using special character(s) at the beginning of each line to indicate the expect-lite action. Basic expect-lite scripts can be created by simply cutting and pasting text from a terminal window into a script, and adding '>' '

Release focus: Major feature enhancements

Changes:
The entire command script read subsystem has changed. The previous system read directly from the script file. The new system reads the script file into a buffer, which can be randomly accessed. This permits looping (realistically only repeat loops). Infinite loop protection has been added. Variable increment and decrement have been added to support looping.

Author:
Craig Miller [contact developer]

[Nov 30, 2007] Got more than a gig of RAM and 32-bit Linux Here's how to use it By Bruce Byfield

September 21, 2007 | Linux.com
Nowadays, many machines are running with 2-4 gigabytes of RAM, and their owners are discovering a problem: When they run 32-bit GNU/Linux distributions, their extra RAM is not being used. Fortunately, correcting the problem is only a matter of installing or building a kernel with a few specific parameters enabled or disabled.

The problem exists because 32-bit Linux kernels are designed to access only 1GB of RAM by default. The workaround for this limitation is vaguely reminiscent of the virtual memory solution once used by DOS, with a high memory area of virtual memory being constantly mapped to physical addresses. This high memory can be enabled for up to 4GB by one kernel parameter, or up to 64GB on a Pentium Pro or higher processor with another parameter. However, since these parameters have not been needed on most machines until recently, the standard kernels in many distributions have not enabled them.

Increasingly, many distributions are enabling high memory for 4GB. Ubuntu default kernels have been enabling this process at least since version 6.10, and so have Fedora 7's. By contrast, Debian's default 486 kernels do not. Few distros, if any, enable 64GB by default.

To check whether your kernel is configured to use all your RAM, enter the command free -m. This command gives you the total amount of unused RAM on your system, as well as the size of your swap file, in megabytes. If the total memory is 885, then no high memory is enabled on your system (the rest of the first gigabyte is reserved by the kernel for its own purposes). Similarly, if the result shows over 1 gigabyte but less than 4GB when you know you have more, then the 4GB parameter is enabled, but not the 64GB one. In either case, you will need to add a new kernel to take full advantage of your RAM.

Random templates for commands

[Nov 1, 2007] Use range SPident -v to SPindet -vvvv to create baseline of installed packages (SLES only)

You can specific form one to four v and get more and more detailed reports that documens what is installed on the server.

Browse forums.suselinuxsupport.de -- a lot of useful info

Use Smart

Somebash tips

Reading another forum someone pointed this out what a great find a few in here I could see myself using.

http://www.deadman.org/bash.html

Just a few snippets
history => returns a list now you can use the number
!N => where N is the number

Wish to rerun that command
!!

Wish to change that command slightly because of a typo
command that/went/wrong
^wrong^right => Now executes the previous command replacing wrong with right

cp filename filename-old
Now becomes
cp filename{,-old}

Read on been an eye opener for me, see some useful ones in here.

Usefull links for SuSE users in general

Access Your openSUSE Desktop from Anywhere Using FreeNX

Install Downloaded RPM in YAST

by Scott Morris @ 11:11 am. Filed under yast, SUSE Tips & Tricks

Sam wrote in asking me a great question. Sometimes you have a stand-alone RPM that you have downloaded. The problem now is how to get it installed, especially if you want dependencies to automatically be resolved.

Hi Scott,

I want to thank you for writing the “Easiest Linux Guide Ever”. You are a felicitous writer.

If I’m not taking much of your time, I wanted to tell you that I still can’t figure out how to use YAST to install Flash 9.0 (RPM package).

If you can tell me, or point out to me how to proceed, I’d be much obliged.

Sam

Sam,

Thanks! I’m glad you enjoy the writing.

There are two things you could do. You can either install it from the command line using RPM, for example:

rpm -Uvh flash-rpm-package-here.rpm

The problem here is that it doesn’t automatically install dependencies.

The other thing is that you can create your own installation repository (super easy) with createrepo. Install the createrepo package. Then, you create a directory which you will use as the repository. Dump the RPM in there. Then, you run the createrepo command on that directory. For example, you make a directory called /my_inst_src. You then place the flash rpm in there. Then run this command:

createrepo /my_inst_src

You then go into YAST and add that directory as an installation source.

You should now be able to go into YAST and install it just like you do any other RPM. Dependencies should be resolved as usual, should any exist.

Hope that helps.

Scott

[Comments (6)] [link]

Mounting USB Partition in openSUSE Linux

by Scott Morris @ 6:46 am. Filed under How-To, General Linux, General SUSE, SUSE Tips & Tricks

Once upon a time, I wrote a short tip on how to quickly and easily mount a USB stick, pen drive, jump drive, card reader or whatever from a command prompt in openSUSE Linux. There was just a slight problem (or two) with the way I suggested doing this. One such issue is that when you go to access the drive as a regular user, it is read-only.

In most cases, when you put a USB stick into your USB port on a machine running openSUSE, a window will appear asking what you’d like to do. This is done by the Hardware Abstraction Layer service running in the background.

However, what about cases where you need to manually mount a USB stick? For example, if you have a custom-compiled kernel module that you need to load off a USB stick during installation, what do you do? HAL ain’t gonna save your bacon. You’ll want to know how to get the USB stuff up and cracking very quickly with minimal fooling around.

This is a quick re-write of my last tip, except that it is easier for users with regular accounts to work with the USB stick.

In your /proc directory, there is a file called partitions. To see which partitions are available to the system at any given time, you can do cat /proc/partition at a terminal. With no USB sticks plugged in, mine looks like this:


[2001][scott@desk:~]$ cat /proc/partitions
major minor  #blocks  name

   3     0  195360984 hda
   3     1      40131 hda1
   3     2    1959930 hda2
   3     3   29302560 hda3
   3     4  164055780 hda4
[2001][scott@desk:~]$

Now, when I plug in a USB stick (or card reader with a card inserted), this is what I get:


[2001][scott@desk:~]$ cat /proc/partitions
major minor  #blocks  name

   3     0  195360984 hda
   3     1      40131 hda1
   3     2    1959930 hda2
   3     3   29302560 hda3
   3     4  164055780 hda4
   8     0     124048 sda
   8     1     123888 sda1
[2020][scott@desk:~]$

You can see that sda and sda1 were added. sda refers to the drive. It’s the sda1 that we care about. Just add /dev/ to the front of that to get the partition we want to mount. Our partition is /dev/sda1.

Next, we just pick a place to mount it to. As su I just create a directory called /media/usbstick or something similar. Then, you run your mount command as su with this syntax:

mount -t [filesystem type] [usb stick partition] [target mount point] -o rw,nosuid,nodev,noatime,uid=1000,utf8,shortname=lower

If I were mounting the USB stick as /dev/sda1 onto the mount point /media/usbstick, this command would look like this:

mount -t vfat /dev/sda1 /media/usbstick -o rw,nosuid,nodev,noatime,uid=1000,utf8,shortname=lower

In most cases, vfat for the filesystem type for a USB stick should work just fine (unless you know it to be something else).

After you run this command, you should be in business. You can open a terminal as your regular user and change and modify the USB partition with minimal trouble.

If you wish to have this USB partition mounted automatically, you can edit your /etc/fstab file to do this.

As su, open your /etc/fstab file in your favorite text editor. Add a line, with this syntax:

[usb stick partition]            [target mount point]      auto       auto,user

If using /dev/sda1 as my usb stick partition and /media/usbstick as my target mount point, I would put this into my fstab:


/dev/sda1            /media/usbstick      auto       auto,user

The only thing you really need to know about this is that it makes it so that regular users can mount the USB stick. Of course, the user who mounts it is considered as the owner of the partition and its files (at least in the case of the USB stick).

Save your file and exit. Then, to mount it, just run the following command (as a normal user, even):

mount /media/usbstick

You will then notice that your user has full access to the USB stick.

To Review:

  1. cat /proc/partitions - find the partition of your USB stick
  2. make a mount point (perhaps in /media) to which you will mount the USB stick
  3. for user accessibility, edit your /etc/fstab file
  4. mount the usb stick

Most of the time, when you plug in a USB stick or card reader (with a card in it), SUSE will just pop open a window asking you if you want to see the contents of the device. However, in cases where that does not happen, or you are using a distribution that doesn’t do that, this is one way to mount a USB partition.


Recommended Links

Softpanorama hot topic of the month

Softpanorama Recommended

Tips and Tricks - openSUSE

SUSE Tips- Nautilus Shortcut Keys

Suse Tips- Microsoft Web Fonts in openSUSE 11.0

Recover Root Password - openSUSE



Etc

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available in our efforts to advance understanding of environmental, political, human rights, economic, democracy, scientific, and social justice issues, etc. We believe this constitutes a 'fair use' of any such copyrighted material as provided for in section 107 of the US Copyright Law. In accordance with Title 17 U.S.C. Section 107, the material on this site is distributed without profit exclusivly for research and educational purposes.   If you wish to use copyrighted material from this site for purposes of your own that go beyond 'fair use', you must obtain permission from the copyright owner. 

ABUSE: IPs or network segments from which we detect a stream of probes might be blocked for no less then 90 days. Multiple types of probes increase this period.  

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least


Copyright © 1996-2016 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License.

The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to make a contribution, supporting development of this site and speed up access. In case softpanorama.org is down you can use the at softpanorama.info

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.

Last modified: August 13, 2017