Linux LVM: Reduce Filesystem and Logical Volume
March 14, 2012 – 5:07 pm | No Comment

The following example shows how to reduce the size of a filesystem mounted on an LVM logical volume. The instructions below are only for non-root filesystems. No reboot is required, but the filesystem will need to be unmounted. So, if there are any user applications using this filesystem, they will need to be stopped and the users will need to log out.

Read the full story »
Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Archive by Category

Articles in Commands & Shells

Moving filesystems with ufsdump
November 19, 2005 – 11:22 pm | No Comment
Moving filesystems with ufsdump

to move /opt on new partition (disk or file system)
1) from system prompt: format –> partition –> label
2) newfs -v /dev/dsk/c0t1d0s1 (target location)
3) mkdir /new_dir
4) mount /dev/dsk/c0t1d0s1 /new_dir
5) cd /new_dir
6) ufsdump 0f – /opt | …

Copying directories using tar and rsync
November 19, 2005 – 11:20 pm | No Comment
Copying directories using tar and rsync

In this example we use the tar command to copy the contents of the /export/home directory to /temphome. This particular syntax forgoes the creation of an actual tarball file. This can be useful if you …

Using more on multiple outputs
November 19, 2005 – 11:19 pm | No Comment
Using more on multiple outputs

Here’s the correct way to page four commands so they’re all controlled by “more”:

?View Code BASH(date; netstat -i; whodo; ps -ef) | more

Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit …

Count users with “last”
November 19, 2005 – 11:15 pm | No Comment
Count users with “last”

Here is a quick example showing how to count users logged in on a particular date using the “last” command on Linux.

To display file’s modification, last access, etc
November 19, 2005 – 11:14 pm | No Comment
To display file’s modification, last access, etc

?View Code BASHtruss -vlstat -tlstat ls -l [file name]

Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post

Create tarball
November 19, 2005 – 10:42 pm | No Comment
Create tarball

The Unix tar command creates an archive of files and directories while preserving directory structure, file permissions and ownership information. This command is ideally suited for creating backups of most types of data. Many open-source …

Check if Solaris supports 64-bit applications
November 19, 2005 – 10:41 pm | No Comment
Check if Solaris supports 64-bit applications

isainfo -v
Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post

Remotely mount cdrom
November 19, 2005 – 10:39 pm | No Comment
Remotely mount cdrom

share -F nfs -o ro,anon=0 /cdrom/cdrom0
mount -o ro server:/cdrom/cdrom0 /cdrom
if target server responds: RPC: Program not registered
do
/etc/init.d/nfs.server start
Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about …

Useful awk one-liners
November 19, 2005 – 10:38 pm | One Comment
Useful awk one-liners

?View Code BASH<em>pattern matching and processing </em>
 
<strong>awk ‘pattern {action}’ filename </strong>
 
reads one line at a time from file, checks for pattern match, performs action if pattern matched <em>pattern</em>
 
NR is a special awk variable meaning the …

Copy directory structure and files with cpio
November 19, 2005 – 10:38 pm | No Comment
Copy directory structure and files with cpio

find /full_source_path -depth -print | cpio -pudm /full_target_path
Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post

Using FTP with pipes
November 19, 2005 – 10:37 pm | No Comment
Using FTP with pipes

Pipe in Unix is a method of passing information from one command to another. The pipe take the output of the first command and sends it as input for the second command. The a second …

Create TAR and pipe through gzip
November 19, 2005 – 10:36 pm | 2 Comments
Create TAR and pipe through gzip

tar cvf – . | gzip > target.tar.gz
Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post