Showing posts with label Other tips. Show all posts
Showing posts with label Other tips. Show all posts

If you cannot access your hard drive try this tip :

This small command save my 900GB.














Run Check Disk from the Command Line to Find and Fix Errors

You can run Check Disk from the command line or within other utilities. At a command prompt, you can test the integrity of the L drive by typing the following command:

chkdsk L:

To find and repair errors that are found in the L drive, use the following command:

chkdsk /f L: 
Note that Check Disk can’t repair volumes that are in use. If the volume is in use, Check Disk displays a prompt that asks if you want to schedule the volume to be checked the next time you restart the system. Click Yes to schedule this.

The complete syntax for Check Disk is this:

chkdsk [volume[[path]filename]]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]] 

The options and switches for Check Disk are used as follows:
Volume Sets the volume to work with.
filename FAT/FAT32 only: Specifies files to check for fragmentation.
/F Fixes errors on the disk.
/V On FAT/FAT32, this displays the full path and name of every file on the disk. On NTFS, this displays cleanup messages, if any.
/R Locates bad sectors and recovers readable information (implies /F).
/L:size NTFS only. Changes the log file size.
/X Forces the volume to dismount first if necessary (implies /F).
/I NTFS only. Performs a minimum check of index entries.
/C NTFS only. Skips checking of cycles within the folder structure

copy from microsoft technet.

How do I sync folders/files between my PC and my external drive

SyncToy 2.1 is a free application that synchronizes files and folders between locations. Typical uses include sharing files, such as photos, with other computers and creating backup copies of files and folders.
 
Free Microsoft Download

100+ Usefull Run Commands List

  Accessibility Options : access.cpl
  Add Hardware : hdwwiz.cpl
  Add / Remove Programs : appwiz.cpl
  Administrative Tools : control admintools
  Automatic Updates : wuaucpl.cpl
  Wizard file transfer Bluethooth : fsquirt
  Calculator : calc
  Certificate Manager : certmgr.msc
  Character : charmap
  Checking disk : chkdsk
  Manager of the album (clipboard) : clipbrd
  Command Prompt : cmd
  Service components (DCOM) : dcomcnfg
  Computer Management : compmgmt.msc

How to delete partition on usb thumb drive

  • From Command prompt type diskpart
  • Within Diskpart, use the List Disk command to check which disk the USB device is. The USB device should be obvious; in my case, it's the 14GB disk.
DISKPART> list disk

Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 465 GB 1024 KB
Disk 1 Online 14 GB 0 B
  • Once the disk is known, select the disk and run the rest of the displayed commands (change "disk 1" to the number of your disk):
DISKPART> select disk1

Disk 1 is now the selected disk.
  • Clean the partition
DISKPART> clean

DiskPart succeeded in cleaning the disk.

IBM Bootable Media Creator (BoMC)

You can use IBM ToolsCenter Bootable Media Creator to create bootable media that is suitable for applying firmware updates, running preboot diagnostics, and deploying Microsoft Windows operating systems on supported systems.
IBM System x and BladeCenter tools each have their own bootable CD. Using IBM ToolsCenter Bootable Media Creator, you can create a single bootable image on supported media (such as CD, DVD, ISO image, USB flash drive, or set of PXE files) that bundles multiple IBM System x and BladeCenter tools and updates from UpdateXpress System Packs, which contain Windows and Linux firmware and device driver updates. You can also create an IBM ServerGuide Setup and Installation CD for deploying Windows operating systems and updates on supported systems.

 


Formatting USB Flash Drive on Linux

Under UNIX-like operating systems, formatting a USB flash drive, in fact even a hard drive, requires knowing the file name for the partition that is to be formatted. These are files under the /dev directory, like for example, /dev/sdb1. So the interesting question to be asked is how does one come to know of the file representing the partition on the device? Immediately after connecting a USB flash drive to my laptop running Arch Linux and looking at the last few lines of ‘dmesg’ output gives:
sd 4:0:0:0: [sdb] 31703040 512-byte logical blocks: (16.2 GB/15.1 GiB)
Notice the ‘sdb’ within square brackets. This hints that the device file would start with /dev/sdb. Further, running:
$ ls -l /dev/sdb*
brw-rw---- 1 root disk 8, 16 Jan 31 23:55 /dev/sdb
brw-rw---- 1 root disk 8, 17 Jan 31 23:49 /dev/sdb1
And keeping it mind that it is a partition that is formatted, confirms the file that we are searching to be /dev/sdb1. Now, for formatting, if it is the EXT4 filesystem that is to be built then run:
mkfs.ext4 -L <label> /dev/sdb1
Use of the  -L <label> switch is optional. It gives a fancy name to the device that is often visible when automounting in a desktop environment like KDE or GNOME. After the above commands successful termination, one might want to print the partition table on the device for assurance:
# parted /dev/sdb print
Model: JetFlash Transcend 16GB (scsi)
Disk /dev/sdb: 16.2GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
1      16.4kB  16.2GB  16.2GB  primary  ext4         boot, lba
Notice that in the above case, the complete device (/dev/sdb) was given to parted and not just one partition. Manual mounting can be as simple as:
mount -t ext4 /dev/sdb1 <dir>
For more information, on Arch Linux, consider reading the man pages of dmesg(1),  mkfs(8), mount(8) and parted(8).

How to re-install bootstrap code (GRUB)

If you have repaired your system from a backup tape (by dump or tar for example), or have installed another OS such as one from Redmond that may have overwritten the master boot record (MBR), you will need to repair the bootstrap area.
Re-install bootstrap code (GRUB)

Please perform the following steps:
  1. Boot from CentOS installation disc (for example, CD #1 or DVD).
  2. For CentOS-4 or CentOS-5 type "linux rescue" at the "boot:" prompt. For CentOS-6 pick "Rescue installed system" from the boot menu.
  3. Mount all filesystems in read-write mode.
  4. Change root to real root ('/') on your hard disk:
    # chroot /mnt/sysimage
    
  5. Re-install bootstrap code (GRUB).
    • If you wish to re-install GRUB to the MBR on a SCSI or SATA disk (/dev/sda):
      # grub-install /dev/sda
      
    • If you wish to re-install GRUB to the PBR of Partition #2 on a SCSI or SATA disk (/dev/sda2):
      # grub-install /dev/sda2
      
    • If you wish to re-install GRUB to the MBR on an IDE disk (/dev/hda):
      # grub-install /dev/hda
      
    • If you wish to re-install GRUB to the MBR on a HP Smart Array disk (/dev/c0d0):
      # grub-install /dev/cciss/c0d0
      

Resizing Ext3 Partition

  • Before changing a file system it should be unmounted, so you'll need to create working standalone boot disks. The CentOS LiveCD would be a good choice. An ext3 filesystem can supposedly be expanded with resize2fs while mounted, but standalone would be safer.
  • A few ways you can do it:
    1. resize2fs
    2. parted
    3. Partition Magic 7.x
  • In all cases, first convert ext3 --> ext2: [Note: resize2fs works with ext3.]
tune2fs -O ^has_journal /dev/hdax
e2fsck -v -f /dev/hdax
         Resize the partitions with tool of choice.
convert back to ext3
tune2fs -j /dev/hdax
e2fsck -v -f /dev/hdax

Burn CD or DVD from ISO file (CLI)


Assuming that you already have an ISO file and all you want to create CD based on the ISO 9660 standard. You can burn an ISO using below command,

# cdrecord -v -pad speed=1 dev=0,0,0 daddy-linux.iso

If you are not comfortable with the above mentioned process, follow below method.
First Identify CD ROM letter from /dev/

# ll /dev/ | grep -i cdrom
lrwxrwxrwx  1 root root
3 2010-09-30 15:13 cdrom -> sr0
lrwxrwxrwx  1 root root
3 2010-09-30 15:17 cdrom1 -> sr1

Here, sr0 is our first CD drive and you want to use same drive for burning,
# dd if=/root/Download/daddy-linux.iso of=/dev/sr0 bs=512

Here, if = Source place of an ISO file and of = Destination place or where to write.

source : linuxarticles.org

NTP Client Configuration for Linux


If you are running a dedicated server and seems server’s time is delayed or is ahead of the actual time, we can use NTP to solve it.

# yum install ntp
# ntpdate pool.ntp.org

or

# ntpdate 0.fedora.pool.ntp.org

You can also add it to /etc/cron.daily to check correct Date/Time.
# cd /etc/cron.daily/
# vim ntp.sh
#!/bin/bash
/usr/sbin/ntpdate pool.ntp.org

Save and exit the file. Now, make it as a executable by,
# chmod 755 /etc/cron.daily/ntp.sh

Finally restart the cron daemon.
# service crond restart

Relay Emails using Gmail Account

If you are using Linux Desktop Operating System and do not want to set up an email server, use GMail account to relay emails. On Desktop OS, we can use GUI Email Clients, which supports POP3/IMAP to send an email but how about /usr/bin/mail or from cmd prompt?
To fulfil your requirement, you need to install a simple program called ssmtp. It accepts a mail stream on standard input with recipients specified on the command line and synchronously forwards the message to the mail transfer agent of a mail hub for the mail hub MTA to process. Failed messages are placed in dead.letter in the sender’s home directory.
STEP 1: Installation,
# yum install ssmtp -y

Trace Route Configuration Under Linux

It tracks the route packets take across an IP network on their way to a given host. It utilizes the IP protocol’s time to live (TTL) field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to the host.

First Install traceroute by,

# yum install traceroute -y

Trace route example,
# traceroute google.com

Activate Second CPU in Linux

If you are having single CPU Server System and want to add another CPU for better Server performance, question is how to activate second CPU in Linux? Solution is, if you are using SMP kernel, then Linux should automatically detect 2nd CPU after reboot.
SMP kernels allow any processor to work on any task no matter where the data for that task are located in memory; with proper operating system support, SMP systems can easily move tasks between processors to balance the workload efficiently some times this is known as Load Balancing at Kernel Level !
To verify SMP kernel is installed or not, execute below command,
# rpm -q kernel-smp
Note: In most modern Linux flavours, SMP kernel is by default installed.

nrg to iso image file conversion under Linux

In case you need to convert Nero image file .nrg into regular ISO9660 .iso, a Linux utility nrg2iso, might be helpful to you. It’s included into Red Hat, CentOS, Fedora yum repository as well apt repositories of Debian and Ubuntu, so to install it execute:

# sudo aptitude install nrg2iso
or
# yum install nrg2iso -y

We assume that, image1.nrg file is already created and needed to be converted in standard ISO9660 format,

# nrg2iso image.nrg image.iso

This will convert *.nrg image files to *.iso image file without corrupting Image file.

Configure Apache to Listen Multiple Ports

We can configure apache – httpd service to listen Multiple ports via Listen directive. By default httpd listens on TCP port 80. To configure multiple ports, open file /etc/httpd/conf/httpd.conf and modify the Listen directive tells the server to accept incoming requests on the specified port
# nano /etc/httpd/conf/httpd.conf
Find,
Listen 80
Force apache to listen to port 8080:
Listen 8080
Save and close the file. Restart httpd:
# /etc/init.d/httpd restart
Note: You must have root privileges to change configuration file.

Set Windows as Default OS when Dual Booting

When you install a dual-boot of Linux, one of the frustrating things that you’ll immediately notice is that Linux is set as the default operating system in the Grub loader. If you want to change default Operation System instead of Linux, there’s an easy way to switch back to using Windows as the default.

Open /boot/grub/menu.lst,

# nano /boot/grub/menu.lst

Look for default = 0

You will need to change that number 0 to match the Windows boot section. Typically it’s always going to be 4 on a default dual-boot configuration. Change this value to 4, and then save and reboot your machine. You should go into Windows instead of Linux automatically.

Mount ISO Image Under Linux


An ISO image is an disk image of an optical disc using a conventional ISO format. ISO image files typically have a file extension of .ISO. The name “ISO” is taken from the ISO 9660 file system used with CD-ROM media, but an ISO image can also contain UDF file system because UDF is backward-compatible to ISO 9660. You can mount an ISO images via the loop device under Linux.

To mount ISO file,
# mkdir /mnt/data
# mount -o loop,ro linuxarticles.iso /mnt/data

where,
ro =  Mount the filesystem read-only.
loop = Mount as a loop device.

Note: A loop device is a pseudo-device that makes a file accessible as a block device.
# cd /mnt/data
# ls -l

Change console font in Fedora

Ever had the need to change the console font in fedora? Sometimes you need to change it based on your requirements and font support like Greek fonts. The fonts that can be used by the console are kept in the /lib/kbd/consolefonts/ directory.

You can define the desired font in the /etc/sysconfig/i18n file by modifying the SYSCONF entry. I used the iso06.14.gz font, so my SYSFONT variable contains this:

SYSFONT=”iso06.14″

Installing Grub boot loader

Grub stands for GRand Unified Bootloader. When a PC starts, processor executes code stored in flash memory on the motherboard commonly known as BIOS (Basic Input Output System). Bios performs power-on self test (POST) which checks hardware. It then finds the device from which to boot the PC and loads its first sector into memory. This sector is 512 bytes in size and is known as MBR (master boot record). Grub’s stage1 which is exactly 512 bytes is installed into MBR. The job of stage1 is to load stage2 (optionally stage 1.5) which displays boot menu and loads the kernel.

Ok, enough theory.

Sometimes, the MBR gets written by another operating system or gets corrupted. In that case, it needs to be reinstalled on the MBR.

The system needs to be booted from rescue CD or boot floppy to install grub.
After booting, type grub and press enter to get grub the prompt like below
 
grub>

History of LINUX

  
● One of the developers on the Bell Labs team, Ken Thompson, continued to develop for the GE-645 mainframe, and wrote a game for that  computer called  Space Travel. However, he found that the game was too slow on the GE machine.
● In  1964, the  Massachusetts Institute of  Technology, AT&T Bell Labs, and General  Electric  started worked on an experimental  operating system called  Multics  (Multiplexed Information and Computing Service), which was designed to run on the GE-645 mainframe  computer. www.multicians.org
● Bell Labs dropped out in 1969.

Read full story...... 
















Ken Thompson (L)and Dennis Ritchie(R) ,creators of UNIX