UpFront

The UpFront Section

UpFront

Tech Tip

If you try to unmount a partition and get a message like this:

# umount /media/usbdisk/
umount: /media/usbdisk: device is busy

use the lsof command to find out what programs are using what files:

# lsof /media/usbdisk/
COMMAND  PID USER  FD TYPE DEVICE SIZE NODE NAME
bash    6925 root cwd  DIR   8,17 4096    1 /media/usbdisk/
xmms    6979 root cwd  DIR   8,17 4096    1 /media/usbdisk/

This shows that the programs bash and xmms are using the device. For an even clearer picture, use the device name rather than the mountpoint:

# lsof /dev/sdb1
COMMAND  PID USER  FD TYPE DEVICE    SIZE NODE NAME
bash    6925 root cwd  DIR   8,17    4096    1 /media/usbdisk
xmms    6979 root cwd  DIR   8,17    4096    1 /media/usbdisk
xmms    6979 root  8r  REG   8,17 2713101  377 /media/usbdisk/a.mp3

You either can wait until those processes exit or terminate them manually.

Tech Tip

To search a list of RPM files for a particular file, execute the following command:

$ ls RPMS-TO-SEARCH | \
    xargs rpm --query --filesbypkg --package | \
      grep FILE-TO-SEARCH-FOR

Replace RPMS-TO-SEARCH with the names of the RPM files to search, and replace FILE-TO-SEARCH-FOR with the name of the file to search for. The --filesbypkg option tells the rpm command to output the name of the package as well as the name of the file.

Tech Tip

If you need to transfer an entire filesystem from one machine to another, for example, when you get a new computer, do the following steps.

1) Boot both PCs with any Linux live CD (for example, Knoppix), and make sure they can access each other via the network.

2) On the source machine, mount the partition containing the filesystem to be copied, and start the transfer using netcat and tar:

cd /mnt/sda1
tar -czpsf - . | pv -b | nc -l 3333

3) On the destination machine, mount the partition to receive the filesystem, and start the process:

cd /mnt/sda1
nc 192.168.10.101 3333 | pv -b | tar -xzpsf -

The nc (netcat) command is used for any kind of TCP connections between two hosts. The pv (progress viewer) command is used to display the progress of the transfer. tar is used to archive the files on the source machine and un-archive them on the destination.

______________________

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState