linux poison RSS
linux poison Email
0

HowTo Resize a Partition

Before resizing a partition, boot into rescue mode. Read this for booting into rescue mode.

Start parted, where /dev/sda is the device on which to resize the partition:

parted /dev/sda

View the current partition table to determine the minor number of the partition to resize as well as the start and end points for the partition:

print

To resize the partition, use the resize command followed by the minor number for the partition, the starting place in megabytes, and the end place in megabytes. For example:

resize 3 1024 2048

After resizing the partition, use the print command to confirm that the partition has been resized correctly, is the correct partition type, and is the correct file system type.

After rebooting the system into normal mode, use the command df to make sure the partition was mounted and is recognized with the new size.
Read more
0

HowTo execute the program during Linux startup

The /etc/rc.d/rc.local script is executed by the init command at boot time or when changing runlevels. Adding commands to the bottom of this script is an easy way to perform necessary tasks like starting special services or initialize devices without writing complex initialization scripts in the /etc/rc.d/init.d/ directory and creating symbolic links.
Read more
0

HowTo boot the system into Resuce/Single-User or Emergency Mode

Booting into Rescue Mode

Rescue mode provides the ability to boot a small Linux environment entirely from CD-ROM, or some other boot method, instead of the system's hard drive.

As the name implies, rescue mode is provided to rescue you from something. During normal operation, your Linux system uses files located on your system's hard drive to do everything — run programs, store your files, and more.

Once you have booted using bootable disk, add the keyword rescue as a kernel parameter.

linux rescue

Booting into Single-User Mode

One of the advantages of single-user mode is that you do not need a boot CD-ROM; however, it does not give you the option to mount the file systems as read-only or not mount them at all.

In single-user mode, your computer boots to runlevel 1. Your local file systems are mounted, but your network is not activated.

use the following steps to boot into single-user mode:

1.At the GRUB splash screen at boot time, press any key to enter the GRUB interactive menu.
2.Select Linux with the version of the kernel that you wish to boot and type a to append the line.
3.Go to the end of the line and type single as a separate word (press the Spacebar and then type single). Press Enter to exit edit mode.

Emergency Mode

In emergency mode, you are booted into the most minimal environment possible. The root file system is mounted read-only and almost nothing is set up. The main advantage of emergency mode over single-user mode is that the init files are not loaded. If init is corrupted or not working, you can still mount file systems to recover data that could be lost during a re-installation.

To boot into emergency mode, use the same method as described for single-user mode, with one exception, replace the keyword single with the keyword emergency.

Reference: Here 
Read more
0

HowTo make Installation Boot CD-ROM (RedHat)

isolinux is used for booting the Red Hat. To create your own CD-ROM to boot the installation program, use the following instructions:

Copy the isolinux/ directory from the Red Hat Enterprise Linux DVD or CD #1 into a temporary directory

cp -r /isolinux/

Change directories to the directory you have created:

cd

Make sure the files you have copied have appropriate permissions:

chmod u+w isolinux/*

Finally, issue the following command to create the ISO image file:

mkisofs -o file.iso -b isolinux.bin -c boot.cat -no-emul-boot \ -boot-load-size 4 -boot-info-table -R -J -v -T isolinux/

Burn the resulting ISO image (named file.iso and located in ) to a CD-ROM as you normally would.
Read more
0

Limiting large requests in apache

Apache has several directives that allow you to limit the size of a request, this can also be useful for mitigating the effects of a denial of service attack.

A good place to start is the LimitRequestBody directive. This directive is set to unlimited by default. If you are allowing file uploads of no larger than 1MB, you could set this setting to something like:

LimitRequestBody 1048576

If you're not allowing file uploads you can set it even smaller.

Some other directives to look at are LimitRequestFields, LimitRequestFieldSize and LimitRequestLine. These directives are set to a reasonable defaults for most servers, but you may want to tweak them to best fit your needs. See the documentation for more info.
Read more
Related Posts with Thumbnails