Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to manage disk usage in Ubuntu? Post 303023786 by bakunin on Saturday 22nd of September 2018 08:38:08 AM
Old 09-22-2018
Quote:
Originally Posted by baris35
Maybe to define a target directory name and empty it in case df -H is above %95-%98 etc would be good. I do not demand more space, just deletion of consumed part section is okay.
Sorry, but i might be a bit slow: if you have some data which you don't need at all (in this "target directory") and it should be deleted automatically when the "disc" (i suppose what you mean is "filesystem") is 95% or 98% full - why can't that be deleted at first without getting the filesystem that full in first place?

Data is either nececssary or not: if it is, get a bigger disk and/or add a disk, make the filesystem bigger and avoid a full filesystem that way. If it is not necessary and you are prepared to throw it away at certain circumstance you can throw it away in first place, no?

Btw., you should nowadays ALWAYS use LVM (logical volume manager) and at most have the /boot and (if you use UEFI) the UEFI-system-partition as real partitions. Everything else (including the / FS) should come from a logical volume. It is easy to resize that logical volumes and resize the filesystems on them, minimising the administration overhead.

I use Linux on my desktop and my laptop and the following schema has worked best for me:

/dev/sda1 512MB mounted at /boot (for grub, the boot menu and the kernel images)
Everything else in a VG:
- 32GB swap (unecessary but Linux acts funny with suspend-to-RAM or suspend-to-disk when the paging space is smaller than the RAM and this is how much my laptop has installed)
- 20GB mounted at / (for the main OS installation)
- 20GB mounted at /altroot (this is for a secondary OS installation, comes in handy if for some reason the main installation goes to the fritz)
- 10GB mounted at /home (user data, resize according to necessity)
- 50GB mounted at /opt/images (all my virtual machines disk files go there, i use lots of virtual machines for test purposes but most only need barebone OS installations, therefore not much space necessary)

/ and /altroot are mounted vice versa: if i start the OS from what is normally /altroot it will be mounted at / and what is normally / will be mounted at /altroot instead. Everything else is mounted on its normal place. This way i have two separate OS installations and if one breaks i can still boot from the other and repair or even replace it. This has already saved my behind as the update from Xubuntu 17 to 18 left me with an unbootable system for no apparent reason.

I hope this helps.

bakunin
These 3 Users Gave Thanks to bakunin For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Disk Usage

Im using solaris 8 on a Sunfire 280r. Is there a command to show you how much disk space is being used in gigabytes or megabytes. I dont think theres an option for this using the df command. not for solaris anyway. thanks (3 Replies)
Discussion started by: lewisoco
3 Replies

2. UNIX for Dummies Questions & Answers

disk usage

how to i find out the disk usage on a server. say in windows examples its like C:/ D:/ and checking out the disk space. how can i find in Unix. can i just use df -k or should i go to each volume group and find that way. plz respond (2 Replies)
Discussion started by: karthikosu
2 Replies

3. Shell Programming and Scripting

Disk Usage

Hi, I want to retrieve the directory in the shell script that is using maximum space on the disk.I was using du command but it displays all the directories that are using the space on the disk.How can retrieve the only directory which uses the maximum space on the disk?? Thanks in advance. ... (4 Replies)
Discussion started by: harikamamidala
4 Replies

4. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

5. Solaris

current CPU usage, memory usage, disk I/O oid(snmp)

Hi, I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP. I want the oids for above tasks. can you please tell me that Thank you (2 Replies)
Discussion started by: S_venkatesh
2 Replies

6. Ubuntu

XP and Linux (Ubuntu) on same disk, Can I install Ubuntu on not-yet partitioned portion of disk?

My PC (Esprimo, 3 yeas old) has one hard drive having 2 partitions C: (80 GB NTFS, XP) and D: (120 GB NTFS, empty) and and a 200 MB area that yet is not-partitioned. I would like to try Ubuntu and to install Ubuntu on the not-partitioned area . The idea is to have the possibility to run... (7 Replies)
Discussion started by: C.Weidemann
7 Replies

7. UNIX for Dummies Questions & Answers

Disk Usage

Hi, I have always felt problems using commands to check disk usage, or I should say I might not be using the commands properly. dfspace and free are 2 most frequent command that I use, but the data that it echoes is not comprehandable atleast to me.:wall::wall::wall::wall::wall: I want... (4 Replies)
Discussion started by: TH3M0Nk
4 Replies

8. UNIX for Advanced & Expert Users

Ubuntu 14.04 - how to less ram usage

Hello, I have an ubuntu14.04 installed pc with 32GB ram. Operating System: Ubuntu 14.04.5 LTS Kernel: Linux 4.9.148-xxxx-std-ipv6-64 Architecture: x86_64 When I check free memory it shows: total used free shared buffers cached Mem: 31882 ... (2 Replies)
Discussion started by: baris35
2 Replies

9. UNIX for Beginners Questions & Answers

Disk usage monitoring and record the disk used in last 24 hour

HI I am Trying to edit the below code to send email every day with difference of disk utilized in for last 24 hours but instead getting same usage everyday. can you please help me to point out where my calculation is going wrong. Thank you. ================= #!/bin/bash TODAY="at $(date... (0 Replies)
Discussion started by: Mi4304
0 Replies
All times are GMT -4. The time now is 08:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy