So, you have windows xp and linux (preferably ubuntu) installed on your system. And you did not install windows vista because it has issues with running some games and also because it is a resource hog. It chews on your resources until none is left. Well, you saw windows 7, you read its reviews and you figured out that maybe you should try windows 7. Here is a how-to of how i went about installing windows 7 and the moments of despair and surprise associated with it.
First of all, you have to download windows 7 from the microsoft's site. I was surprised that microsoft - for the first time in the history of mankind is giving out windows 7 OS for free (even if it is for a year only). Go ahead and download Windows 7. Select the version you want to download 32 bit or 64 bit. Preferably you should go with 32 bit if dont want to worry much about compatibility issues. But if you feel very adventurous, you can also try out the 64 bit version. The 32 bit is of around 2.5 GB and the 64 bit is of around 3 GB. I was surprised by the download speed. I was ablt to download it in an hour or so.
Next, get a DVD-R, and burn the image on DVD-R. But before you proceed to installing windows 7, you need to create some space on your already filled up drive. I have a 500 GB drive with 250 GB dedicated to dumps of games and movies and songs and pics. Out of the remaining 250 GB, i had 100 GB dedicated to windows xp and 150 GB dedicated to linux (2 drives - 100 GB /home and 50 GB /). So, to create more space i decided to shrink my linux drives to 70 GB /home and 30 GB / making around 50 GB free space for windows 7.
To go about resizing partitions, i first decided to use partition magic. But then the geek within me protested. Why should i go ahead and find a crack for a paid partition editor when i can use something like gparted (in linux) to do the same work. I popped in a live cd of kubuntu 8.10 (thinking about it now - i should have created a live cd of ubuntu 9.04). After boot up, I found out that kubuntu does not ship with gparted installed. Hell, so i did a "sudo apt-get install gparted" to install gparted on the virtual drive. It took around 10-15 minutes on my 256 KB connection.
After opening up gparted i simply resized the required partitions and applied the changed. Resizing a partition is an easy job. But moving partitions around is a heavy job. So make changes in such a manner that moving parititons around should not be necessary. I made the mistake of moving my bigger partition (70 GB) and i realized it later. It took around 1.5 hours to do this. And it is always advisable to backup your important data on an external drive before doing this. In case you screw up.
By luck every thing went well and later i was able to boot up both in windows xp & ubuntu.
Now was the time to start installation of windows 7. I popped in the DVD and the main screen came up. Remember to write down the product key that you got during downloading the iso. Windows still punishes you severely if you dont write down the product key. It asks the product key in the middle of installation and if you have forgotten to note down the product key, you will have to do all the work again.
The installation of windows 7 took around 45 minutes. The bad thing is that at times there is no activity and I was confused whether anything is happening or not. Remember to wait and watch. Basically there are 3 steps in installation. Remember to choose custom installation and the free space on your drive for installation. I was surprised that installation started in a flash after i selected the drive. I was hoping to get an installation summary and an option of correcting any mistake i had done. So be-ware, a wrong click and kill your system. Remember to remove the DVD during the first boot - it does not prompt you to do so, but if you dont, you would be starting the installation again. After 2-3 reboots your system is ready and you will get a boot screen (black and white) with option for "earlier version of windows" or "windows 7".
Now all you need to do is restore your grub boot menu. Again pop in your ubuntu live cd and boot up ubuntu. Open a terminal and type.
sudo grub
grub> find /boot/grub/stage1
If you get error 15 "file not found" try
grub> find /grub/stage1
You will get something like (hdX,Y). Do
grub> root (hdX,Y)
grub> setup (hd0)
grub> quit
Now simply reboot and you should be getting your grub boot menu back. Select windows and get the boot menu for windows xp / windows 7.
Whew!!!!
Showing posts with label partitioning. Show all posts
Showing posts with label partitioning. Show all posts
Friday, June 05, 2009
Saturday, August 05, 2006
mysql partitioning
Table partitioning is a concept which allows data to be stored in multiple locations on one or more disks and access to the data is through SQL queries. The way data is stored and retrieved is invisible to the end user.
Mysql allows the user to select the rules based on which data would be spread over multiple partitions in a table. Mysql supports horizontab partitioning whereby the rows of a table are spread across multiple locations. Support for vertical partitioning is not there. So using mysql partitioning, you cannot assign different columns to different physical partitions of a table.
Benefits of partitioning a table :
1. Being able to store more data in one table than can be held on a single disk or filesystem partition. Though current operating systems allow extremely huge files on the disk.
2. Data that loses its usefulness can often be easily be removed from the table by dropping the partition containing only that data. And adding of new data can be facilitated by adding a new partition specially for that data.
3. Some queries can be greatly optimized in virtue of the fact that data satisfying a given WHERE clause can be stored only on one or more partitions, thereby excluding any remaining partitions from the search. Data can also be re-organized to move more frequently accessed data to one partition.
4. Queries involving aggregate functions such as SUM() and COUNT() can easily be parallelized.
5. Greater query throughput can be achieved by spreading data seeks over multiple disks.
I had used partitioning with MYIASM tables and found out that they were very useful. The complete logic of how rows were divided and stored and how they need to be accessed was invisible to me. What happened when i created some partitions for the table is that the same number of .MYI and .MYD files were created. Though the table definition remained in the single .frm file. A separate .PAR file was created for the table which i think was being used to define the logic of how database was being partitioned.
Moreover, an insert on the table locks all the partitions for a small time that is, the time needed by mysql to decide in which partition the record should be put.
The logic using which a table can be partitioned are listed as below:
RANGE partitioning -> Here table partitions are defined based on a range of data to be stored in each partition. For example -
CREATE TABLE abc (
name VARCHAR(100) NOT NULL,
email VARCHAR(40),
dob DATE NOT NULL
)
PARTITION BY RANGE( YEAR(dob) ) (
PARTITION p0 VALUES LESS THAN (1960),
PARTITION p1 VALUES LESS THAN (1970),
PARTITION p2 VALUES LESS THAN (1980),
PARTITION p3 VALUES LESS THAN (1990),
PARTITION p4 VALUES LESS THAN MAXVALUE
);
This would create 5 partitions in the table abc. Partition p0 will contain records whose dob is from 0 to 1959, partition p1 will contain records whose dob is from 1960 to 1969 and so on. In case a row is entered whose dob cannot be accomodated in any of the partitions, an error is thrown and the data is not inserted in the table.
LIST partitioning -> Here table partitions are defined based on a list of data for each partition. Rows which satisfy a criteria list is inserted in that partition.
CREATE TABLE abcs (
name VARCHAR(100),
dob DATE NOT NULL DEFAULT '1979-01-01'
age INT
)
PARTITION BY LIST(age) (
PARTITION p0 VALUES IN (3,5,6,9,17),
PARTITION p1 VALUES IN (1,2,10,11,19,20),
PARTITION p2 VALUES IN (4,12,13,14,18),
PARTITION p3 VALUES IN (7,8,15,16)
);
This would create 4 partitions in the table abcs. Partition p0 would contain records whose age would be 3,5,6,9 or 17. Again if you try to insert a record whose dob is not in any of the partition list created, an error is thrown and the record is not inserted.
LINEAR HASH partitioning -> Here table data is evenly divided between all partitions using some simple functions. for example
CREATE TABLE abc (
name VARCHAR(100),
dob DATE NOT NULL DEFAULT '1970-01-01',
age INT
)
PARTITION BY HASH( YEAR(dob) )
PARTITIONS 4;
Here 4 partitions are created and data is distributed using the following formula
Partition number = MOD(YEAR(dob),number_of_partitions);
So since my date of birth is 1980, my record will be in partition number 0.
LINEAR HASH partitioning -> This is almost similar to hash partitioning except for the fact that the algorithm used to divide data is different. The syntax is also almost same. We use PARTITION BY LINEAR HASH instead of PARTITION BY HASH.
The algorithm used is :
Given an expression expr, the partition in which the record is stored when linear hashing is used is partition number N from among num partitions, where N is derived according to the following algorithm:
The advantage in partitioning by linear hash is that the adding, dropping, merging, and splitting of partitions is made much faster, which can be beneficial when dealing with tables containing extremely large amounts of data. The disadvantage is that data is less likely to be evenly distributed between partitions as compared with the distribution obtained using regular hash partitioning.
KEY partitioning ->
Partitioning by key is similar to partitioning by hash, except that where hash partitioning employs a user-defined expression, the hashing function for key partitioning is supplied by the MySQL server. The syntax used is PARTITION BY KEY instead of PARTITION BY HASH.
In most of the cases either a primary key or an unique key is used to create partitions.
Mysql also supports sub partitioning whereby a partition can be divided into further sub partitions of similar type.
I think i am creating a very long blog for mysql partitioning. However there are a list of syntaxes available on the mysql site to alter, analyze, optimize, rebuild, checking and repairing partitions. Please check http://dev.mysql.com/doc/refman/5.1/en/partitioning.html. It will give a more detailed idea of whatever ranting i have done over here...
I will be signing off from here now. Next blog may or may not contain more info about partitions...
Anyways will keep blogggging...
Mysql allows the user to select the rules based on which data would be spread over multiple partitions in a table. Mysql supports horizontab partitioning whereby the rows of a table are spread across multiple locations. Support for vertical partitioning is not there. So using mysql partitioning, you cannot assign different columns to different physical partitions of a table.
Benefits of partitioning a table :
1. Being able to store more data in one table than can be held on a single disk or filesystem partition. Though current operating systems allow extremely huge files on the disk.
2. Data that loses its usefulness can often be easily be removed from the table by dropping the partition containing only that data. And adding of new data can be facilitated by adding a new partition specially for that data.
3. Some queries can be greatly optimized in virtue of the fact that data satisfying a given WHERE clause can be stored only on one or more partitions, thereby excluding any remaining partitions from the search. Data can also be re-organized to move more frequently accessed data to one partition.
4. Queries involving aggregate functions such as SUM() and COUNT() can easily be parallelized.
5. Greater query throughput can be achieved by spreading data seeks over multiple disks.
I had used partitioning with MYIASM tables and found out that they were very useful. The complete logic of how rows were divided and stored and how they need to be accessed was invisible to me. What happened when i created some partitions for the table is that the same number of .MYI and .MYD files were created. Though the table definition remained in the single .frm file. A separate .PAR file was created for the table which i think was being used to define the logic of how database was being partitioned.
Moreover, an insert on the table locks all the partitions for a small time that is, the time needed by mysql to decide in which partition the record should be put.
The logic using which a table can be partitioned are listed as below:
RANGE partitioning -> Here table partitions are defined based on a range of data to be stored in each partition. For example -
CREATE TABLE abc (
name VARCHAR(100) NOT NULL,
email VARCHAR(40),
dob DATE NOT NULL
)
PARTITION BY RANGE( YEAR(dob) ) (
PARTITION p0 VALUES LESS THAN (1960),
PARTITION p1 VALUES LESS THAN (1970),
PARTITION p2 VALUES LESS THAN (1980),
PARTITION p3 VALUES LESS THAN (1990),
PARTITION p4 VALUES LESS THAN MAXVALUE
);
This would create 5 partitions in the table abc. Partition p0 will contain records whose dob is from 0 to 1959, partition p1 will contain records whose dob is from 1960 to 1969 and so on. In case a row is entered whose dob cannot be accomodated in any of the partitions, an error is thrown and the data is not inserted in the table.
LIST partitioning -> Here table partitions are defined based on a list of data for each partition. Rows which satisfy a criteria list is inserted in that partition.
CREATE TABLE abcs (
name VARCHAR(100),
dob DATE NOT NULL DEFAULT '1979-01-01'
age INT
)
PARTITION BY LIST(age) (
PARTITION p0 VALUES IN (3,5,6,9,17),
PARTITION p1 VALUES IN (1,2,10,11,19,20),
PARTITION p2 VALUES IN (4,12,13,14,18),
PARTITION p3 VALUES IN (7,8,15,16)
);
This would create 4 partitions in the table abcs. Partition p0 would contain records whose age would be 3,5,6,9 or 17. Again if you try to insert a record whose dob is not in any of the partition list created, an error is thrown and the record is not inserted.
LINEAR HASH partitioning -> Here table data is evenly divided between all partitions using some simple functions. for example
CREATE TABLE abc (
name VARCHAR(100),
dob DATE NOT NULL DEFAULT '1970-01-01',
age INT
)
PARTITION BY HASH( YEAR(dob) )
PARTITIONS 4;
Here 4 partitions are created and data is distributed using the following formula
Partition number = MOD(YEAR(dob),number_of_partitions);
So since my date of birth is 1980, my record will be in partition number 0.
LINEAR HASH partitioning -> This is almost similar to hash partitioning except for the fact that the algorithm used to divide data is different. The syntax is also almost same. We use PARTITION BY LINEAR HASH instead of PARTITION BY HASH.
The algorithm used is :
Given an expression expr, the partition in which the record is stored when linear hashing is used is partition number N from among num partitions, where N is derived according to the following algorithm:
- Find the next power of 2 greater than num. We call this value V; it can be calculated as:
V = POWER(2, CEILING(LOG(2, num))) - Set N = F(column_list) & (V - 1).
- While N >= num
{
Set V = CEIL(V / 2)
Set N = N & (V - 1)
}
The advantage in partitioning by linear hash is that the adding, dropping, merging, and splitting of partitions is made much faster, which can be beneficial when dealing with tables containing extremely large amounts of data. The disadvantage is that data is less likely to be evenly distributed between partitions as compared with the distribution obtained using regular hash partitioning.
KEY partitioning ->
Partitioning by key is similar to partitioning by hash, except that where hash partitioning employs a user-defined expression, the hashing function for key partitioning is supplied by the MySQL server. The syntax used is PARTITION BY KEY instead of PARTITION BY HASH.
In most of the cases either a primary key or an unique key is used to create partitions.
Mysql also supports sub partitioning whereby a partition can be divided into further sub partitions of similar type.
I think i am creating a very long blog for mysql partitioning. However there are a list of syntaxes available on the mysql site to alter, analyze, optimize, rebuild, checking and repairing partitions. Please check http://dev.mysql.com/doc/refman/5.1/en/partitioning.html. It will give a more detailed idea of whatever ranting i have done over here...
I will be signing off from here now. Next blog may or may not contain more info about partitions...
Anyways will keep blogggging...
Tuesday, March 28, 2006
mysql 5.1
Had evaluated mysql 5.1 and found it to be very good.
Check this out
[root@localhost mysql5]# ./bin/mysqladmin -u root -pjayant status
Uptime: 38621 Threads: 2 Questions: 98346998 Slow queries: 0 Opens: 0 Flush tables: 1 Open tables: 119 Queries per second avg: 2546.464
The no of queries/second is very high. And the load on the machine is around 2.
Have tried out mysql partitioning on one of the tables. The table has large no of rows - around 90,000,000. And the results were very good. I was able to get large no of queries serverd at the same time from the table.
Few more improvements in the partitioning algorithm can make it rock.
1. Parallel execution of queries on all partitions
2. More efficient administrative commands like alter, add, COALESCE partitions.
3. Decrease locking time of partitions not required in a query.
4. Provision to lock a partition without affecting other partitions.
For more information on partitioning pls go thru the following blog
http://mikaelronstrom.blogspot.com
Hope mysql 5.1 works out fine...
Check this out
[root@localhost mysql5]# ./bin/mysqladmin -u root -pjayant status
Uptime: 38621 Threads: 2 Questions: 98346998 Slow queries: 0 Opens: 0 Flush tables: 1 Open tables: 119 Queries per second avg: 2546.464
The no of queries/second is very high. And the load on the machine is around 2.
Have tried out mysql partitioning on one of the tables. The table has large no of rows - around 90,000,000. And the results were very good. I was able to get large no of queries serverd at the same time from the table.
Few more improvements in the partitioning algorithm can make it rock.
1. Parallel execution of queries on all partitions
2. More efficient administrative commands like alter, add, COALESCE partitions.
3. Decrease locking time of partitions not required in a query.
4. Provision to lock a partition without affecting other partitions.
For more information on partitioning pls go thru the following blog
http://mikaelronstrom.blogspot.com
Hope mysql 5.1 works out fine...
Subscribe to:
Posts (Atom)