bash blkid command, parsing values

I’m been using ‘blkid -o list’. However this causing me problems parsing spaces in file names. ‘blkid’ is missing the mount point. I’m struggling to find a way to get three values. http://linux.die.net/man/8/blkid I need to know device id, type, partition label, and if the device is mounted. Then divide into linux and mswin partitions by bash script or command. MSWIN: FAT32, NTFS, etc. Playing with command values, I found ‘label=’ and ‘partlabel=’. It’s very confusing. I need help getting the output format right.

blkid does not know aything about mounted status. Use lsblk instead.

‘blkid -o list’ When a device isn’t mounted, it shows the line ‘(not mounted)’. I used it to mount drives if I not mounted. It worked very well. However, spaces in filenames cause a bug.

Thanks for the info. I’ll use that command for parse and post again.

Indeed. Never used it before and documentation is cursory. Thanks!

If you trying to parse drive info using either lsblk or blkid, I’v figured out how to do it without spaces in filenames being a problem. It involves using some complex string manipulation and use of pipes. Take a look at the future scanvirus beta3 release. Don’t forget to give me credit if you use the code. :wink: