du and df reporting incorrect details

ARUN Posted in DISK RELATED
0

Solution here :

http://admin.webhostingdevelopment.com/viewtopic.php?f=79&t=65

/ getting filled up

ARUN Posted in DISK RELATED
0

du -sch /root/.cpanel/comet/channels

Remove files like  “%2fpurge_mail_queue%2fCypl11rGti4q1i6t”

Clear all the emails from mail queue

You can login to WHM >> Mail Queue to do this

or

”  exim -bp | awk ‘/^ *[0-9]+[mhd]/{print “exim -Mrm ” $3}’ | bash   ”

 

 

-bash: smartctl: command not found

ARUN Posted in DISK RELATED
0

yum install smartmontools

SATA harddisk speed

ARUN Posted in DISK RELATED
0

hdparm -I /dev/sda | grep -i speed

dd command to get speed of disk

ARUN Posted in DISK RELATED
0
dd if=/dev/zero of=/tmp/output.img bs=8k count=256k
rm /tmp/output.img

smartctl

ARUN Posted in DISK RELATED
0

smartctl -q errorsonly -H -l selftest -l error /dev/sda

smartctl -t long /dev/sdb

Check the status :          smartctl -l selftest /dev/sdb

How to check harddisk using hdparm

ARUN Posted in DISK RELATED
0

A bad harddisk details :

[email protected][~]# hdparm -tT /dev/sda1

/dev/sda1:
Timing cached reads: 25788 MB in 1.99 seconds = 12944.89 MB/sec
Timing buffered disk reads: 18 MB in 3.28 seconds = 5.49 MB/sec

Field above in red is important… For SATA acceptable range is 80+ for Timing buffered disk reads

 

Clear /tmp when a particular user is occupying files

ARUN Posted in DISK RELATED, LINUX COMMANDS
0

When /tmp is full and we cant find a specific pattern to delete the files and when a specific user with username “USERNAME” is occupying the most disk space

find /tmp -user USERNAME  -exec rm -rf {} \;

OR

for i in `find /tmp -user USERNAME`; do rm -f $i;done

OR

find /tmp/ -type f -user USERNAME | xargs rm -f

How to clone a harddisk

ARUN Posted in DISK RELATED
0

dd_rescue /dev/mapper/SysVolGroup-LogVolRoot /root/diskimage.img

How to increase the swap space in linux server

ARUN Posted in DISK RELATED
0

To view the current swap partition and the swap usage :

swapon -s

dd if=/dev/zero of=/newswap bs=1M count=512

mkswap /newswap
swapon /newswap
swapon -s

Plesk shows incorrect disk quota

ARUN Posted in DISK RELATED, PLESK BACKEND, PLESK FRONTEND
0

Plesk shows incorrect disk space usage while accessed through control panel

/usr/local/psa/admin/sbin/statistics –calculate-one –domain-name=<domain_name>

Disk space errors in VPS

ARUN Posted in DISK RELATED, VPS
0

==================================

Drive Critical: /dev/vzfs (/) is 97% full

Drive Critical: /dev/simfs (/tmp) is 97% full

==================================

Solution :

Check the disk space usage of node server and if its above 95% this can happen. So move some VEs to another server and see.

Format and mount a drive

ARUN Posted in DISK RELATED
0

[[email protected] ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5             448G  103G  322G  25% /
/dev/sda3             2.0G   36M  1.9G   2% /tmp
/dev/sda1              99M   18M   77M  19% /boot
tmpfs                 3.9G     0  3.9G   0% /dev/shm
tmpfs                 3.9G     0  3.9G   0% /usr/local/psa/handlers/before-local
tmpfs                 3.9G     0  3.9G   0% /usr/local/psa/handlers/before-queue
tmpfs                 3.9G     0  3.9G   0% /usr/local/psa/handlers/before-remote
tmpfs                 3.9G     0  3.9G   0% /usr/local/psa/handlers/info
tmpfs                 3.9G     0  3.9G   0% /usr/local/psa/handlers/spool
[[email protected] ~]#

[[email protected] ~]# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14         274     2096482+  82  Linux swap / Solaris
/dev/sda3             275         535     2096482+  83  Linux
/dev/sda4             536       60801   484086645    5  Extended
/dev/sda5             536       60801   484086613+  83  Linux

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn’t contain a valid partition table

[[email protected] ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.

The number of cylinders for this disk is set to 60801.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0×0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-60801, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-60801, default 60801):
Using default value 60801
Command (m for help): p

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       60801   488384001   83  Linux
Command (m for help): m
Command action
a   toggle a bootable flag
b   edit bsd disklabel
c   toggle the dos compatibility flag
d   delete a partition
l   list known partition types
m   print this menu
n   add a new partition
o   create a new empty DOS partition table
p   print the partition table
q   quit without saving changes
s   create a new empty Sun disklabel
t   change a partition’s system id
u   change display/entry units
v   verify the partition table
w   write table to disk and exit
x   extra functionality (experts only)
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): L

0  Empty           1e  Hidden W95 FAT1 80  Old Minix       bf  Solaris
1  FAT12           24  NEC DOS         81  Minix / old Lin c1  DRDOS/sec (FAT-
2  XENIX root      39  Plan 9          82  Linux swap / So c4  DRDOS/sec (FAT-
3  XENIX usr       3c  PartitionMagic  83  Linux           c6  DRDOS/sec (FAT-
4  FAT16 <32M      40  Venix 80286     84  OS/2 hidden C:  c7  Syrinx
5  Extended        41  PPC PReP Boot   85  Linux extended  da  Non-FS data
6  FAT16           42  SFS             86  NTFS volume set db  CP/M / CTOS / .
7  HPFS/NTFS       4d  QNX4.x          87  NTFS volume set de  Dell Utility
8  AIX             4e  QNX4.x 2nd part 88  Linux plaintext df  BootIt
9  AIX bootable    4f  QNX4.x 3rd part 8e  Linux LVM       e1  DOS access
a  OS/2 Boot Manag 50  OnTrack DM      93  Amoeba          e3  DOS R/O
b  W95 FAT32       51  OnTrack DM6 Aux 94  Amoeba BBT      e4  SpeedStor
c  W95 FAT32 (LBA) 52  CP/M            9f  BSD/OS          eb  BeOS fs
e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi ee  EFI GPT
f  W95 Ext’d (LBA) 54  OnTrackDM6      a5  FreeBSD         ef  EFI (FAT-12/16/
10  OPUS            55  EZ-Drive        a6  OpenBSD         f0  Linux/PA-RISC b
11  Hidden FAT12    56  Golden Bow      a7  NeXTSTEP        f1  SpeedStor
12  Compaq diagnost 5c  Priam Edisk     a8  Darwin UFS      f4  SpeedStor
14  Hidden FAT16 <3 61  SpeedStor       a9  NetBSD          f2  DOS secondary
16  Hidden FAT16    63  GNU HURD or Sys ab  Darwin boot     fb  VMware VMFS
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fe  LANstep
1c  Hidden W95 FAT3 75  PC/IX           be  Solaris boot    ff  BBT
Hex code (type L to list codes): 83
Command (m for help): wq
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

[[email protected] ~]# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14         274     2096482+  82  Linux swap / Solaris
/dev/sda3             275         535     2096482+  83  Linux
/dev/sda4             536       60801   484086645    5  Extended
/dev/sda5             536       60801   484086613+  83  Linux

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       60801   488384001   83  Linux
[[email protected] ~]# partprobe
[[email protected] ~]# mkfs.ext3 /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
61063168 inodes, 122096000 blocks
6104800 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
3727 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, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[[email protected] ~]# mkdir /disk1
[[email protected] ~]# vi /etc/fstab

/dev/sdb1               /disk1                  ext3    defaults        0 0
[[email protected] ~]# mount
/dev/sda5 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda3 on /tmp type ext3 (rw)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
tmpfs on /usr/local/psa/handlers/before-local type tmpfs (rw)
tmpfs on /usr/local/psa/handlers/before-queue type tmpfs (rw)
tmpfs on /usr/local/psa/handlers/before-remote type tmpfs (rw)
tmpfs on /usr/local/psa/handlers/info type tmpfs (rw)
tmpfs on /usr/local/psa/handlers/spool type tmpfs (rw,mode=0770,uid=2021,gid=31)
[[email protected] ~]# mount -a
[[email protected] ~]# mount
/dev/sda5 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda3 on /tmp type ext3 (rw)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
tmpfs on /usr/local/psa/handlers/before-local type tmpfs (rw)
tmpfs on /usr/local/psa/handlers/before-queue type tmpfs (rw)
tmpfs on /usr/local/psa/handlers/before-remote type tmpfs (rw)
tmpfs on /usr/local/psa/handlers/info type tmpfs (rw)
tmpfs on /usr/local/psa/handlers/spool type tmpfs (rw,mode=0770,uid=2021,gid=31)
/dev/sdb1 on /disk1 type ext3 (rw)
[[email protected] ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5             448G  103G  322G  25% /
/dev/sda3             2.0G   36M  1.9G   2% /tmp
/dev/sda1              99M   18M   77M  19% /boot
tmpfs                 3.9G     0  3.9G   0% /dev/shm
tmpfs                 3.9G     0  3.9G   0% /usr/local/psa/handlers/before-local
tmpfs                 3.9G     0  3.9G   0% /usr/local/psa/handlers/before-queue
tmpfs                 3.9G     0  3.9G   0% /usr/local/psa/handlers/before-remote
tmpfs                 3.9G     0  3.9G   0% /usr/local/psa/handlers/info
tmpfs                 3.9G     0  3.9G   0% /usr/local/psa/handlers/spool
/dev/sdb1             459G  199M  435G   1% /disk1
[[email protected] ~]#

Increase or decrease inode on a VPS from node

ARUN Posted in DISK RELATED, VPS
0

[   vzctl set VEID --diskinodes 2000000:2000200 --save     ]    –> To set the inode on a VPS.

vzctl exec VEID df -i         —> To view the inode

To view all the disks connected and its size

ARUN Posted in DISK RELATED
0

fdisk -l | grep Disk

Eg :

[email protected] [/root]# fdisk -l | grep Disk
Disk /dev/sda: 180.0 GB, 147086327808 bytes
Disk /dev/sdb: 250.0 GB, 250059350016 bytes
Disk /dev/sdc: 250.0 GB, 250059350016 bytes
[email protected] [/root]#