在VMWARE下增加空間並將其掛載到相應目錄

lirenquan發表於2011-03-13

 昨天在初始化安裝MYSQL時,報如下錯誤:
 [root@ora10g mysql]# scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
ERROR: 3  Error writing file './mysql/db.frm' (Errcode: 28)
101209  4:52:38 [ERROR] Aborting

101209  4:52:38 [Note] ./bin/mysqld: Shutdown complete


Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

You can try to start the mysqld daemon with:

    shell> ./bin/mysqld --skip-grant &

and use the command line tool ./bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> ./bin/mysql -u root mysql
    mysql> show tables

Try 'mysqld --help' if you have problems with paths.  Using --log
gives you a log in /var/lib/mysql that may be helpful.

Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS.  Another information source are the
MySQL email archives available at http://lists.mysql.com/.

Please check all of the above before mailing us!  And remember, if
you do mail us, you MUST use the ./bin/mysqlbug script!
去網上一查,發現原來是空間不夠導致,去確認下:
[root@ora10g mysql]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             3.8G  3.8G     0 100% /
/dev/sda3             6.0G  4.4G  1.4G  77% /u01
/dev/sdb1             4.0G  3.4G  354M  91% /u02
tmpfs                 401M     0  401M   0% /dev/shm

果然,/usr對應的掛載點/空間已經全部耗盡。為了解決 這個問題,決定增加一塊虛擬硬碟,然後劃分好空間後將空間掛載到/usr目錄下,下面是操作過程。
第一步:關閉虛擬機器
1)確認oracle測試庫已經關閉ps -ef | grep ora_,如果沒關閉,用shutdown immediate關閉資料庫
2)跳轉到root使用者,使用shutdown -h now關閉主機
第二步:在虛擬機器中增加一塊6G的硬碟。這個步驟全圖形化介面操作,這裡不作詳述
第三步:啟動主機
第四步:確認並對新磁碟進行分割槽操作
fdisk /dev/sdc
使用n選項和w選項建立分割槽,並將分割槽資訊寫入MBR中
第五步:對分割槽進行格式化
shell>mkfs.ext3 /dev/sdc1
第六步:將新格式化的資料掛載到一個目錄下
mount /dev/sdc1 /mnt/usr
第七步:將/usr目錄下的所有檔案複製到/mnt/usr下
shell>cp /usr/* /mnt/usr/
複製完後確認檔案複製
第八步:rm掉/usr目錄下的所有物件
shell>cd /usr
shell>rm -rf *
第九步:umount裝置/dev/sdc1
shell>umount /dev/sdc1
第十步:將/dev/sdc1掛載到/usr目錄下
mount /dev/sdc1 /usr
第十一步:修改檔案/etc/fstab,新增如下內容:
/dev/sdc1               /usr                    ext3    defaults        3 1

第十二步:測試安裝是否能成功完成
[root@ora10g usr]# cd /usr/local/mysql
[root@ora10g mysql]#  scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h ora10g password 'new-password'

Alternatively you can run:
./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./bin/mysqlbug script!

OK!

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12350275/viewspace-689317/,如需轉載,請註明出處,否則將追究法律責任。

相關文章