I haven't posted here in a long time, this doesn't mean I've forgotten DesdeLinux Far from it, not at all... it's just that some things have changed on a personal level and my time is now much less than it was before.
However, in this time I have learned some new commands, commands that I want to share with you 🙂
I will start with two that as the title of the post says, they show us data about our hard drives and partitions.
Command Sudo LSSCSI
The first is: Sudo LSSCSI (they need to install this package for the command to be available)
Command sudo lsblk -fm
The second is: sudo lsblk -fm
Here is a screenshot of the output of each one:
There are many other ways to obtain these and other data from our partitions and HDDs, they are not only these two commands ... but, as personally I have seen little mention of them, that is why I decided to share them 🙂
Likewise, I leave other commands that can provide you with a lot of similar data:
Command sudo fdisk -l
Another command is the typical df -h
Command df -h
Here is the screenshot:
Anyway, I hope you find it useful 🙂
Do you know of any other command that provides data that these do not? ...
regards
Thank you very much for the information, greetings.
PS: you were already missed.
XD
hahahahaha thank you 🙂
Yes ... I'm quite offline lately, as Perseus said in a tweet ... "bro, you heard the sirens singing and we have lost you because of them, a minute of silence for the fallen friend TT"
LOL !!!
Ah, so was it the singing of the sirens that kept you busy? 😉
Poor baby .. he doesn't have earplugs hahaha
Well, the reaction is understandable, there are mermaids that anyone falls for, hehe
I already tell you !! 😀
The lsblk command seems very useful, thanks because at least I was certainly unaware of it.
As for other commands, because in Linux, you can always find useful things:
sudo blkid
sudo cat /proc/partitions
sudo cat /etc/mtab
sudo lshw -short -class storage -class disk
sudo lshw -class storage -class disk | less
sudo hwinfo --disk | less
sudo parted /dev/sda print
sudo hdparm -I /dev/sda | less
sudo smartctl -a /dev/sda | less
For LVM-type partitions there are other useful commands:
sudo pvdisplay
sudo lvdisplay
You can also find curious scripts, like this one that uses only standard tools like find and grep:
for file in \
$(find /sys/block/[sh][dr]*/device/ /sys/block/[sh][dr]*/ -maxdepth 1 2>/dev/null |
egrep '(vendor|model|/size|/sys/block/[sh][dr]./$)'| sort)
do
[ -d $file ] && \
echo -e "\n -- DEVICE $(basename $file) --" && \
continue
grep -H . $file | \
sed -e 's|^/sys/block/||;s|/d*e*v*i*c*e*/*\(.*\):| \1 |' | \
awk '{
if($2 == "size") {
printf "%-3s %-6s: %d MB\n", $1,$2,(($3 * 512)/1048576)
} else {
printf "%-3s %-6s: ", $1,$2
for(i=3;i<NF;++i) printf "%s ", $i; print $(NF)
}
}'
done
By the way, df can display a bit more information invoked like this:
df -hT
Yet another command for the collection:
sudo systool -c block -v | less
O_O… damn, thanks for such a lot of commands LOL !!!
Very good lsblk, thanks!
Thanks to you for commenting 🙂
sudo parted -l
Great, I didn't know this one 😀
Thanks
Very good, I only knew "fdisk -l". The one that I liked the most is "lsblk", it is the one that best shows the information.
Thanks for commenting 🙂
I always handled with df -h / and disk -l, the others I ignored.
Weird that nobody knows that about:
# blkid -o list
gives the information well tabulated and of course lsblk that I have made an alias in my .bashrc
$ cat .bashrc | grep -i aliases
alias lsblk = »lsblk -o RM, RO, MODEL, NAME, LABEL, FSTYPE, MOUNTPOINT, SIZE, PHY-SEC, LOG-SEC, MODE, OWNER, GROUP, UUID
Thanks for such contributions.
Thanks for the commands, every day of at least 20 minutes of reading, is a day spent
Thanks to you for commenting 😀
Very good, it would also be good if you recommend that for more details look at the man page of each command, greetings.
To know the temperature ...
root @ darkstar: / home / salvic # smartctl -A / dev / sdc | grep '194' | awk '{print $ 10}'
34
great "lsblk", did not know! Very useful since whenever I want to access that information I end up using fdik -l which is more cumbersome, and for the UUID I do a "ls -lha / dev / disk / by-UUID" and I start to identify myself. With «lsblk» everything is united and clean in a single command and taking up little space in the terminal 🙂 Thanks for the contribution
Awesome
tremendous!
useful and simple thanks
Thank you very useful post 🙂
Blessings.
Excellent contribution. It really served me well. the shared article.
Thank you very much, the commands helped me.
Thank you very much for sharing this information.
It came to me great.
Hello everyone, I would like to know if there is any command to identify the partitions of form (0,2), (4,3), etc.
I have a little problem starting Remix OS from a sde6 hard drive partition, which I understand to be (4,6), but the boot always fails me saying that it is not correct.
Thanks and regards.
Hello everyone, I wanted to ask you the following, I have a computer where I have a virtualized linux and one of the disks that it has mounted I had to externder the available space, that is ok but I have to extend the partition because from linux you can still see the previous space I had and not the new one, so I understand that you have to extend the partition so that it is reflected later when you mount it again in Linux. The point is that there I have backups and I should not lose the info there. Could you help me by telling me which is the correct command to expand the partition since it went from having 128 GB to 1 TB, and once this is done, mount it on linux. The type of partition appears to me to be ext3, I await your comments, Thanks in advance.
A collaboration between Linux users is always appreciated.
As my father used to say, if it's good and concise, it's doubly good.