RHCT Certification - Samples For Self Test

How to mount USB drive on Redhat enterprise Linux server (RHEL4) ?

Make Sure USB drive is connnected right to your Linux machine/server, I have plugged in USB thumb drive. Before connecting USB drive do a tail -f /var/log/messages, Redhat Linux sees USB drive as a SCSI device so device will be named as "sdxxx" :

[root@ice ~]# tail -f /var/log/messages
Apr 27 21:52:30 ice kernel: Attached scsi removable disk sdb at scsi1, channel 0, id 0, lun 0 Apr 27 21:52:30 ice kernel: usbcore: registered new driver usb-storage
Apr 27 21:52:30 ice kernel: sdb: assuming drive cache: write through Apr 27 21:52:30 ice kernel: sdb: sdb1

#df -h
/dev/sdb1 124M 101M 24M 82% /media/usbdisk

USB is mounted as /dev/sdb1
 

How to check kernel in RHEL4 ?

[root@ice ~]# file /sbin/init
/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped
 

How can you Check availale Memory on RHEL4 (Redhat Enterprise Linux servers) ?

[root@ice /]# grep Mem /proc/meminfo MemTotal: 255972 kB

MemFree: 5896 kB

Create partition on RHEL :Redhat Enterprise Linux without reboot :

[root@ice ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO) 

2) booting and partitioning software from other OSs 
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 1318 10482412+ 8e Linux LVM

/dev/sda3 1319 1579 2096482+ 82 Linux swap

Command (m for help): n Command action
e extended

p primary partition (1-4) e

Selected partition 4

First cylinder (1580-2610, default 1580): Using default value 1580

Last cylinder or +size or +sizeM or +sizeK (1580-2610, default 2610): Using default value 2610

Command (m for help): p

Disk /dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 1318 10482412+ 8e Linux LVM

/dev/sda3 1319 1579 2096482+ 82 Linux swap /dev/sda4 1580 2610 8281507+ 5 Extended Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table.

The new table will be used at the next reboot. Syncing disks.

Finally type partprobe to make parition change available to Redhat enterprise Linux (RHEL4) without reboot :

[root@ice ~]# partprobe /dev/sda

More Linux Questions

Have a Linux Problem
Linux Forum - Do you have a Linux Question?

Linux Books
Linux Certification, System Administration, Programming, Networking Books

Linux Home: Linux System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.