How do I remove a Linux Eterm user via the command line?

Warning: As always, please exercise caution and follow best practices when performing system maintenance, especially when initiating processes that can potentially delete data.

Easy Procedure: Remove a User (Recommended)

  • Log into your server as root
  • Remove the user (where username is the user you wish to remove):
userdel username

If you prefer the graphical interface, you may perform the same function via the GUI.

Advanced Procedure: Remove a User and Home Directory

The above command does not remove the user’s home directory, because it often contains important database files. If you would like to remove both a user and their home directory, you must first verify that your users are not configured to use the database directory as their home directory:

  • Log into the server as root
  • Verify the user’s home directory (where username is the user whose home directory you are checking):
echo ~username
  • If the output displays /u2/eclipse or anything other than /home/usernamedo not continue. This user’s home directory is the shared database directory. You must use the procedure above to remove only the user. Contact Eclipse Support with any questions.
  • If the output displays /home/username, you may proceed with the procedure and remove the user and their home directory:
userdel -r username

Why can’t I remove a Linux logical volume?

If you are unable to unmount or lvremove a logical volume, verify that there are no processes holding the LV.

Locate the major/minor numbers for the logical volume you’re trying to remove (ie lvol0):

dmsetup info -c | grep lvol0

Take note of the 5th column, which indicates if a volume is “open,” and the 2nd and 3rd columns, which are the major and minor IDs, respectively. For example:

[root@eclipse ~]# dmsetup info -c | grep lvol5
datavg-lvol5         253  24 L--w    1    1      0 LVM-4WlscxDDEw5R9IvjgZYpu5FQeW9h835ADtQzXFr3cJ6SHEcgS4NFMxzaSKjUkedy
datavg-lvol5-cow     253  27 L--w    1    2      0 LVM-4WlscxDDEw5R9IvjgZYpu5FQeW9h835ADtQzXFr3cJ6SHEcgS4NFMxzaSKjUkedy-cow

Find any process attached to this volume by searching on the major and minor IDs discovered above:

lsof | grep "major,minor"

For example:

[root@eclipse ~]# lsof | grep "253,24"
beremote  14524      root   15r      BLK             253,24                1835186 /tmp/filehRrCD8 (deleted)

Shut down or kill any process still accessing the volume to continue unmounting and removal.

If no processes show as accessing the volume in lsof, check to make sure nothing is sharing the filesystem (i.e. rsync, nfs, or samba).

If you have verified that no processes are holding the LV open, verify that the LV is not mounted somewhere:

cat /proc/mounts

If the volume appears in the output, unmount it using the umount command.
For further assistance, please contact Red Hat for support