RHEL 6 Linux Bset Gude

RHEL 6 Linux  Bset Gude
Ajay Saxena

Monday, 15 April 2013

Partitions?

Partitions: Planning Your Linux Installation 
This article will explain some of the terms involved with partitioning your hard drive, as well as some concepts you will need to understand before installing Linux, and will help you determine what partitions you need to create for Linux.

What is a partition?
Imagine your company is moving into a new building that is set up like a warehouse. There are no internal walls, it’s just one big room for everybody to work in. Chances are, the first thing the boss is going to do is build himself an office (he wouldn’t want to associate with you workers), so he’ll have a partition set up, an internal wall to separate him from you. Next, each worker will get a cubicle in the big room with smaller partitions to separate you from the person next to you.

Hard drives work the same way. The disk gets partitioned into smaller, separate pieces which can belong to different owners. In our case, Windows might own some and Linux will own others. On hard drives though, the word “partition” does not refer to the wall itself, it refers to the separated space. So we say Linux is installed “on” the first partition.

What is a file system?
Ever go looking for a book in the library? In order to find what you’re looking for, you must understand the library’s file system, or method of organization. Fiction books are easy, they use a simple type of file system commonly known as alphabetical by author. Nonfiction books can be tougher because they use a different type of file system, the Dewey Decimal System. What if you don’t understand the Dewey Decimal System? What if you only know the title of a book and you don’t know whether it’s fiction or non-fiction? How can we find our book now? Luckily there is a librarian to help us, and she has created a card catalog (or in most libraries now, a computerized catalog) listing all the books available and where to find them.

Now, picture your hard drive as the library. Like the library, your hard drive can have different file systems. The operating system is your librarian, who has provided the directory tree (sometimes also referred to as “the file system”, with a slightly different meaning) as a catalog of the files available.

Unfortunately, the world of computers is not as standardized as our libraries. In computers, every librarian or operating system has its own type of file system, and other operating systems often don’t know how to read it. Lucky for us, Linux is a versatile operating system and it does understand the file system used by Windows 95 and Windows 98, as well as many others.

Planning your partitions
Each distribution’s installation guide contains (or should contain) a section on partitioning your hard drive. I have noticed, however, that the manuals often include far more detail than is necessary in a typical desktop installation, and can be confusing to new users.

Personally, I favor the KISS principle (Keep It Simple, Stupid), especially for beginners. If you are installing a server that will serve multiple user’s simultaneously and provide myriad services, you will want to read these manual sections as well as the Partition Mini-HOWTO, an excellent document detailing the reasons one might want to create the seven or more partitions sometimes recommended in these primers.

For a single-user desktop system, you can ignore just about all of that. Desktop systems for personal use don’t have most of the complications that require so many partitions. For a healthy Linux installation, I recommend three partitions: swap, root, and home.

Swap
You need one partition that will be used as Linux swap space. This is space on your hard drive that can be used as virtual memory. Virtual memory allows your computer to run large programs and perform complex tasks even if it does not have enough physical RAM to do the job. (It is a lot slower, but it works.)

The amount of swap space required is a matter of religious argument among geeks and hackers, and entire volumes could be written about the subject. To keep it simple, create one swap partition that is 50% to 100% the size of the physical RAM in your system. If you are short on RAM with plenty of drive space, go large. If you’re short on drive space and have lots of RAM, go small.

root (/)
The root file system is represented by a forward slash (/). It is the top of the directory tree, and contains Linux and everything that you install with Linux. (See The Linux (Virtual) File System for details). This is roughly equivalent to your “C:” drive under DOS or Windows. Youmust create a partition for the root directory. (Don’t confuse this with the “root” user account, who is the administrator of the system. That’s a different kind of root!)

The size of your root partition will vary depending on what you install or plan to install. Check your distribution’s documentation, and reserve enough space for a maximum installation, plusat least 100MB more for temporary space and installation of new software. If you plan to download and try out lots of software, leave more space. If you have a small hard drive, you can trim back on your installed packages to save space.

In general, you should be fine with a root partition between 2GB and 8GB.

/home
The third and final partition you should create will hold your /home directory. This is the place where all the user-specific files, your data in other words, are stored. It is roughly equivalent to the “My Documents” folder on a MS Windows desktop (if you have MS Office installed). On a multi-user system, each user will have her own directory under /home.

Strictly speaking, it is not necessary to create a separate partition for /home. If you do not, it will reside on the root partition like everything else. If you are cramped for space, you may need to configure your machine this way.

The reason I recommend creating a separate partition is that you are a new user. You are going to want to play with things, experiment, push the limits of your system. Before long, you will break something so badly that you will need to reinstall, or you’ll just want to reinstall with different options, or try a different Linux distribution. Having /home on a separate partition makes it very easy to wipe out and reinstall Linux without losing any of your data.

Don’t think to yourself, “I’ll be careful, I won’t need to reinstall.” Wrong. You will definitely hose up your system at least once, and for the novice, reinstalling is often the easiest way to fix it. I had ten years of computer experience and worked in technical support when I started with Linux, so I knew my way around a PC, and I had to reinstall twice. Just plan on it and make it easy on yourself. Keep your data on a separate /home partition, or keep it backed up on some other medium, and be sure to create the boot floppies when prompted to do so during the installation process. They have saved my system more than once.

And don’t get the wrong impression here. This reinstall problem is only because you are a new user, still learning. Six months from now your system will be purring like a nursing kitten, and you’ll go weeks or months without rebooting, let alone reinstalling.

Sunday, 14 April 2013

Configure FTP Server

FTP (File Transfer Protocol):- It is a server used to download & Upload files from server.
FTP Port No. 20 & 21 [21 is main], SSH Port No. 22 
How to Configure FTP Server 
  • Go inside of Packages folder 
  • #rpmᶲ-ivhᶲvsftpd_____ (Press Tab only one time) ← Run this command for install FTP (Server) Package. 
  • #cdᶲ/var/ftp ← Here ftp is default directory. You can create here your any data like files. And then if you’ll access your ftp server on client side with his IP, then you can get that all ftp folder data.
  • But firstly you need to start that server services.
  • #serviceᶲvsftpdᶲrestart← for restart FTP (Server) services.
  • #chkconfigᶲvsftpdᶲon← for ON FTP (Server) services.
  • #systemᶲconfigᶲfirewall← It is most important to check firstly Firewall Disable or not. If it’ll enable so you can’t access that FTP on client side.
  • ftp://192.168.0.2 ← now go to client side and open any Internet Browser and type there FTP Server URL (Path of FTP Server). 
How to Access FTP through to Terminal 

  • Firstly we need to install on client side of that FTP Client Package. 
  • #rpmᶲ-ivhᶲftp_____ (Press Tab only one time) ← Go to Client side and run this command for install FTP (Client) Package. 
  • #ftpᶲ192.168.0.2← 
  • Go inside of Packages Folder 
  • #rpmᶲ-ivhᶲftp(_______) it means press two time tab ← That’ll show you all ftp Packages. 
  • serviceᶲftpᶲrestart← For restart service. 
  • chkconfigᶲftpᶲon← For On Service. 
  • System-config-firewall← Check Firewall and Disable. 
  • Open your Terminal 
  • Check firstly is in there both are proper Pinging or not. Then 
  • Type in Terminal ftpᶲ192.168.0.1← (Server IP) ← For Access FTP server data through Terminal.

Basic of RHEL

Anaconda is an Installer.

Basically we give 200 MB for Boot but in there used only 24 MB, because it’s total files size are 24 MB. 

Types of Partition 
  • Standard Partition 
  • RAID Partition
  • LVM Partition 
Types of Login Mode 
  • In their 6 types of login mode = Alt +Ctrl +F1 to F6 
  • F1 GUI Mode [Graphical User Interface] 
  • F2 to F6 TUI Mode [Terminal User Interface] 
Symbol of Location 
  • ~ = Home Directory 
  • / = Root Directory 
  • # = Root user login 
  • $ = Normal User login 
(root@localhost~)# = In there Root is User, Localhost is machine name and “ ~ ” this symbol shows that right now you are in home directory

Boot into Single User-mode

Single user mode is a mode in which a multiuser computer operating system boots into a single superuser. It is mainly used for maintenance of multi-user environments, Basically single user mode in unix based systems is known as runlevel 1.

Some tasks may require exclusive access to shared resources, for example running fsck on a network share or to retrieve a lost superuser password or any maintenance task.

For gaining access to #(root) prompt what you need to do is ?
  • Once your machine is booting, for getting access to # prompt your just need to edit the bootloader i.e. in case of RHEL6 its GRUB (GRand Unified Bootloader). 
  • Once your machine is booting just press a key couple of time so that you are brought to the GRUB menu.
  • The GRUB menu appears like the image shown below:
  • The values which are show in this window are the kernerl(s) which are installed in your machine.
  • Use the cursor keys to switch between kernels (if you have more than 1 installed) to choose the one you want to boot.
  • Press "e" to edit the kernel commands before booting.
  • Press "a" to modify the kernel arguments.
  • Press "c" to go to a command-line, for extended troubleshooting etc.
  • Once you pressed "e" while the kernel of your choice is highlighted, you get a second menu like the one shown on below screen.
  • Highlight the second line which starts with kernel /vmlinuz_______, Just press "e".
  • It will bring to a screen in which you just need to press a space once followed by 1 or single.
  • Make sure to hit “enter” to actually add the argument and to return to the boot menu. Escape does get you back to the same menu as well, but it does not add the argument, so your work will be undone actually.
  • Once you are back to your previous menu just press "b" to boot the kernel, Once your OS is booted you can see a screen something like this:
  • Now at the bottom of you screen you can see that you are on # prompt i.e. root prompt, Just type a command: passwd this will change your root password.
  • [root@sunny1 /]# passwd

Structure of Linux OS ?


In Linux the file system is based on one root directory, or hierarchical top point with sub-directories below it. In which each sub-directories has its own importance like some act as mount points, some for log messages, some for all hardware devices etc.
You can find a brief description of all the directories and sub directories below
  • You can find a brief description of all the directories and sub directories below:
/ :-         Its the top most directory in any of the Unix based system.
/bin:-     Essential command binaries that need to be available in single user mode; for all users, e.g., cat, ls, cp.
/boot:-   Boot loader files, e.g., kernels, initrd etc.
/dev:-    Information of all the hardware devices.
/etc:-     All the config files.
/home:- Home directories of all the users in a particular machine.
/media:-Mount points for removable media such as USB, CD etc.
/mnt:-    For temporary mount points.
/opt:-     Optional software packages like openoffice etc.
/root:-    Home directory of root user.
/sbin:-    System binaries like init, ip etc.
/tmp:-     Temporary files. Often not preserved between system reboots.
/var:-      Variable files—files whose content is expected to continually change during normal operation of the system—such as logs, spool files, and temporary e-mail files.
/usr:-      Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications.
/lib:-        Libraries essential for the binaries in
 /bin and /sbin.

Saturday, 13 April 2013

RHEL6 Installation ?


RHEL6 installation is very simple you just need to do some clicks and few selections and your operating system is ready.
Assuming you have a RHEL6 disk and a system in which you can install RHEL6.
Boot from local drive
  • Boot your machine and select the boot device a DVD. You will see a screen like the given below

When you install the Linux, so you can see four options in there.
  •  Install or upgrade an existing system
  • Install system with basic video drivers
  • Rescue Installed system
  • Boot from local drive

  • Select the installation type as "Install system with basic video driver".
  • If your disk is a new one then you can skip this check otherwise do check your disk for any errors.
  • Here I did skip this step, as I was aware that this will not give any issues while installing the machine. After this you will see a screen somewhat like this, just press Next.

  • Choose a language as per your requirements.

  • Choose the keyboard layout as per your requirements.
  • Select the storage device in which you want to install your OS.
  • Type the hostname of your machine(as per your requirements).
  • Select the time-zone.
  • Give root password for your machine if you did give a weak root password then it will prompt you that your root password is weak do you want to continue or not?
  • Select type of installation i.e. the layout how your hard disk will be partitioned. **OPTIONAL: If in case you select the option as "Encrypt system" if will ask you to select your LUKS password. By this option you can encrypt whole your hard disk.

  • Enter password for encrypted partition
  • Once you press OK you will be brought to a prompt about "Writing storage config to disk", press Write changes to disk. If and only if you think that you selected all the things correctly.
  • Select the basic type of system which you want to install like a server or desktop etc in this case I have selected desktop, after your selection press next.
  • You will see somewhat like this "Initialization of your installation process".
  • The it will start installing packages
  • Once all the packages are installed it will ask you to reboot your machine, Do a reboot of your machine just by pressing the Reboot button.
  • After your machine is up again just accept the licence agreement and click Forward.
  • Create a user for your machine so that you can login to the OS.
  • Select Date and Time and click Forward.
  • Your login screen will be somewhat like the one given below