Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Since I was the one who suggested that, I guess I have to share in the blame, but I don't see what is wrong with it.
With the system running, put that line back in /etc/fstab, perhaps changing "barrier=0" to "barrier=0,noauto" to stop the automatic mounting during boot, and then see what messages you get from a simple
Code:
mount /var/lib/mysql
At least that way you can record the error messages.
No blame to you, just me and fstab. I did as you suggested, and below are the results.
Code:
[root@devserver ~]# mount /var/lib/mysql
mount: special device /dev/mapper/VolGroup/lv_mysql does not exist
[root@devserver ~]#
Quote:
Originally Posted by Firerat
Edit: then unmount!
I didn't. You don't mean before rebooting, right?
Quote:
Originally Posted by syg00
- whoever updated fstab is responsible, not fstab.
It was strictly fstabs fault, and not the innocent individual who updated it.
Quote:
Originally Posted by syg00
- why are you trying to disable write barriers in ext3 (which doesn't enable them by default) ?.
Quote:
Originally Posted by rknichols
Really? That is contrary to the mount command manpage, which states:
"The ext3 filesystem enables write barriers by default,"
and warns against turning them off.
To the OP: If it's the "barrier=0" causing a problem in /etc/fstab, you might try the alternative "nobarrier".
That is saying there is no ext3 filesystem on that LV.
Stop!
Let's review what you did. Does this agree with the sequence of your actions?
service mysqld stop
lvcreate -L 100G -n lv_mysql VolGroup
mv /var/lib/mysql /var/lib/mysql.bak
mkfs -t ext3 /dev/VolGroup/lv_mysql
mkdir /var/lib/mysql
mount -t ext3 -o barrier=0 /dev/VolGroup/lv_mysql /var/lib/mysql
cp -a /var/lib/mysql.bak/ /var/lib/mysql
lvextend -l +100%FREE /dev/VolGroup/mysql
resize2fs /dev/VolGroup/lv_mysql
Most importantly, was it "cp" or "mv" that you used in step 7? If you used "mv" your data is seriously at risk now, and we have to work very carefully.
What is the output from "file -s /dev/mapper/VolGroup-lv_mysql" ?
Does "ls -l /dev/mapper" reveal any possible mis-typings of the VG-LV name?
There will be a history of the LVM actions in the /etc/lvm/archive directory. Run
Most importantly, was it "cp" or "mv" that you used in step 7? If you used "mv" your data is seriously at risk now, and we have to work very carefully.
Definitely mv and not copy. Note that I current do not have any data I care about, and am open to reinstalling MySQL. I am 99% sure I did exactly this:
Code:
service mysqld stop
mv /var/lib/mysql /var/lib/mysql.bak
mkdir var/lib/mysql
# Mount the new partition
mount -t ext3 -o barrier=0 /dev/VolGroup/lv_mysql /var/lib/mysql
mv /var/lib/mysql.bak/* /var/lib/mysql
service mysqld start
Quote:
Originally Posted by rknichols
What is the output from "file -s /dev/mapper/VolGroup-lv_mysql" ?
Code:
[root@devserver bidjunction]# file -s /dev/mapper/VolGroup-lv_mysql
/dev/mapper/VolGroup-lv_mysql: symbolic link to `../dm-3'
[root@devserver bidjunction]#
Quote:
Originally Posted by rknichols
Does "ls -l /dev/mapper" reveal any possible mis-typings of the VG-LV name?
Definitely mv and not copy. Note that I current do not have any data I care about, and am open to reinstalling MySQL. I am 99% sure I did exactly this:
Code:
service mysqld stop
mv /var/lib/mysql /var/lib/mysql.bak
mkdir var/lib/mysql
# Mount the new partition
mount -t ext3 -o barrier=0 /dev/VolGroup/lv_mysql /var/lib/mysql
mv /var/lib/mysql.bak/* /var/lib/mysql
service mysqld start
Code:
[root@devserver bidjunction]# file -s /dev/mapper/VolGroup-lv_mysql
/dev/mapper/VolGroup-lv_mysql: symbolic link to `../dm-3'
[root@devserver bidjunction]#
It is odd that the find command did not dereference the symbolic link, as it should by default. Try again with
It really looks like the ext3 filesystem never got created, in which case the mount command would have failed right there. That would mean your mv command would have moved the data right back into the newly created /var/lib/mysql directory. (I assume the missing "/" in your mkdir command above is just a typo.) With the new partition unmounted (Of course it's not mounted -- it wouldn't mount!), what do you get from
[root@devserver ~]# file -s -L /dev/mapper/VolGroup-lv_mysql /dev/dm-3
/dev/mapper/VolGroup-lv_mysql: Linux rev 1.0 ext3 filesystem data (needs journal recovery) (large files)
/dev/dm-3: Linux rev 1.0 ext3 filesystem data (needs journal recovery) (large files)
[root@devserver ~]#
Quote:
Originally Posted by rknichols
I assume the missing "/" in your mkdir command above is just a typo.
Yep. I was 99% sure but not 100%
Quote:
Originally Posted by rknichols
It really looks like the ext3 filesystem never got created, in which case the mount command would have failed right there. That would mean your mv command would have moved the data right back into the newly created /var/lib/mysql directory. ... With the new partition unmounted (Of course it's not mounted -- it wouldn't mount!), what do you get from
Code:
ls -A /var/lib/mysql /var/lib/mysql.bak
Code:
[root@devserver ~]# ls -A /var/lib/mysql /var/lib/mysql.bak
/var/lib/mysql:
bidjunction ib_logfile0 mysql performance_schema
gitlabhq_production ib_logfile1 mysql.sock website_tracker
ibdata1 lost+found osticket
/var/lib/mysql.bak:
ibdata1 ib_logfile0 ib_logfile1 mysql performance_schema test
[root@devserver ~]#
Note that I believe I tried mounting/moving before turning off MySQL, and /var/lib/mysql was automatically created (confused me for a while). Don't know if that could have been part of the cause.
You do have an ext3 filesystem now on /dev/mapper/VolGroup-lv_mysql, so it should mount. In fact, it might even be mounted right now -- hence the "needs journal recovery". See what "df /var/lib/mysql" shows as the device. If that non-empty directory is still part of lv_root, then you have files created on what should be a mount point directory. You will have to figure out whether it's those files or the ones in the lv_mysql device that are the ones you want to keep and get rid of the others.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.