Labels

hpunix (63) marathi kavita (52) linux (21) solaris11 (11) AWS (5) numerology (5)
Showing posts with label filesystem. Show all posts
Showing posts with label filesystem. Show all posts

Wednesday, December 16, 2020

Can I delete files in /var/log/journal ?

Can I delete files in /var/log/journal ?


/var/log/journal/ are kept the log files created by the journal service (systemd). Yes, the files from /var/log/journal directory can be removed.


1. If /var/log/journal log file using more space like 3.5G etc.. 

We can verify it by running below command:

# journalctl --disk-usage


2. Note down the SystemMaxUse value, it could be hashed or having value like 3.5G

#cat /etc/systemd/journald.conf |grep -i SystemMaxUse


3. Before editing journald.conf file; take copy of it

#cp -rp /etc/systemd/journald.conf /etc/systemd/journald.conf_backup


4. Edit the file journald.conf using vi editor and change the value SystemMaxUse to 200 or 300MB

#cat /etc/systemd/journald.conf |grep -i SystemMaxUse

SystemMaxUse=300M


5. Restart the systemd-journald service to make the changes effective done in /etc/systemd/journald.conf

#systemctl restart systemd-journald


Or


If you do not want to restart the systemd-journald service then use below command :

#journalctl –vacuum-size=300M 



Thanks,

Kiraan B Jadhav

Monday, October 26, 2020

/boot housekeeping + linux

/boot is almost full + linux


It is recommended to have at least 1GB of space for /boot.  


The safest way of cleaning up /boot is :


Do the following to keep just the last 2 kernels on your system, to keep /boot clean.

1 - Edit /etc/yum.conf and set the following parameter

# vi /etc/yum.conf

installonly_limit=2

This will make your package manager keep just the 2 last kernels on your system(including the one that is running)

 

2 - Install yum-utils utility so the package-cleanup command will work:

# yum install yum-utils

 

3 - Make an oldkernel cleanup:

# package-cleanup --oldkernels --count=2

4. This will clear lots of space. If not, then we can note down the current kernel version and can move the other kernels files to another directory.

To know current version of kernel:

# uname -r

Or

# rpm -qa kernel

Move other kernel files to another directory

# mv /boot/<file name> /root/oldkernels

 

Regards,

Kirraan Jadhav


Tuesday, February 13, 2018

How to increase FS which is in LVM in AWS

How to extend EBS volume which is part of LVM:
And
How to increase FS which is in LVM in AWS :

As our day to day task, we may get request to increase filesystem size by some GB value. Suppose that filesystem is part of LVM and the instance is hosted on AWS then below steps you can follow.

1. Fist you have to identify the volume for server
2. Identify the volume from AWS and increase size
3. Make new size visible on server/instance.
4. Extend the mountpoint and hence filesystem to desired value.

Note: Here we are not adding new volume we are using existing volume only. The steps for new volume are different and quite simple too.

In this example, we are going to extend the existing volume /dev/xvdm (current size: 700GB) by 300GB which is part of LVM or belongs to volume group “VolGroup02”. Mount point name is /application.

From AWS End:
  1. Login to AWS console and search our instance with instance ID or instance name.
  2. Check devices attached to respective instance. Check for /dev/sdm (On server, we will see it as /dev/xvdm) volume which we are going to increase by 300GB
  3. Click on volume /dev/sdm and choose modify volume option and increase it by 300GB. New size will be 1000GB.
After modifying the volume from AWS end we have to check on server whether it is modified or not.

From Server End:

1. Check size of our volume on server.
    #pvs |grep -i xvdm


It will not show the new size.


2. Resize the PV so the total size of the volume will be visible
#pvresize /dev/xvdm


 3. Recheck the size of volume; it will show new value now. 




Now we want to extend the mountpoint /application

4. Extend the logical volume by lvextend
    
+100%FREE - It will use 100%  of the free space to extend the volume.



5. Resize the filesystem.

6. Check new size of filesystem.

[root@mycloud ~]# df -h /applicaiton


Regards,
Kiran Jadhaw