Home » Linux tips » 2 August 2018 » 652 supporters » No Comment »

Silly me

2 August 2018 652 supporters No Comment

 

One of the server have problem with MySQL. The  MySQL table cannot edit at all. Restart the MySQL does not resolve the issue.

It turn out that the problem come from tmp folder.

So stop the MySQL first.

root@svr43 [~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md2 884G 673G 165G 81% /
/dev/md0 190M 82M 99M 46% /boot
tmpfs 7.7G 0 7.7G 0% /dev/shm
/dev/sdc1 459G 396G 41G 91% /backup
/usr/tmpDSK 4.0G 3.8G 0 100% /tmp
root@svr43 [~]# umount -l /tmp
root@svr43 [~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md2 884G 673G 165G 81% /
/dev/md0 190M 82M 99M 46% /boot
tmpfs 7.7G 0 7.7G 0% /dev/shm
/dev/sdc1 459G 396G 41G 91% /backup
root@svr43 [~]# rm -rf /usr/tmpDSK
root@svr43 [~]# rm -rfv /usr/tmp
removed `/usr/tmp’
root@svr43 [~]# /scripts/securetmp
umount: /usr/testDSK: not found
Building /usr/testDSK…10240+0 records in
10240+0 records out
10485760 bytes (10 MB) copied, 0.0191071 seconds, 549 MB/s
mke2fs 1.39 (29-May-2006)
/usr/testDSK is not a block special device.
Proceed anyway? (y,n) Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
2560 inodes, 10240 blocks
512 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=10485760
2 block groups
8192 blocks per group, 8192 fragments per group
1280 inodes per group
Superblock backups stored on blocks:
8193

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
tune2fs 1.39 (29-May-2006)
Creating journal inode: done
This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Done
*** Notice *** No loop module detected
If the loopback block device is built as a module, try running `modprobe loop` as root via ssh and running this script again.
If the loopback block device is built into the kernel itself, you can ignore this message.
Would you like to secure /tmp & /var/tmp at boot time? (y/n) y
Would you like to secure /tmp & /var/tmp now? (y/n) y
Securing /tmp & /var/tmp
Calculating size on /tmp
/tmp calculated to be 4096 M based on available disk space in /usr
No separate partition for tmp!
Building /usr/tmpDSK…4194304+0 records in
4194304+0 records out
4294967296 bytes (4.3 GB) copied, 165.399 seconds, 26.0 MB/s
mke2fs 1.39 (29-May-2006)
/usr/tmpDSK is not a block special device.
Proceed anyway? (y,n) Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
524288 inodes, 1048576 blocks
52428 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1073741824
32 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
tune2fs 1.39 (29-May-2006)
Creating journal inode: done
This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Done
Setting up /tmp… rm: cannot remove directory `/tmp’: Device or resource busy
Done
/var/tmp is already secure
Checking fstab for entries …Added fstab entry (/var/tmp)….Done
Logrotate TMPDIR already configured
Process Complete
root@svr43 [~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md2 884G 677G 161G 81% /
/dev/md0 190M 82M 99M 46% /boot
tmpfs 7.7G 0 7.7G 0% /dev/shm
/dev/sdc1 459G 396G 41G 91% /backup
/usr/tmpDSK 4.0G 137M 3.7G 4% /tmp




Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.