33dots

Posts RSS Comments RSS

33dots.com moved to a new host

Finally this site is moved(hosting and registration) from Yahoo! to DreamHost.
A quick summary of the steps.

1. BackUps!
Yahoo doesn’t allow shell. So painstakingly downloaded the all the required contents to my local system using gFTP. This took about 1hr :(
Exported all the essential MySQL databases via phpMyAdmin

2. Unlocked the domain and copied the authorization code, which is required for the domain transfer.

3. Initiated a domain transfer form the DreamHost (DH) control panel.
You will be sent an email to the ID provided in your registration information to confirm the transfer. Confirmed it.

4.Set up web hosting for this domain at DH.
DH allows you to setup any number of websites to host under a single account.

5. Uploaded all the content to DH
Initially tried command,

[tony@localhost ~]$ scp -r 33dots/dump/ username@jaguars.dreamhost.com:work/

but got bored seeing individual files being transferred slowly.

then,

[tony@localhost ~]$ tar -czpf 33dots.tar.gz 33dots/dump/
[tony@localhost ~]$ scp 33dots.tar.gz username@jaguars.dreamhost.com:work/

I had to use host as jaguars.dreamhost.com because i have still not pointed my 33dots.com DNS entries to DH.

sshed to DH. and,

[tony@localhost ~]$ ssh username@jaguars.dreamhost.com
username@jaguars.dreamhost.com's password:
[jaguars]$ tar -xzpf 33dots.tar.gz
[jaguars]$ mv 33dots/dump/* ../33dots.com

6. Setup databases at DH
Created a new hostname and user for mysql.
Created the databases
Imported the .sqls via phpMyAdmin

7. Setup a dreamhosters.com account to test things.
I want to test everything is fine before doing the DNS changes. DH allows you to access your hosted sites, by creating a temporary subdomain like 33dots.dreamhosters.com. This allows you to access and test your site, which is otherwise inaccessible, until you point your DNS to DH.

Yes, everything seems fine. Ofcourse! absolute links are not working..
Deactivated the dreamhosters.com subdomain.

8. Setup Gmail for mail
I’ll be using gmail for the mail once the transfer is complete.
Went to http://www.google.com/a/cpanel/domain/new and setup the account. Yes, it wont be working until i change the MX records to point to google.

9. Changed my DNS entries at Yahoo(the registration transfer has not yet over, it will take 7-10 days) to point to DH.
Unsuccessful! an error is shown by yahoo. Perhaps,  since the transfer process is in progress, yahoo cant change the DNS now. Anyway no problems, i have the working version of the site still at yahoo and now also at DH. The email is also working, only thing is it is with yahoo.

10. Transfer process over!
I got mail from DH that the transfer is complete (5th day).

[tony@localhost ~]$ whois 33dots.com
---------
Registrar: NEW DREAM NETWORK, LLC
Name Server: NS1.DREAMHOST.COM
Name Server: NS2.DREAMHOST.COM
Name Server: NS3.DREAMHOST.COM
Status: ok
---------
[tony@localhost ~]$ nslookup 33dots.com
Non-authoritative answer:
Name:   33dots.com
Address: 69.163.171.212
[tony@localhost ~]$ host 69.163.171.212
212.171.163.69.in-addr.arpa domain name pointer apache2-emu.jaguars.dreamhost.com.

Mail is working fine from Gmail. The website too seems ok.
Now that the transfer is complete and the website is working fine, i deleted all the files and databases at yahoo and canceled the account!

No responses yet

Resized my root filesystem online

Wanted to increase the size of my root filesystem. I have my CentOS 5.3 in an LVM

[tony@localhost ~]$ df -h /
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/CentOsVG-RootLV
16G   11G  3.8G  75% /

Decided to use a less used NTFS partition. (i have a Linux/Windows multiboot system)

The steps i did,
1. Created a new Physical volume using the spare partition

[tony@localhost ~]$ su -
Password:
[root@localhost ~]# pvcreate /dev/sda8
Physical volume "/dev/sda8" successfully created

Use pvdisplay to see the newly created physical volume, if required.

2. Extended the Volume Group to include this physical volume.

[root@localhost ~]# vgextend CentOsVG /dev/sda8
Volume group "CentOsVG" successfully extended

3. Now, Enlarge the size of the Logical volume and then the filesystem.
I knew i have to use lvextend command, but got confused after reading the man pages, so finally decided to use the Graphical Utiliy. :-D
System > Administration > Logical Volume Management
Clicked on my volume group and then, the required logical volume and ‘Edit Properties‘.
Set the size to use the ‘Use Remaining‘ and Ok
The system prompted for enlarging file system size, and it was all over!

Later i figured out that i should have used the command,
lvextend /dev/CentOsVG/CentOsVG-RootLV /dev/sda8
or
lvextend /dev/CentOsVG/CentOsVG-RootLV/ -l +100%FREE

And perhaps increase the size of root filesystem by using resize2fs

Shouldn’t this require an umount of the /? And so use a ‘rescue environment’ or live CD?
No! Online increase of ext3 partitions are available from kernel 2.6.10

Finally checked the size of the root

[tony@localhost ~]$ df -h /
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/CentOsVG-RootLV
25G   11G   13G  47% /

No responses yet

The Linux File System basics

Each file in a Linux file system (eg, ext2, ext3) is described by an Inode, and every inode is identified by a unique number.
An Inode is a datastructure that describes the blocks of data the file occupies, as well as, metadata about the file like, the file’s owner and group owner, the file’s access permissions(eg rwx-r–r–), it’s size in bytes, timestamps telling when the file was created, last modified and last accessed and a count telling how many hard links point to the inode.
It should be noted that the filename is not stored in the inode.

A File’s name along with it’s inode number are stored in special files called directories. In other words, a directory is just another file, which is treated specially by the linux, and it contains a list of filenames along with their inode numbers. All these list of files are assumed to be contained within that directory.

Use ls -i to see the inode numbers of files and directorys .

[tony@localhost ~]$ ls -ila
total 820
65538 drwx-----x 57 tony tony    4096 Feb 22 12:18 .
65537 drwxr-xr-x  4 root root    4096 Jul  6  2009 ..
65997 drwx------  3 tony tony    4096 Jul  1  2009  adobe
66027 -rw-rw-r--  1 tony tony     352 Feb 18 21:56 .aspell.en.prepl

All the inodes of a file system are created at the moment we format the disk (eg, when we use mkfs command). Thus, the maximum number of inodes (and so the maximum number of files) that the filesystem can have, is determined during the filesystem’s creation itself.
These inodes are all kept together in inode tables towards the beginning of the partition. The inode tables usually occupy about 1% of the partition’s space when using the default settings.
The decision as to how many inodes to create is made on Linux using an algorithm. The default setting creates an inode for every 2K bytes contained in the filesystem, but the number can be adjusted by the user when creating the filesystem. For example, it can be wise to create fewer inodes when setting up a filesystem that will contain just a few large files.

It should be noted that, there are two ways in which a filesystem can run out of space: it can consume all the space for adding new data (i.e., to existing files or to new files), or it can use up all the available inodes even when space is left for adding data.
Use the command df -i to see the number of inodes available, used and free.

[tony@localhost ~]$ df -i
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/mapper/CentOsVG-RootLV
4161536  155678 4005858    4% /
/dev/sda9              26104      40   26064    1% /boot

Whenever a file is created, the kernel assigns a free inode to that file. The inode is updated to reflect the details of the file. The file’s name, along with that free inode’s number, is written to the directory, the file is supposed to be in.

Hard links and Symbolic links

Hard links are different filenames that point to same inode number (in essence to the same file).
A soft link or symbolic link is a file whose data contains the ‘path’ (eg, /home/tony/resume.txt) of another file(its target).

Since inode numbers are unique only within a filesystem, hard links cannot span across partitions or different filesystems. Where as softlinks can be to anywhere as long as a valid path is there to its target.

[tony@localhost test]$ echo "this is just some contents" > mytestfile  //create a file
[tony@localhost test]$ ln mytestfile myhardlink              //create a hardlink
[tony@localhost test]$ ln -s mytestfile mysoftlink           //create a softlink
[tony@localhost test]$ ls -li
total 8
2687664 -rw-rw-r-- 2 tony tony 27 Feb 22 14:59 myhardlink
2687665 lrwxrwxrwx 1 tony tony 10 Feb 22 14:58 mysoftlink -> mytestfile
2687664 -rw-rw-r-- 2 tony tony 27 Feb 22 14:59 mytestfile

Note in the above shell dialogue that the hardlink and the original file has the same inode number, and the same size.
The soft link has different inode number and of different size, obviously as it is another file whose data has the path to ‘mytestfile

Virtual File System

On top of the underlying filesystem, the linux maintains a Virtual FileSystem (VFS). The VFS is an interface for the operating system, system services, and programs to the underlying filesystem.
VFS allows Linux to support many, often very different, file systems, each presenting a common software interface to the VFS. All of the details of the underlying file systems are translated by VFS so that all file systems appear identical to the rest of the Linux kernel and to programs running in the system.
Each filesystem type supported by your VFS will have an associated driver routines loaded in to the kernel.
Linux’s Virtual File system layer allows you to transparently mount the many different file systems at the same time.

The /proc File System

The /proc file system really shows the power of the Linux Virtual File System. It does not really exist; neither the /proc directory nor its subdirectories and its files actually exist.
The /proc file system, like a real file system, registers itself with the Virtual File System. However, when the VFS makes calls to it requesting inodes as its files and directories are opened, the /proc file system creates those files and directories from information within the kernel.
For example, the kernel’s /proc/devices file is generated from the kernel’s data structures describing its devices.
The /proc file system presents a user readable window into the kernel’s inner workings.

References
http://tldp.org/LDP/tlk/fs/filesystem.html
http://www.linfo.org/inode.html

No responses yet

Backing up a MySQL MyISAM database using mysqldump.

Give the command,

[tony@localhost ~]$mysqldump --opt --user=username --password=
password --host=yourMySQLHostname dbname > output.sql

For bzipping it,

[tony@localhost ~]$mysqldump --opt --user=username --password=
password --host=yourMySQLHostname dbname | bzip2 -c > output.sql.bz2

To dump individual tables use the command,

[tony@localhost ~]$mysqldump --opt --user=username --password=
password --host=yourMySQLHostname dbname  (tablename tablename tablename) > output.sql

The --opt switch is a shorthand; it is the same as specifying --add-drop-table --add-locks --create-options --disable-keys --extended-insert --lock-tables --quick --set-charset
It should give you a fast dump operation and produce a dump file that can be reloaded into a MySQL server quickly.

For more information on individual options refer man mysqldump

No responses yet

No meta tags available for selection nodewords 6.x-1.2

After nodewords installation, there were no ‘Meta’ tags available in the Meta tag selection form (in the nodewords settings page). Enabling or disabling made no effect. Also no tags were shown in the HTML output. The ‘Global meta tags’ page told, ‘no metatags are selected in the settings page’.
Googling revealed that the scenario also happens if we upgrade to the same version.

Nodewords settings page

The solution is to clear the cache. Go to /admin/settings/performance and at the bottom click ‘clear cached data’.

No responses yet

Next »