Posts

Showing posts with the label swap

Ways of searching a disk/hdd in RHEL6

There must be an entry in /sys/block/XXX # ls -lrt /sys/block/ /proc/partitions ==> cat /proc/partitions  major minor  #blocks  name    8        0   15728640 sda    8        1     512000 sda1    8        2   15215616 sda2    8       16    2097152 sdb  253        0   13148160 dm-0  253        1    2064384 dm-1 To list all the disk in the machine ==> fdisk -l # fdisk -l /dev/?d? To avoid all the dm devices. # fdisk -l 2>/dev/null | grep "Disk \/" Disk /dev/sda: 16.1 GB, 16106127360 bytes Disk /dev/sdb: 2147 MB, 2147483648 bytes Disk /dev/mapper/VolGroup-lv_root: 13.5 GB, 13463715840 bytes Disk /dev/mapper/VolGroup-lv_swap: 2113 MB, 2113929216 bytes # lsblk NAME                   ...

Creating a SWAP partition in a LVM

Assuming that you have already created a physical volume ==> volume group. If not then click here..... Now firstly create a logical volume. Check the free space in your volume group by firing a command in terminal as vgdisplay VOLUMEGROUP NAME. [root@sunny ~]# vgdisplay vg_sunny   --- Volume group ---   VG Name               vg_sunny   System ID                Format                lvm2   Metadata Areas        1   Metadata Sequence No  3   VG Access             read/write   VG Status             resizable   MAX LV                0   Cur LV                2   Open LV               2   Max PV ...

Creating a SWAP partiton in Standard HDD layout.

Creating and activating a SWAP partition Check for any free space that is available in your HDD. [root@sunny ~]# parted GNU Parted 2.1 Using /dev/vda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) print free                                                       Model: Virtio Block Device (virtblk) Disk /dev/vda: 21.5GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number  Start   End     Size    Type      File system     Flags         32.3kB  1049kB  1016kB            Free Space  1      1049kB  525MB   524MB   primary   ext4            boot  2      525MB   4720MB  4194MB  prima...

Structure of Linux OS

In Linux the file system is based on one root directory, or hierarchical top point with subdirectories 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: / : 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. Ofte...

Boot into Single User-mode

Image
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 mo...