/Var becomes a read-only system solution

Source: Internet
Author: User
Tags rsync

Background:

One of the rsync server suddenly has a problem, the client cannot rsync file in the past, log on to the servers to view, found/var becomes read-only, all files can not write to it, resulting in unable to write to the log, and restart the service is also said that the disk is read-only; var after a number of operations (Fsck/remount), will not be able to change the partition to RW, dead and alive are read-only, and viewing DMESG There are many error messages: SCSI error: <0 0 0 0> return code = 0x8000002 Info fld=0x16e5296, Deferred sda:sense key Hardware Error, the general processing method is to comment out the paragraph in/etc/fstab, and then reboot again remount, but due to the particularity of the server, Afraid of restarting after restarting and affect the business, so take the following methods to solve:


[[email protected] /] #mkdir  /home1/bak/varbackup[[email protected] /] #mount  -- move /var /home1/bak/varbackup[[email protected] /] #rm  -rf /var [[email  protected] /] #cd  /[[email protected] /] #mkdir  -p /home1/bak/var[[email  protected] /] #ln  -s /home1/bak/var  /var[[email protected] /] #cp  -r /home1/bak/varbackup/* /var/modifying/etc/fstab:[[email protected] /]# cat / Etc/fstablabel=/ / ext3 defaults 1 1label=/boot /boot ext3 defaults  1 2none /dev/pts devpts gid=5,mode=620  0 0none /dev/shm  tmpfs defaults 0 0label=/home /home ext3    defaults         1 2label=/home1 /home1 ext3    defaults         1 2label=/home2 /home2 ext3    defaults         1 2LABEL=/home3 /home3 ext3    defaults         1 2LABEL=/data2 /data2 ext3     defaults        0 0none /proc proc     defaults        0 0none /sys sysfs    defaults        0 0LABEL=/tmp /tmp ext3     defaults        1 2LABEL=/usr /usr  ext3    defaults        1 2#label=/var / var ext3    defaults        1 2label=/ var /home1/bak/var Ext3    defaults        1 2label=swap-sda3  swap swap    defaults        0 0/ dev/hda /media/cdrom auto    pamconsole,exec,noauto,managed 0 0/dev/ Fd0 /media/floppy auto    pamconsole,exec,noauto,managed 0 0

Modify the Fstab, so that the server can restart normally, and can mount/Var, at this time the original related services restart, restart success,/var becomes readable and writable.

At this point, use Mount to view:

[[email protected] bak]# mount /dev/sda2 on / type ext3  (rw) None  on /proc type proc  (rw) none on /sys type sysfs  (rw) None  on /dev/pts type devpts  (rw,gid=5,mode=620) usbfs on /proc/bus/usb  type usbfs  (rw)/dev/sda1 on /boot type ext3  (rw) NONE&NBSP;ON&NBSP;/DEV/SHM  type tmpfs  (rw)/dev/sda8 on /home type ext3  (rw)/dev/sdb1 on  /home1 type ext3  (rw)/dev/sdc1 on /home2 type ext3  (rw)/dev/sdd1  on /home3 type ext3  (rw)/dev/sda5 on /tmp type ext3  (rw)/ dev/sda6 on /usr type ext3  (rw) none on /proc/sys/fs/binfmt_misc type  binfmt_misc  (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs  (rw)/dev /sde1 on /data2 type ext3  (rw)/home1/bak/var on /home1/bak/varbackup type none  (rw) 

The problematic partition is already blocked, and/Var is already using the new partition.


Mount move parameter: Move a subtree to some.


Starting with the Linux 2.5.1, you can move a subtree to another location in its entirety. The method that is called is

Mount--move Olddir Newdir

This does not affect the system's mount service.




This article is from the "Meditation Trip" blog, please be sure to keep this source http://shen445122.blog.51cto.com/6716303/1717755

/Var becomes a read-only system solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.