Page 1 of 1

How to get space used and unused for all partitions?

Posted: Tue Dec 29, 2020 5:08 pm
by arivas_2005

Greetings

I can't find a command (or a mini-script) to list the used and unused space of all partitions, mounted or not. (as gparted ... show the used or unused space for each partition in disk)
something like it is not shown space used, not used, only total.
the commands I have checked are: lsblk, fdisk, parted, disktype; but they don't show used spaces. And df and du need to mount the partition first.

Thanks!


Re: get space used and unused for all partitions (and all disks in pc)

Posted: Tue Dec 29, 2020 5:27 pm
by puppy_apprentice

There is tool in tray for this.


Re: get space used and unused for all partitions (and all disks in pc)

Posted: Tue Dec 29, 2020 5:31 pm
by cobaka

@arivas_2005

'df' will get you some of the way there - but will not list info about unmounted drives.

On my terminal I can type: df >> /mnt/home/zTmp/p_space.txt
zTmp is a folder in my home directory (and that is also /mnt/sda3/)
The command created a text file: p_space.txt
When I open p_space.txt with Geany I see:

Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 4526108 260736 4265372 6% /initrd/mnt/tmpfs
unionfs 210616688 25252304 174612384 13% /
/dev/loop0 195584 195584 0 100% /initrd/pup_ro2
/dev/loop1 19968 19968 0 100% /initrd/pup_f
/dev/loop2 24064 24064 0 100% /initrd/pup_z
/dev/loop3 21504 21504 0 100% /initrd/pup_a
/dev/sda3 210616688 25252304 174612384 13% /initrd/mnt/dev_save
tmpfs 5220 4708 512 91% /initrd/files
devtmpfs 4133300 0 4133300 0% /dev
shmfs 1989044 0 1989044 0% /dev/shm
/dev/loop4 284672 284672 0 100% /initrd/pup_ro3
/dev/sda2 165258464 886440 155924024 1% /mnt/sda2
/dev/sda4 581150864 17418524 534158300 4% /mnt/sda4

Helps to use a mono-spaced font, but you can see the result.

or just type du <enter> from the terminal prompt.
Remember ctrl+l will clear the screen.
'up-arrow' will restore the last command you entered. You can edit the command line (using the arrow keys) and then tap <enter>

another command to try: df

Good luck
cobaka

Puppy Linux: A thinking man's best friend ....
Puppy Linux: Trust-worthy, reliable, friendly ...


Re: get space used and unused for all partitions (and all disks in pc)

Posted: Tue Dec 29, 2020 5:53 pm
by arivas_2005

Thanks for the prompt response.

just comment that I'm looking for something to see used and unused space of all partitions at once .. without mounting.
for example ... a disk with 7 partitions ... see at once the sizes, and used and free spaces of each one without having to mount them first.

A summary like the one shown by gparted (size: used, not used, total) but in the console ... only as information.


Re: get space used and unused for all partitions (and all disks in pc)

Posted: Tue Dec 29, 2020 6:13 pm
by puppy_apprentice

Try Partview

BTW: there is a problem with this tool. SR0 is a internal read-only flash memory of Huawei USB modem and is only 11MB. Or maybe it has only 11MB partition?


Re: get space used and unused for all partitions (and all disks in pc)

Posted: Tue Dec 29, 2020 7:29 pm
by arivas_2005

Thanks puppy_apprentice

a question.
Partview mount partition before using df?
(and obviously then disassembles it I guess!)

Thank you again


Re: get space used and unused for all partitions (and all disks in pc)

Posted: Tue Dec 29, 2020 8:31 pm
by Keef

Image


Re: How to get space used and unused for all partitions?

Posted: Tue Dec 29, 2020 11:50 pm
by Flash

I think sr0 is probably an optical disk drive. Anyway, that's what it has always been for all Puppys in my system. If there is no disk in the drive with a recognizeable filesystem, Puppy won't see anything there.


Re: How to get space used and unused for all partitions?

Posted: Wed Dec 30, 2020 12:09 am
by puppy_apprentice

SR0 has CD icon (in Windows too) but it is a read-only flash memory (seeing by system like finished CD). But Puppy Slacko Partview app shows wrong capacity. I will check this in Bionic 8.0.


Re: get space used and unused for all partitions (and all disks in pc)

Posted: Wed Dec 30, 2020 2:46 am
by BarryK
Keef wrote: Tue Dec 29, 2020 8:31 pm

Image

@Keef
Is that Partview in EasyOS or EasyPup?

Partview in Easy shows all partitions, mounted or unmounted, however, there are some Partview variants that only show mounted partitions -- I seem to recall that anyway.


Re: How to get space used and unused for all partitions?

Posted: Wed Dec 30, 2020 9:53 am
by puppy_apprentice

Some tests for Bionic 7.9.8 (64bit) part1


Re: How to get space used and unused for all partitions?

Posted: Wed Dec 30, 2020 9:54 am
by puppy_apprentice

Some tests for Bionic 7.9.8 (64bit) part2


Re: How to get space used and unused for all partitions?

Posted: Wed Dec 30, 2020 9:55 am
by puppy_apprentice

Some tests for Slacko 6.3.2 (64bit)

Edit: Those all tools and icon tool-tips should show the same info for proper drives.


Re: How to get space used and unused for all partitions?

Posted: Wed Dec 30, 2020 12:13 pm
by Keef

@BarryK
It is in EasyOS.


Re: How to get space used and unused for all partitions?

Posted: Wed Dec 30, 2020 10:54 pm
by ETP

Here Partview colours have been modified for use with a dark theme.