RemasterSYS


Intsall Remastersys in Ubuntu 12.04/14.04/16.04
===================================

Edit the source.list ,Add the following line
# gedit /etc/apt/sources.list
.......
#Remastersys Precise
deb http://ppa.launchpad.net/kranich/remastersys/ubuntu precise main
deb-src http://ppa.launchpad.net/kranich/remastersys/ubuntu
precise main  

#Remastersys Trusty
deb http://ppa.launchpad.net/kranich/remastersys/ubuntu trusty main
deb-src http://ppa.launchpad.net/kranich/remastersys/ubuntu trusty main 

#Remastersys Xenial
deb http://ppa.launchpad.net/kranich/remastersys/ubuntu xenial main
deb-src http://ppa.launchpad.net/kranich/remastersys/ubuntu xenial main 

#
OR
# add-apt-repository ppa:kranich/remastersys
# apt-get update
# apt-get install remastersys remastersys-gui 

RemasterSYS-CommandLine
------------------------------------------------


# remastersys dist myCustomDistro.iso         -------- WithOut Personal Data
# remastersys backup myCustomBackup.iso    -------- Full System ISO

Backup: ----This command allows you to clone/backup entire installations including your local settings and home folder. When using this, keep in mind to remove useless files from your home folder which occupy large space (may be movies, music etc), because remastersys make use of “genisoimage” utility, which bounds the size of iso image to be about 4.7 Gigs.

Dist:---- Dist command works similar to backup but it do not include your local settings or home folder, only global settings are kept. Use this to make custom iso’s to distribute to your friends (as the description says).

Distcdfs:---- Using this command  will backup all the system files and other things above command will do, but will not make the iso image. This is useful if you want to manually edit things. Just go to remastersys’ working directory (“/home/remastersys” by default) and edit whatever you want/can (do this at your own risk).

Distiso:---- When you have already used “distcdfs” command and made important changes you wanted, run this command to generate the iso file.


For Xubuntu-14.04
==================
# vi /etc/apt/source.list
...
## Remastersys
deb http://ppa.launchpad.net/mutse-young/remastersys/ubuntu trusty main
deb-src http://ppa.launchpad.net/mutse-young/remastersys/ubuntu trusty main

#

# apt-get update 

# apt-get install remastersys remastersys-gtk
# apt-get install ubiquity ubiquity-frontend-gtk


$ sudo  remastersys backup
OR
$ remastersys-gtk

Note: For Xubuntu14.04
========================
Comment out the line 245 of “/usr/bin/remastersys” beginning with [ “`grep lightdm /etc/X11/default-display-manager`” != “” ]


No Install Icon on RemaserSys LiveBoot
===================================
 If you don’t see an install icon on the desktop ,then open TERMINAL ( press CTRL + ALT +T).Now in the terminal just type  ubiquity --desktop %k gtk_uiand press ENTER key

LVM Reduce & Extend

Reduce LVM
Reduce the size of /storage Directory from 10GB to 8GB which is mounted via LVM(Backup the Data before reduce/extend).
#umount /storage
#e2fsck -f /dev/vgsvk/lvsvk
#resize2fs /dev/vgsvk/lvsvk 8G
#lvreduce -L 8G /dev/vgsvk/lvsvk
#mount -a --- If u have a fstab entry

Extend LVM
Reduce the size of /storage Directory from 8GB to 10GB which is mounted via LVM.
#umount /storage
#e2fsck -f /dev/vgsvk/lvsvk
#lvextend -L 10G /dev/vgsvk/lvsvk#resize2fs /dev/vgsvk/lvsvk
#mount -a --- If u have a fstab entry

ISO Images -- Creation&Manipulation

Create Backup Of a Directory in ISO Format
#mkisofs -J -r -T -o /home/svk.iso /home/svk
The above command take the backup of /home/svk directory and save the file in /home with a file name svk.iso

Mount ISO Images
# mount -o loop /home/svk.iso /media/
The above command mount the svk.iso file to /media directory.

Create ISO image of CD/DVD
# dd if=/dev/hdc of=/tmp/svk.iso
The above command create an ISO image of the CD in /tmp directory as filename svk.iso
(If the CD is a bootble one then the image will also bootable)

USB pen drive as a boot medium to start the installation

USB pen drive as a boot medium to start the installation
Attach the USB pen drive to a system which is already running Red Hat Enterprise Linux.
Use fdisk to partition the flash drive as follows:
There is a single partition.
This partition is numbered as 1.
Its partition type is set to 'b' (W95 FAT32).
It is tagged as bootable.
Format the partition created in the previous step as FAT:
mkdosfs /dev/sdb1
Mount the partition:
mount /dev/sdb1 /mnt
Copy the contents of /RedHat/isolinux/ from the first installation CD/DVD onto the flash drive, i.e. to /mnt.Note: the files isolinux.bin, boot.cat and TRANS.TBL are not needed and can thus be removed or deleted.
Rename the configuration file:
cd /mnt/; mv isolinux.cfg syslinux.cfg
Copy the installer's initial RAM disk /RedHat/images/pxeboot/initrd.img from the first installation CD/DVD onto the flash drive, i.e. to /mnt.
Optional step: To configure any boot settings, edit the syslinux.cfg on the USB flash drive. For example to configure the installation to use a kickstart file shared over NFS, specify the following:
linux ks=nfs:://ks.cfg
Unmount the flash drive:
umount /dev/sdb1
Make the USB flash drive bootable. The flash drive must be unmounted for this to work properly.
syslinux /dev/sdb1
Mount the flash drive again:
mount /dev/sdb1 /mnt
Install GRUB on the USB flash drive:
grub-install --root-directory=/mnt /dev/sdb
Verify that the USB flash drive has a /boot/grub directory. If it does not, create the directory manually.
cd /mntmkdir -p boot/grub
Create the grub.conf file. Below is a sample grub.conf:
default=0

timeout=5

root (hd1,0)

title Red Hat Enterprise Linux installer

kernel /vmlinuz

initrd /initrd.img
Copy or confirm the created grub.conf file is on the /boot/grub/ directory of the USB flash drive.
Unmount the flash drive:
umount /dev/sdb1
At this point, the USB disk should be bootable.
Attach the USB disk to the system you wish to install Red Hat Enterprise Linux on.
Boot from the USB disk. Refer to the hardware vendor's BIOS documentation for details on changing the order in which devices are checked for booting from.
Once you are booted in the Red Hat Enterprise Linux installer, continue with your network installation of choice.

Enable GUI Root login

Enable GUI Root login in Fedora13,RHEL6..etc
Step 1 :-Login as a root from your terminal
[itsolutions@svk]$ su – root
Password:-

Step 2:- Now go to your /etc/pam.d/ directory.
[root@svk]# cd /etc/pam.d/

Step 3:- Edit the gdm file (Find and Comment or remove below mentioned line into your gdm file )
[root@svk pam.d]# vi gdm
#auth required pam_succeed_if.so user != root quiet
Save & Exit From that File. ( In Fedora10 Till step 4 is enought to Login as a root from GUI but for Fedora 13 you need one more file to edit otherwise you cannot Login as a root even though you edited gdm file).

Step 4:- Here is the additional file that you need to edit and that file name is gdm-password. Open gdm-password file editor. (Find and Comment or remove below mentioned line from gdm-password file )
[root@svk pam.d]#vi gdm-password
#auth required pam_succeed_if.so user != root quiet

Step 5:- Save & Exit from File. Now Logout and Try to Login as a root user. Now you are able to Login as a root user from GUI

Small Tips

Make Normal users to run superuser commands

Edit .badhrc file in the users home dir as follows

Add the following line “export PATH=:$PATH:/usr/sbin:/sbin” .Then save and exit.

Relogin and check.

Find the Package name Which installs Particular Command

Find the location of command

# which ls -------> To Find the location of "ls" command

Find the Package name of command

# rpm -qf ls -----> To Find package name which install "ls" command

How to list partition tables

# fdisk -l


How to list filesystem disk space usage
# df -T -h

How to list mounted devices
# mount

How to list PCI devices

# lspci or /sbin/lspci
If the first does not work try the latter.

How to list USB devices
# lsusb

How to forcefully unmount CD/DVD-ROM manually
# umount /media/cdrom0/ -l

How to remount /etc/fstab without rebooting
# mount -a

How to generate MD5 checksum files
# md5sum file.iso > file.iso.md5

How to check MD5 checksum of files
e.g. Assumed that file.iso and file.iso.md5 are in the same folder
# md5sum -c file.iso.md5

How to mount/unmount Image (ISO) files without burning
# mkdir /media/iso
# modprobe loop
# mount file.iso /media/iso/ -t iso9660 -o loop
# umount /media/iso/

How to change computer name
# hostname your_new_computer_name

How to access network folders without mounting
e.g. Assumed that network connections have been configured properly
Network computer’s IP: 192.168.0.1
Shared folder’s name: linux
# smb://192.168.0.1/linux

How to connect into remote Fedora desktop
e.g. Assumed that remote Fedora machine have configured Remote Desktop
Remote Fedora machine: 192.168.0.1
# vncviewer -fullscreen 192.168.0.1:0

How to install support for NTFS
# yum -y install kernel-module-ntfs-$(uname -r)

How to disable history listing in Console mode
# rm -f $HOME/.bash_history
# touch $HOME/.bash_history
# chmod 000 $HOME/.bash_history

How to use Fedora Installation CD, to gain root user access
Insert Fedora CD #1 into your CD-ROM and boot from it
# linux rescue

How to restart GNOME/KDE without rebooting computer
‘Ctrl + Alt + Backspace’

How to switch to Console mode in GNOME/KDE
Press ‘Ctrl + Alt + F1′ (F2 - F6)
To switch back to GNOME/KDE modePress ‘Alt + F7′

How to install/uninstall .rpm files
To install .rpm file # rpm -i package_file.rpm
To uninstall .rpm file # rpm -e package_name

How to set System-wide Environment Variables
# cp /etc/bash.bashrc /etc/bash.bashrc_backupg
edit /etc/bash.bashrc
Append the System-wide Environment Variables at the end of file and save.

How to save “man” outputs into files
# man command | col -b > file.txt

How to convert Wallpaper to Splash Image for GRUB menu
# convert -resize 640×480 -colors 14 wallpaper.png
splashimage.xpm && gzip splashimage.xpm

More Quick How To’s ..............................


FTP Error After Changing the default directory

Following are the common errors will encounter when setting anonymous vsftp
vsftpd-2.0.5error: need to access to a designated dir for anonymous ftpSet following:anon_root=/var/www/html/docs5)
error: 500 OOPS: vsftpd: refusing to run with writable anonymous rootsympton
:Reason:
Change attribute of ftp directory
from drwxrwxrwx 3 root root 4096 Jun 13 18:42 docs
To dr-xr-xr-x 3 root root 4096 Jun 13 18:42 docs
i.e;
# chmod 555 /var/www/html/docs