Score:0

lsblk --fs to get information about usb stick

gt flag

I am using Ubuntu 20.04. I want to get some informations about my USB stick

When I type lsblk --fs I get informations about my USB stick. I can see the partitions labels, fstype.

But I can't see the available disk space (fsavail) of not used partitions also not the mountpoint.

How can I get those informations even when they are not in use?

Rishon JR avatar
pl flag
What do you exactly mean by "when they are not in use"? Do you mean when it's not mounted or mounted but connected to the computer but it is idle?
Score:1
jp flag

You can run lsblk --help to see what options there are.

The following command line works well in a wide terminal window (wide enough to let all columns be written correctly)

lsblk -fm

The following command line might do what you ask for in the question

lsblk -e7 -o name,size,fsavail

Comments:

-e7  # stops printing details about loop mounts
-o   # lets you list exactly which optional columns you want

Add the options you want, for example fstype,label,mountpoint,model

lsblk -e7 -o name,size,fsavail,fstype,label,mountpoint,model

and you can make an alias to make it convenient to run the command line that you prefer.


Please notice that there are different options in different versions of lsblk (and different versions of Ubuntu). The options listed in this answer work in a current up to date version of Ubuntu 20.04.x LTS.

Artur Meinild avatar
vn flag
This answer deserves more upvotes!
Score:1
vn flag

Run lsblk without parameters. This will show partition sizes and mountpoints.

Example: (sda is a USB stick with 8 partitions, where only 1 is formatted)

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    1 119.3G  0 disk 
├─sda1        8:1    1  14.9G  0 part /mnt/docker-data
├─sda2        8:2    1  14.9G  0 part 
├─sda3        8:3    1  14.9G  0 part 
├─sda4        8:4    1  14.9G  0 part 
├─sda5        8:5    1  14.9G  0 part 
├─sda6        8:6    1  14.9G  0 part 
├─sda7        8:7    1  14.9G  0 part 
└─sda8        8:8    1  14.9G  0 part 
mmcblk0     179:0    0  28.9G  0 disk 
├─mmcblk0p1 179:1    0   256M  0 part /boot/firmware
└─mmcblk0p2 179:2    0  28.6G  0 part /

Running the command with --fs flag only outputs info about filesystems, like this:

$ lsblk --fs
NAME        FSTYPE   FSVER LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                        
├─sda1      ext4     1.0   docker-data 8834d40e-65a7-4391-92c5-608f82d9911c   13.9G     0% /mnt/docker-data
├─sda2                                                                                     
├─sda3                                                                                     
├─sda4                                                                                     
├─sda5                                                                                     
├─sda6                                                                                     
├─sda7                                                                                     
└─sda8                                                                                     
mmcblk0                                                                                    
├─mmcblk0p1 vfat     FAT32 system-boot B726-57E2                             134.7M    47% /boot/firmware
└─mmcblk0p2 ext4     1.0   writable    483efb12-d682-4daf-9b34-6e2f774b56f7   20.6G    23% /
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.