Tag: cli

By Christopher P Wakefield

64px-Virtualbox_logoHow do you manage virtual machines over a network using Oracle Virtualbox? I have been asked this a couple of times recently and today I will show you how. Most of my tutorials on Virtualbox have been along the lines of installing the software onto a system and managing the virtual machines on that system in person. This works well if you have a couple of virtual desktop machines but when you have quite a few servers involved going between each server to carry out maintenance becomes very tedious.

This is where you need a piece of software called phpvirtualbox. Phpvirtualbox is an open source web based front end for Virtualbox which allows you to manage all of your virtual machines over the internet.

linux-mint-logo-128x128So lets take a look at how we set this up. For the basis of this tutorial I will be using Linux Mint 12 and Virtualbox 4.1.4.

We first need to download and install the current version of Virtualbox from the Virtualbox website.

Once installed we need to add a user who will run Virtualbox. Open up a terminal as root and type:

adduser vbox

When asked supply a user password. Next we have to add the vbox user to the vboxusers group in the /etc/group file. So type (as root):

gedit /etc/group

Add vboxusers:x:113:vbox to the file and save.

Once we have finished with Virtualbox it is time to set up our web server. Since this is Linux we will be using Apache. Open up a terminal and install the following packages:

apache2

php5-mysql

libapache2-mod-php5

mysql-server

During the install process MySQL will ask you for a root password. Make this something complex but do not forget it!!!

Once installed open up a web browser and type your server address into the address bar and you will see the message IT WORKS! This means that you have a working web server.

Now we need to download, install and configure phpvirtualbox. The current release can be downloaded from the phpvirtualbox website.

I am assuming your downloads go to your Download folder. If not replace Downloads with the location that the file was downloaded to. Open up a terminal and type the following commands one at a time:

cd Downloads

cp -a phpvirtualbox-4.1.7 /var/www/phpvirtualbox

cd /var/www/phpvirtualbox

mv config.php-example config.php

It is now time to configure the config.php file so type:

sudo gedit config.php

———————————–

/**

* phpVirtualBox example configuration.

* [@version] $Id: config.php-example 366 2011-12-01 19:56:57Z

*

* rename to config.php and edit as needed.

*

*/

class phpVBoxConfig {

/* Username / Password for system user that runs VirtualBox */

var $username = ‘vbox’;

var $password = ‘*********’;

/* SOAP URL of vboxwebsrv (not phpVirtualBox’s URL) */

var $location = [http://127.0.0.1:18083/]

/* Default language. See languages folder for more language options.

* Can also be changed in File -> Preferences -> Language in

* phpVirtualBox.

*/

var $language = ‘en’;

————————————

Locate the username and password (BOLD above) and change the password to the one you created earlier. Once done save and exit.

Now we need to make sure that Virtualbox can start at boot time and that means configuring init scripts. Open up a terminal and type:

cd /etc/init.d

and then:

sudo touch /etc/init.d/vbox.start

Now we need to configure the file so type:

sudo gedit /etc/init.d/vbox.start

Copy /usr/bin/vboxwebsrv -b into the file. Save and exit.

That is Virtualbox configured to start at boot time but we now have to enable it so type:

chmod +x /etc/init.d/vbox.start

followed by:

update-rc.d vbox.start defaults

Now it is time to reboot the server. Once it has rebooted go to a web browser and point it to your server address/phpvirtaulbox

You will now be able to manage all the virtual machines on the network from the comfort of your own chair.

Hi I am Chris the owner of ComTech. I provide IT support to both personal and business clients from my base in Alloa, Clackmannanshire. For a list of what I can offer you why not visit my website www.comtech247.net where you will find my blog, testimonials, services and much more. Start supporting a local business today so I can start supporting you.

Tags: , , , , , , ,

gnuBy Rand Whitehall

In the Linux command line shell, moving around from directory to directory, adding new directories, and deleting old directories is easy once you know the proper commands. Again, with Linux, you are limited only by your brain! If you know all the commands, then you weild great power. But if you know only a few commands, it’s like you are standing in the airport in Tokyo and want to know where the bathroom is, but only know how to say hi and bye in Japanese.

Let’s get to it. Open a shell (or terminal) and type each line below followed by enter:

cd

pwd

You should be in your home directory, which is the same name as your username. So if your username is barney22, your home directory should be /home/barney22.

Now, let’s create a new directory to play with. (Remember, when learning the command line in Linux, always play with new directories and files you create to practice with. Never practice with important files and directories.) Type this:

mkdir doggy [enter]

ls [enter]

Now you should see your new directory called doggy in the ls output. Great! Now what? Let’s change the name. Type:

mv doggy doggyDo [enter]

ls [enter]

And you should see the directory name has been changed from doggy to doggyDo. Great! Hmmm… Now let’s go into the doggyDo directory and create a text file.

cd doggyDo [enter]

touch shibaken.txt [enter]

ls [enter]

Now, you should be in your doggyDo directory and see the new text file you created with the touch command. If for some reason you got lost somewhere along the line, go “home” by typing this:

cd [enter]

A cd command with no destination will take you home every time.

Now, let’s say you want to move the doggyDo directory into another directory. Let’s create another directory first, like this:

cd [enter]

mkdir doggyDocs [enter]

Now let’s move the doggyDo directory into the doggyDocs directory like this:

mv doggyDo doggyDocs [enter]

ls [enter]

You should see the doggyDocs directory now, but not the doggyDo directory because it is inside doggyDocs.

cd doggyDocs [enter]

ls [enter]

You should see your doggyDo directory there inside doggyDocs.

I hope you learned a lot about creating and moving directories around in the Linux command line. If this was a bit confusing, then just go through it again slowly. With a little practice your fingers will know what to do as soon as you think of it!

Rand writes about web design, Linux, men’s health and more. Please check out his DE safety razor site for shaving info and tips and the latest on the Merkur Futur safety razor. It’s a great resource for those who are passionate about a quality, close shave.

Tags: , , , , , ,

WINE logoBy Marcos Aguilar

It may occur that the user needs to run a Windows application or game in Ubuntu and it finds that it cannot install windows programs.

Wine is a piece of software that tricks programs to believe they are running in a Windows environment.

In addition, this article will explain how to install Winetricks libraries needed to run windows, and PlayOnLinux applications to run games.

WINE

Wine comes in the Ubuntu repositories, ready to install. All the user has to do is open a terminal (applications -> accessories -> terminal) and enter the following command:

sudo apt-get install wine

The best option is to get the latest version of wine so the user should add its repositories.

Note: Ubuntu 12.04 has the latest version of Wine (version number 1.4) so it is not need to add its repositories.

For earlier versions of Ubuntu, open a terminal and run the following command:

sudo add-apt-repository ppa:ubuntu-wine/ppa

Press Enter, write the root password (for security reasons, not visible while the user types), we hit Enter.

Update the repository with the following command:

sudo apt-get update

Press Enter and the user would be ready for installation.

Once the repositories were added, and depending on whether there is a version of Wine already installed, do one of the following:

If Wine is not installed, issue the following command:

sudo apt-get install wine

If the user has an earlier version of Wine (the official Ubuntu repositories) installed, it can be updated with the following command:

sudo apt-get upgrade

Running Wine:

The Wine Menu already shows under Applications. It can be used to access Windows programs and Configure Wine (you can also configure it from a terminal with the winecfg command).

To install a.exe program, click the right mouse button on it and select “open with wine windows program loader”.

We can also run a program on a terminal with the following command:

sudo wine program.exe

It is a good idea that before installing a piece of software, especially if it’s powerful and complex, check the official WineHQ site, to see if the program would work well. It sometimes happens that it is necessary to install a library or dll for the program to work properly.

WINETRICKS

Often, the application the user tries to run fails because there is a required missing dynamic link library (DLL).

Winetricks is a script that will help the user in that task. With this script, the user can download and install the libraries that are required by the windows programs.

To install:

For the latest version of wine:

Those who have added the Wine repositories in Ubuntu and/or have installed the latest version of Wine, they should have winetricks with a package repository included. This is because it is automatically installed as a dependency when wine is installed.

It may also be desired to install the cabextract package:

sudo apt-get install cabextract

To launch it, press the ALT + F2 key combination and run:

winetricks

A window showing all the libraries will open, select the needed ones, press accept and install as in windows: accept, accept… end.

For other versions of wine:

Open a terminal:

Download winetricks with the following command:

wget http://www.kegel.com/wine/winetricks

This will download the script in users’ personal folder and should never be deleted.

Winetricks does not need to be installed and libraries, it can be installed directly with the following command:

sh winetricks library

Eg. to install the “corefonts” and “directx9″ libraries run:

sh winetricks directx9 corefonts

PLAYONLINUX

PlayOnLinux allows users to run games. It’s in the Ubuntu repositories and can be installed with this command:

sudo apt-get install playonlinux

To install the very last version, add the proper repositories for the Ubuntu version the user has:

Ubuntu 11.04:

wget -q “deb.playonlinux.com/public.gpg” -O- | sudo apt-key add -

sudo wget deb.playonlinux.com/playonlinux_natty.list -O /etc/apt/sources.list.d/playonlinux.list

Ubuntu 10.10:

wget -q “deb.playonlinux.com/public.gpg” -O- | sudo apt-key add -

sudo wget deb.playonlinux.com/playonlinux_maverick.list -O /etc/apt/sources.list.d/playonlinux.list

Ubuntu 10.04:

wget -q “deb.playonlinux.com/public.gpg” -O- | sudo apt-key add -

sudo wget deb.playonlinux.com/playonlinux_lucid.list -O /etc/apt/sources.list.d/playonlinux.list

Once the repositories are added, PlayOnLinux is updated and installed with:

sudo apt-get update

sudo apt-get install playonlinux

For Debian Squeeze, would be:

wget -q “deb.playonlinux.com/public.gpg” -O- | apt-key add -

wget deb.playonlinux.com/playonlinux_squeeze.list -O /etc/apt/sources.list.d/playonlinux.list

apt-get update

apt-get install playonlinux

Learn more about wine compatible software.

Our blog is run and maintained by Linux & Unix fans who volunteered to share their experience with the world at no cost!! This is the power of Linux & Unix!! Visit us on http://www.linux2aix.com.

Tags: , , , , , , ,

RAID1By Robert Camilleri

We start by listing the partition tables present on the server to locate the new hard disk

[root@mail ~]# fdisk -l

Disk /dev/hda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 13 104391 fd Linux raid autodetect
/dev/hda2 14 6387 51199155 fd Linux raid autodetect
/dev/hda3 6388 6769 3068415 fd Linux raid autodetect
/dev/hda4 6770 60801 434012040 fd Linux raid autodetect

Disk /dev/hdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/hdc doesn’t contain a valid partition table

Disk /dev/md1: 52.4 GB, 52427816960 bytes
2 heads, 4 sectors/track, 12799760 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md1 doesn’t contain a valid partition table

Disk /dev/md3: 444.4 GB, 444428255232 bytes
2 heads, 4 sectors/track, 108502992 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md3 doesn’t contain a valid partition table

Disk /dev/md2: 3141 MB, 3141926912 bytes
2 heads, 4 sectors/track, 767072 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md2 doesn’t contain a valid partition table

Disk /dev/md0: 106 MB, 106823680 bytes
2 heads, 4 sectors/track, 26080 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md0 doesn’t contain a valid partition table

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 121601 976760001 83 Linux
[root@mail ~]#

The above output shows that there are two hard disks (hda and hdc). Partitions are visible on hda however hdc does not contain a valid partition table. In fact this is the replacement for the faulty disk.

To view the health of the Software RAID type cat /proc/mdstat

[root@mail ~]# cat /proc/mdstat

Personalities: [raid1]

md0: active raid1 hda1[1]

104320 blocks [2/1] [_U]

md2: active raid1 hda3[1]
3068288 blocks [2/1] [_U]

md3: active raid1 hda4[1]
434011968 blocks [2/1] [_U]

md1: active raid1 hda2[1]
51199040 blocks [2/1] [_U]

unused devices:
[root@mail ~]#

Note that [2/1] shows that there are 2 disks in the array however only 1 is active. The symbols [_U] mean that one of the two disks is missing from the array and must be reconfigured.

Since the new disk is /dev/hdc we need create the partitions required for the RAID. Use fdisk to create the boot partition on the new disk.

[root@mail ~]# fdisk /dev/hdc

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel. Changes will remain in memory only,

until you decide to write them. After that, of course, the previous

content won't be recoverable.

The number of cylinders for this disk is set to 60801.
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)
Warning: invalid flag 0×0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/hdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-60801, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-60801, default 60801): +100M

Command (m for help): p

Disk /dev/hdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 1 13 104391 83 Linux

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): l

0 Empty 1e Hidden W95 FAT1 80 Old Minix be Solaris boot
1 FAT12 24 NEC DOS 81 Minix / old Lin bf Solaris
2 XENIX root 39 Plan 9 82 Linux swap / So c1 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 83 Linux c4 DRDOS/sec (FAT-
4 FAT16 5 Extended 41 PPC PReP Boot 85 Linux extended c7 Syrinx
6 FAT16 42 SFS 86 NTFS volume set da Non-FS data
7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set db CP/M / CTOS /.
8 AIX 4e QNX4.x 2nd part 88 Linux plaintext de Dell Utility
9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM df BootIt
a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e1 DOS access
b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e3 DOS R/O
c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS e4 SpeedStor
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi eb BeOS fs
f W95 Ext’d (LBA) 54 OnTrackDM6 a5 FreeBSD ee EFI GPT
10 OPUS 55 EZ-Drive a6 OpenBSD ef EFI (FAT-12/16/
11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f0 Linux/PA-RISC b
12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f1 SpeedStor
14 Hidden FAT16 16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot f2 DOS secondary
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fd Linux raid auto
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fe LANstep
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid ff BBT
1c Hidden W95 FAT3 75 PC/IX
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): p

Disk /dev/hdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 1 13 104391 fd Linux raid autodetect

Command (m for help):w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@mail ~]#

Type fdisk -l to verify creation of partition on the second disk

[root@mail ~]# fdisk -l

Disk /dev/hda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 13 104391 fd Linux raid autodetect
/dev/hda2 14 6387 51199155 fd Linux raid autodetect
/dev/hda3 6388 6769 3068415 fd Linux raid autodetect
/dev/hda4 6770 60801 434012040 fd Linux raid autodetect

Disk /dev/hdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 1 13 104391 fd Linux raid autodetect

Disk /dev/md1: 52.4 GB, 52427816960 bytes
2 heads, 4 sectors/track, 12799760 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md1 doesn’t contain a valid partition table

Disk /dev/md3: 444.4 GB, 444428255232 bytes
2 heads, 4 sectors/track, 108502992 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md3 doesn’t contain a valid partition table

Disk /dev/md2: 3141 MB, 3141926912 bytes
2 heads, 4 sectors/track, 767072 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md2 doesn’t contain a valid partition table

Disk /dev/md0: 106 MB, 106823680 bytes
2 heads, 4 sectors/track, 26080 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md0 doesn’t contain a valid partition table

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 121601 976760001 83 Linux
[root@mail ~]#

Software RAID requires disks in the array to be partitioned identically. You can try to do this manually calculating the exact number of cylinders required for each partition to match their counterparts on the other disk. This is highly discouraged. Instead we use the sfdisk command.

[root@mail ~]# sfdisk -d /dev/hda

# partition table of /dev/hda

unit: sectors

/dev/hda1: start= 63, 208782, Id=fd
/dev/hda2: start= 208845, Id=fd
/dev/hda3: start=102607155, 6136830, Id=fd
/dev/hda4: start=108743985, Id=fd
[root@mail ~]#

The output above displays the partition sizes on the primary disk

In order to create identical partitions on the secondary disk we type the following

[root@mail ~]# sfdisk -d /dev/hda | sfdisk /dev/hdc

Checking that no-one is using this disk right now... 

OK

Disk /dev/hdc: 60801 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/hdc1 0+ 12 13- 104391 fd Linux raid autodetect
/dev/hdc2 0 – 0 0 0 Empty
/dev/hdc3 0 – 0 0 0 Empty
/dev/hdc4 0 – 0 0 0 Empty
New situation:
Units = sectors of 512 bytes, counting from 0

Device Boot Start End #sectors Id System
/dev/hdc1 63 208844 208782 fd Linux raid autodetect
/dev/hdc2 208845 102607154 102398310 fd Linux raid autodetect
/dev/hdc3 102607155 108743984 6136830 fd Linux raid autodetect
/dev/hdc4 108743985 976768064 868024080 fd Linux raid autodetect
Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
Successfully wrote the new partition table

Re-reading the partition table…

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
[root@mail ~]#

Typing fdisk -l once again displays that the partitions on both disks are in fact identical

[root@mail ~]# fdisk -l

Disk /dev/hda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 13 104391 fd Linux raid autodetect
/dev/hda2 14 6387 51199155 fd Linux raid autodetect
/dev/hda3 6388 6769 3068415 fd Linux raid autodetect
/dev/hda4 6770 60801 434012040 fd Linux raid autodetect

Disk /dev/hdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 1 13 104391 fd Linux raid autodetect
/dev/hdc2 14 6387 51199155 fd Linux raid autodetect
/dev/hdc3 6388 6769 3068415 fd Linux raid autodetect
/dev/hdc4 6770 60801 434012040 fd Linux raid autodetect

Disk /dev/md1: 52.4 GB, 52427816960 bytes
2 heads, 4 sectors/track, 12799760 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md1 doesn’t contain a valid partition table

Disk /dev/md3: 444.4 GB, 444428255232 bytes
2 heads, 4 sectors/track, 108502992 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md3 doesn’t contain a valid partition table

Disk /dev/md2: 3141 MB, 3141926912 bytes
2 heads, 4 sectors/track, 767072 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md2 doesn’t contain a valid partition table

Disk /dev/md0: 106 MB, 106823680 bytes
2 heads, 4 sectors/track, 26080 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md0 doesn’t contain a valid partition table

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 121601 976760001 83 Linux
[root@mail ~]#

Now that the partitions are identical we can re-sync the information across the RAID configuration

Type mdadm -a /dev/md0 /dev/hdc1 to add /dev/hdc1 partition to the /dev/md0 RAID partition.

[root@mail ~]# mdadm -a /dev/md0 /dev/hdc1

mdadm: added /dev/hdc1

[root@mail ~]#

Type cat /proc/mdstat to view the re-syncing process

[root@mail ~]# cat /proc/mdstat

Personalities: [raid1]

md0: active raid1 hdc1[2] hda1[1]

104320 blocks [2/1] [_U]

[=>... ] recovery = 7.8% (8512/104320) finish=0.7min speed=2128K/sec

md2: active raid1 hda3[1]
3068288 blocks [2/1] [_U]

md3: active raid1 hda4[1]
434011968 blocks [2/1] [_U]

md1: active raid1 hda2[1]
51199040 blocks [2/1] [_U]

unused devices:
[root@mail ~]# cat /proc/mdstat
Personalities: [raid1]
md0: active raid1 hdc1[2] hda1[1]
104320 blocks [2/1] [_U]
[=======>... ] recovery = 37.2% (39808/104320) finish=0.5min speed=1809K/sec

md2: active raid1 hda3[1]
3068288 blocks [2/1] [_U]

md3: active raid1 hda4[1]
434011968 blocks [2/1] [_U]

md1: active raid1 hda2[1]
51199040 blocks [2/1] [_U]

unused devices:

The below shows how the output should be when the re-syncing process has ended. Note the “[UU]“. This confirms that both disks are active.

[root@mail ~]# cat /proc/mdstat

Personalities: [raid1]

md0: active raid1 hdc1[0] hda1[1]

104320 blocks [2/2] [UU]

md2: active raid1 hda3[1]
3068288 blocks [2/1] [_U]

md3: active raid1 hda4[1]
434011968 blocks [2/1] [_U]

md1: active raid1 hda2[1]
51199040 blocks [2/1] [_U]

unused devices:
[root@mail ~]#

The same process has to be performed on the other partitions

[root@mail ~]# mdadm -a /dev/md1 /dev/hdc2

mdadm: added /dev/hdc2

[root@mail ~]# mdadm -a /dev/md2 /dev/hdc3

mdadm: added /dev/hdc3

[root@mail ~]# mdadm -a /dev/md3 /dev/hdc4

mdadm: added /dev/hdc4

[root@mail ~]# cat /proc/mdstat

Personalities: [raid1]

md0: active raid1 hdc1[0] hda1[1]

104320 blocks [2/2] [UU]

md2: active raid1 hdc3[2] hda3[1]
3068288 blocks [2/1] [_U]
resync=DELAYED

md3: active raid1 hdc4[2] hda4[1]
434011968 blocks [2/1] [_U]
resync=DELAYED

md1: active raid1 hdc2[2] hda2[1]
51199040 blocks [2/1] [_U]
[>... ] recovery = 0.0% (37376/51199040) finish=501.5min speed=1698K/sec

unused devices:
[root@mail ~]#

Finally we need to install GRUB on the second disk’s MBR.

[root@mail ~]# grub
GNU GRUB version 0.97 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]

grub> find /grub/grub.conf
(hd0,0)
(hd1,0)

grub> root (hd1,0)
Filesystem type is ext2fs, partition type 0xfd

grub> setup (hd1)
Checking if “/boot/grub/stage1″ exists… no
Checking if “/grub/stage1″ exists… yes
Checking if “/grub/stage2″ exists… yes
Checking if “/grub/e2fs_stage1_5″ exists… yes
Running “embed /grub/e2fs_stage1_5 (hd1)”… 15 sectors are embedded.
succeeded
Running “install /grub/stage1 (hd1) (hd1)1+15 p (hd1,0)/grub/stage2 /grub/grub.conf”… succeeded
Done.

grub> quit

Tags: , , , , ,
default linux mint 12 Menu

default linux mint 12 Menu

So, you downloaded Linux Mint 12 and are excited to try out all the fancy stuff that people have been saying about it. You have your Live CD burned, you boot into the desktop, you click on Menu in the bottom-left corner, see the popular folders listed there, but one seems to be missing– the games folder!

In just a few simple steps, we will show you how to get the Games folder to appear, complete with a nice selection of popular games for the Gnome desktop environment.

Step 1

Click on the terminal located under the Menu:

click on the terminal

click on the terminal

 Step 2

Type sudo apt-get install gnome-games at the prompt:

terminal window

terminal window

Press Enter when it asks if you want to continue, then it will download the games, and all the dependencies, all within your Live environment!

Step 3

Finished! Enjoy your new games, as you can now see, there are quite a few games to try out, for all ages. Here is a screenshot of the final product, that just took a couple of minutes of your time:

Finally, we have games!

Finally, we have games!

Here is a list of the games we just installed:

AisleRiot Solitaire, Chess, Five or More, Four-in-a-row, FreeCell Solitaire, lagno, Klotski, Mahjongg, Mines, Nibbles, Quadrapassel, Robots, Sudoku, Tali, Tetravex

©2012 Linux.Bihlman.com

post written using Firefox on the Linux Mint 12 Live CD!

Tags: , , , , , , ,

As the title suggests, a technically-inclined computer user probably gets more satisfaction running a PING test in Linux than Windows XP, as the screenshots below should indicate.

pinging google in linux mint 12

pinging google in linux mint 12

and now, Windows XP:

 

pinging google in windows xp

pinging google in windows xp

That’s the difference!

Tags: , , , , ,

By Rand Whitehall

To copy a file in the Linux command line interface (cli) then use the cp command. If you are familiar with DOS, cp is like the COPY command. To copy a file you need to write the name of the file you want to copy and the name of the newly copied file.

So, to make a copy of my file called joe and name the new file joe2, I type:

cp joe joe2

I then issue the ls command to show a list of the current files in the directory and I should see my old file joe and a new file called joe2 which is an exact copy of tom.

Now what if I wanted to copy the file joe, but put the copy in another directory? Well, then I simply specify which directory I want the copy to go into.

cp joe Documents/joe2

This will copy the file joe, name the new copy joe2, and place joe2 in the Documents directory. So with one simple command I copied, renamed, and moved a file. It took under a second. If I had done that in the GUI (graphical user interface) it would have taken at least a minute and a bunch of clicks.

What if I type this?: (hint: Documents is a directory.)

cp joe Documents/

Well, if you said a new copy of joe (named joe) would be created in the Documents directory, then you’d be right.

Since we did not specify a name for our copy, but did specify a directory, cp simply used the original name.

What if we do this?:

cp bashcp joe

The output is this an error:

cp: missing destination file operand after `joe’

Try `cp –help’ for more information.

Oops. cp needs a destination, which is either a new name for the copied file, or another directory to place the copy into.

I hope this helps you understand the basics of the GNU Linux command cp. The more you learn about the different cli commands, the more you can do. Soon you’ll be saving tons of time using the cli to perform tasks that would have taken the GUI hundreds of clicks.

Please be careful, though, when starting out with the cli. The command line tools can perform just about any task quickly and efficiently. But it’s easy to damage your system if you accidentally delete something or move a file that shouldn’t have been moved. The cli is like a very sharp katana that can slice through just any problem you may have, but it can also do unintended harm if you aren’t careful.

So when starting out, it’s best to work in safe, “sandbox” directories, on files you have created specifically to learn cli commands. I usually make a new directory, then copy a few files in to play with, so if I screw up, it’s no problem.

Rand writes about web design, men’s health and nitrile gloves. Please check out his new website all about allergy free Nitrile Gloves for info and nitrile glove know how! Check out the Nitrile Gloves vs. Latex Gloves page to find out how nitrile stacks up against latex.

Tags: , , ,

By Rand Whitehall

If you are just starting out using the command line in Linux, knowing just a few key commands can take you a long way towards fluency in the cli (command line interface) environment. Most new linux users fear the dreaded command line and its archane text-based commands. But if you warm up to the command line slowly and patiently, you’ll start to see you can wield great power over your computer using cli tools. It is truly amazing how much you can do with the cli and how quickly and efficiently it can do things. Some tasks can be done with a few lines of commands in under a second that would take thousands of mouse clicks and hours to accomplish in a typical GUI (graphical user interface).

The ls command is very powerful and useful so we’ll start there, then take a look at the file command.

ls: The ls command lists the contents of a directory. Simply type ls and hit the enter key. You should see a list of the contents of your current directory.

Now, if you want to get a bit fancy, you can tell ls to show you file sizes as well by adding the -l switch like this: ls -l.

This will show you the contents of the directory and files size, file date, file time and file name.

Now, while you are looking at details of the files in your current directory, you may be wondering what type of files they are. For example, if my home directory had a file called joe, I would type file joe to find out what type of file it was.

The file named joe is a text file so the file command outputs: joe.txt UTF-8 Unicode English text.

I’ve also got a directory listed called bob. If I type file: bob, then file outputs: bob/ directory.

The file command can tell us about any type of file. Digging deeper into my filesystem I come across a file that I don’t know. What type of file is it? Run the file command. file: bak.sh. The output of the file command: Bourne-Again shell script text executable. Ahh, it’s a bash script.

What’s a bash script? It’s a list of cli commands strung together in a text file. A bash script is like a small program that can perform just about any number of tasks. Very powerful stuff once you get a few more commands under your belt.

Rand writes about Linux, old school safety razors and blue nitrile gloves! Check out Rand’s site all about latex free nitrile gloves, a great barrier against infection. Black Nitrile Gloves are also available and used often by tattoo artists, mechanics and industries where keeping dirt and grime free is important.

Tags: , , , , ,

Easy Linux Training – Linux Tips on Using Multiple Options with a Linux Command
By Clyde E. Boom

Linux distributions (versions), especially the major Linux distros, include several “point-and-click” Linux GUI utilities. These utilities can be used to do Linux administration task. However, you have to do an awful lot of pointing and clicking to get anything done in these Linux GUI utilities.

What takes several clicks (and way too much time) with a Linux GUI utility can be done almost instantly by running a Linux command. However, new Linux users usually find Linux commands tricky to learn – but they are well worth learning. Also, if you are working on some kind of Linux certification, you will get tested on Linux commands, not on Linux GUI utilities.

Another benefit of learning Linux commands is that they are virtually identical on all 130 + Linux distributions. So, the best way to learn how to use Linux, to do Linux system administration, is to learn how to use Linux commands.

Linux tips: When you get Linux training, including Linux certification training, be sure to learn how to use Linux commands. Don’t waste time learning Linux GUI utilities.

Linux Tips – How to Use Multiple Options with a Linux Command

1. Most Linux commands have several options.

Linux command options are used to control the output of a Linux command – and some Linux commands have over 50 options!

2. For almost all Linux commands, the options are prefixed with a – (dash).

For example, the following Linux command runs the ls command with the l (el) option. The l stands for “long” and it gives you a longer (and more detailed) listing of files and directories in the Linux file system.

]#   ls  -l

Linux Tips: In these examples, the ]# represents the Linux command line prompt. You don’t type in the prompt!

3. Linux command options can be combined.

The ls command is used to list the directories and files in the Linux file system. It has an l (for long) option and an a (for all) option. The a option shows “all” files, including hidden files.

The following command uses the l and a options to give you a long listing of all files.

]#   ls  -l -a

4. Linux command options can be combined without a space between them and with a single – (dash).

The following command is a faster way to use the l and a options and gives the same output as the Linux command shown above.

]#   ls  -la

5. The letter used for a Linux command option may be different from one command to another.

For example the -r option of one command may not provide the same output as the -r option for another command.

You can learn how to use Linux commands easily by watching Linux video tutorials.

When you watch a Linux video tutorial, you get to see, hear and do! You get to watch the command being typed in and hear an explanation of why you run the Linux command. Then you can pause the video tutorial and run the Linux command yourself!

Clyde Boom, Author and Expert Trainer with 20+ Years of Training
Successes. Learn intricate technical matters in an easy-to-
understand, non-technical manner, with thousands of
software and hardware learners into masters.

You can watch Free
Sample I Learn Linux Video Tutorials
at
http://www.iLearnLinux.com and get over the steep Linux learning
curve.

Sign up for Free I Learn Linux
News
to receive technical tips, info on new video samples and
important updates on Linux.

You need to learn Linux the easy way to get that new job, qualify
for that next promotion, earn a hefty raise, get Linux
certification, or keep your current job because your company is
trying to save on software licensing fees (eza). Watch, do, and
learn!

Tags: , , , ,
Back to top