linux poison RSS
linux poison Email
4

Read - Write support for NTFS partition on OpenSuse 11.x

The ntfs-3g driver is an open source, GPL licensed, third generation Linux NTFS driver which was implemented by the Linux-NTFS project. It provides full read-write access to NTFS, excluding access to encrypted files, writing compressed files, changing file ownership, access right.

Technically it's based on and a major improvement to the third generation Linux NTFS driver, ntfsmount. The improvements includes functionality, quality and performance enhancements.

First, of course install the drivers for reading - writing NTFS, if you have NTFS partitions, you can install it from the openSUSE installation CD/DVD or from the repository OSS using YAST, search for "ntfs" and install all the necessary package (below)




Now, just start from the root tool, ntfs-config and enable them to write support for NTFS partitions on your computer, this tool will detect the ntfs partition on your drive.



Or open as root with your favourite editor /etc/fstab, find the line of the partition that you want to enable write, in my case is this:

/dev/sda1 /mnt/c ntfs defaults 0 0

Now, replace the ntfs and default part of the above line with following:

ntfs-3g defaults, users

In my case, then you'll get:
/dev/sda1 /mnt/c ntfs-3g defaults,users

Restart you machine and check if you are able to read/write to NTFS partition.
Read more
4

Ext4 support on OpenSuse 11.1

Kernel 2.6.28 Released

Torvald released the final version of Linux Kernel 2.6.28. It's not a big change since RC 9, but it finally appeared as final after lots of discussion on LKML whether to postpone the release or release earlier and make the merge window longer as the developers goes on long holidays.

Here's some summary of Kernel 2.6.28 (taken from KernelNewbies): Linux 2.6.28 adds the first version of Ext4 as a stable filesystem, the much-expected GPU memory manager which will be the foundation of a renewed graphic stack, support for Ultra Wide Band (Wireless USB, UWB-IP), memory management scalability and performance improvements, a boot tracer, disk shock protection, the phonet network protocol, support of SSD discard requests, transparent proxy support, several new network drivers, controlable IO CPU affinity, high-resolution poll()/select(), support of a minimal "dummy" policy in SELinux, tracing improvements, x86 x2APIC support, a fb driver for VIA UniChrome devices, Mitac Mio A701 ARM-based smartphone support, some new drivers, improved device support, and many other small improvements and fixes.

More on the detailed can be viewed at KernelNewbies. The official announcement are here and here

Kernel Compilation:

1) Make sure you have all the required lib for kernel compilation
2) Download the latest kernel from www.kernel.org (2.6.28)
3) Untar the kernel source and move the folder (linux-2.6.28) under /usr/src/
4) Fire Following commands from /usr/src/linux-2.6.28 folder

# make xconfig

This will open a window where you can search for "ext4", select the ext4 options and save the changes (shown below)


# make rpm

5) This is will take some time for source compilation and making rpm file
Now go to — /usr/src/packages/RPMS/i386 where you will find the rpm file, install this rpm file using following command...

# rpm -ivh  kernel-2.6.289pae-1.i386.rpm
[DO NOT UPGRADE YOUR EXISTING KERNEL BY USING rpm -Uvh, instead install the new kernel using rpm -ivh]

This will install all the required files like  vmlinuz,system.map, etc .. into your /boot folder 

# mkinitrd -- This will create /boot/initrd-2.6.28-9-pae file which is required during booting of new kernel and you should see something like ...
Kernel image:   /boot/vmlinuz-2.6.28-9-pae
Initrd image:   /boot/initrd-2.6.28-9-pae
Root device:    /dev/disk/by-id/ata-ST3802110A_9LR2AE39-part2 (/dev/sda2) (mounted on / as ext3)
Resume device:    /dev/disk/by-id/ata-ST3802110A_9LR2AE39-part7 (/dev/sda7)
Kernel Modules:    scsi_mod libata sata_sil hwmon thermal_sys processor thermal pata_atiixp ata_generic ide-core atiixp ide-pci-generic fan jbd mbcache ext3 edd crc-t10dif sd_mod usbcore ohci-hcd uhci-hcd ehci-hcd hid usbhid
Features:       block usb resume.userspace resume.kernel
Bootsplash:    openSUSE (1024x768)
51347 blocks
6) Go to and edit the following file to add the new kernel to boot menu
# vi /boot/grub/menu.lst and add the following lines to it
title openSUSE 11.1 (2.6.28)
root (hd0,5)
kernel /boot/vmlinuz-2.6.28-9-pae root=/dev/sda2 vga=0×317 resume=/dev/sda7 splash=silent showopts
initrd /boot/initrd-2.6.28-9-pae
You can also install new kernel using Yast tool (system -> Boot Loader).



7) Now install the grub using following command
# grub-install /dev/sda
[Check you drive here or install it using YAST tool]

How to use Ext4

One very important thing to keep in mind is that there is NOT Ext4 GRUB support. Well, that wasn't exactly true: There is grub support, but the grub versions used by your current distro don't support it. There's support in the GRUB2 development branch, but only from this commit and ahead. There're available grub2 packages in Ubuntu and debian-derived distros as the grub-pc package. In the 0.9x branch, there's not official support, but there's a Google SoC project that developed support for it, and Google finds patches. So choose yourself. The next release of distros based in Linux 2.6.28 will probably have support in one way or another. The safe option is to keep your /boot directory in a partition formatted with Ext3.

You also need an updated e2fsprogs tool, of course, the latest stable version -1.41.3- is recommended.

Creating a new Ext4 filesystem from the scratch
The easiest one, recommended for new installations. Just update your e2fsprogs package to Ext4, and create the filesystem with mkfs.ext4.

Migrate existing Ext3 filesystems to Ext4
You need to use the tune2fs and fsck tools in the filesystem, and that filesystem needs to be unmounted. Run:

          tune2fs -O extents,uninit_bg,dir_index /dev/yourfilesystem

After running this command you MUST run fsck. If you don't do it, Ext4 WILL NOT MOUNT your filesystem. This fsck run is needed to return the filesystem to a consistent state. It WILL tell you that it finds checksum errors in the group descriptors - it's expected, and it's exactly what it needs to be rebuilt to be able to mount it as Ext4, so don't get surprised by them. Since each time it finds one of those errors it asks you what to do, always say YES. If you don't want to be asked, add the "-p" parameter to the fsck command, it means "automatic repair":

       fsck -pf /dev/yourfilesystem

There's another thing that must be mentioned. All your existing files will continue using the old indirect mapping to map all the blocks of data. The online defrag tool will be able to migrate each one of those files to a extent format (using a ioctl that tells the filesystem to rewrite the file with the extent format; you can use it safely while you're using the filesystem normally)

Finally do not forget to modify /etc/fstab.
Read more
16

Creating executable of Shell Script

Many times it happen that shell scripts that we write contains sensitive information like password or some sort of keys or path to some sensitive files and if you running such script it become very easy for the normal user to have a look inside the script and get the sensitive information from the code.
There is a program called "shc" which can provide the protection from such cases that developer wants.

shc itself is not a compiler such as cc, it rather encodes and encrypts a shell script and generates C source code with the added expiration capability. It then uses the system compiler to compile a stripped binary which behaves exactly like the original script. Upon execution, the compiled binary will decrypt and execute the code with the shell -c option. Unfortunatelly, it will not give you any speed improvement as a real C program would.

shc's main purpose is to protect your shell scripts from modification or inspection. You can use it if you wish to distribute your scripts but don't want them to be easily readable by other people.

Download shc (here) and untar it:
tar -xzvf shc-X.X.tgz
cd shc-X.X/
make
make install
This will install the shc binary on your box.

Create a file called: script.sh and add the following contents for testing purpose

############################### script.sh ##############################
#!/bin/sh
echo "This is a test shell script by Nikesh"
############################### script.sh ##############################

Now run the command:
shc -f script.sh

The switch "-f" specifies the source script to encrypt. The above command will create two files: script.sh.x.c and script.sh.x. The encrypted shell script is: script.sh.x. Run that binary and see the output:

./script.sh.x
This is a test shell script by Nikesh
Now you can distibute the script.sh.x without any fear

You can also specify a time limit on the shell script so that it will no longer execute after a certain date (expire) and you can specify a custom message to echo back to the user.

shc -e 09/12/2008 -m "Licence expire, please contact author - Nikesh" -f script.sh
./script.sh.x
./script.sh.x has expired!
Licence expire, please contact author - Nikesh

Check out the man pages for more info on "shc".
Read more
0

Quick and Easy VNC Server setup

VNC, or Virtual Networked Computing, is a way of controlling a remote computer just as though you are sitting in front of it. In the Windows world it is also known as remote desktop but it's normally referred to as VNC in the Linux world. All that happens is that you connect using a VNC client to a remote computer running the VNC server, then an image of the remote desktop is transmitted to your local computer and you can see and control the desktop just as though you are there since all keyboard and mouse commands are sent from your client machine to the server.

Step:1: Installation
First check if you already have them installed on your system, open a terminal and type:
 $ rpm -qa | grep vnc 
           vnc-server-4.1.2-9.el5
If you get an output something like this then you're all ready, if not you need to install them via yum.

Step 2 : Start the VNC server.
$ vncserver
 ......

New 'server:1 (user)' desktop is server:1

This will ask for password, you need to remember this password and need to provide it at the time of connecting to the server through VNC client.

Step 3 : Connecting from VNC client
From client run vncviewer   (dont run remote desktop connection from winxp or win2003 .they are using different protocol.)
In server enter : server:1
enter password: **********
And you will see the screen with one terminal open because by default vnc starts twm desktop.
For getting your gnome desktop
Go to folder /user/.vnc/ (user home directory) and open file xstartup using vi editor and uncomment or add the following lines
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
Restart the vncserver and connect to it using vncviewer, you should now see your default desktop, something like ..
Read more
0

A script for managing file archives of various types

atool  is a script for managing file archives of various types (tar, tar+gzip, zip etc).

The main command is aunpack which extracts files from an archive. Did you ever extract files from an archive, not checking whether the files were located in a subdirectory or in the top directory of the archive, resulting in files scattered all over the place? aunpack overcomes this problem by first extracting to a new directory. If there was only a single file in the archive, that file is moved to the original directory. aunpack also prevents local files from being overwritten by mistake.

The other commands provided are apack (to create archives), als (to list files in archives), and acat (to extract files to standard out). As atool invokes external programs to handle the archives, not all commands may be supported for a certain type of archives.

atool identifies archives by their file extension. Sometimes this is not possible - for instance rar archives usually have varying numeric file extensions. In those cases when atool can't identify the format, file is used instead. (atool can be configured not to use file.)

atool is written in Perl by Oskar Liljeblad and is free software (GNU General Public License ).

Download
The latest version of atool is 0.35.0, which was released on 2008-06-08:
Source code tarball
Debian package (all architectures)
RPM package (all architectures)

Building from source
To build all files, simply run: ./configure
The configure script accepts a few options - use the following command to show them: ./configure --help

Installation
Installing atool is a matter of copying the atool file to some appropriate directory for executable files, usually /usr/local/bin. After that, symbolic links for apack, aunpack, als and acat to atool should be created in the same directory. All this can be done automaticly by running: make install

Usage and Configuration
A list of options that atool accepts can be displayed by running atool with the --help option:  atool --help
Please see the manual page for atool for full use and configuration information. This document can usually be viewed this way:  man ./atool.1
Read more
Related Posts with Thumbnails