Linux info about disks

Is there a command to view hard drive specs

I noticed that my Ubuntu is lagging EXTREMELY badly but only the first time I do things after what I did gets loaded into RAM the lag stops totally. I ran some tests and I guess one of my laptop hard drives is borked. Im assuming that I have to replace the drive, is there some command I can issue to see the exact specs on the drive so I can then buy it online? I don’t want to have to open up the laptop, find the specs. Then open it again when the new drive arrives.

Or is there another cool hacky command or way to partition my drive to avoid using the bad spots? A while ago when my drive failed I mounted it useing an alternative superblock and this worked and still does i guess..

I found the hacky solution I wanted. I ran the command «badblocks /dev/sda1» and then noticed they were all near the front of the drive. So I created an unallocated partition at the front of the drive consisting of 50% of the total size. I then tested the second half of the drive! AND WALAAAAAAAA. IT WORKED. Im going to buy a new drive anyway but this process taught me alot 🙂

5 Answers 5

smartctl command from smartmontools package is what you want for that

% sudo smartctl -i /dev/sda smartctl 6.2 2013-07-26 r3841 [i686-linux-3.13.0-24-generic] (local build) Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Family: SAMSUNG SpinPoint M7 Device Model: SAMSUNG HM250HI Serial Number: LU WWN Device Id: 5 0024e9 203520f1d Firmware Version: 2AC101C4 User Capacity: 250,059,350,016 bytes [250 GB] Sector Size: 512 bytes logical/physical Device is: In smartctl database [for details use: -P show] ATA Version is: ATA8-ACS T13/1699-D revision 6 SATA Version is: SATA 2.6, 3.0 Gb/s Local Time is: Thu May 15 21:49:09 2014 MYT SMART support is: Available - device has SMART capability. SMART support is: Enabled 
lshw -class disk -class storage 

Thanks I hope this helps someone but the first answer was PERFECT so im not even bothering with this, do you know if I can somehow use only part of my hard drive? The hole thing still works but super slow. I know nothing of hardware but maybe there is a way to say only use the good part of the hard drive? Maybe when hard drives go bad only certain portions go bad?

% sudo hdparm -I /dev/sda ~ /dev/sda: ATA device, with non-removable media Model Number: WDC WD10JPCX-24UE4T0 Serial Number: WD-WXR1E24A7U0E Firmware Revision: 01.01A01 Transport: Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0 Standards: Supported: 9 8 7 6 5 Likely used: 9 Configuration: Logical max current cylinders 16383 16383 heads 16 16 sectors/track 63 63 -- CHS current addressable sectors: 16514064 LBA user addressable sectors: 268435455 LBA48 user addressable sectors: 1953525168 Logical Sector size: 512 bytes Physical Sector size: 4096 bytes Logical Sector-0 offset: 0 bytes device size with M = 1024*1024: 953869 MBytes device size with M = 1000*1000: 1000204 MBytes (1000 GB) cache/buffer size = 16384 KBytes Nominal Media Rotation Rate: 5400 

You can use lsblk, it has a ton of options that you can use e.g.:

Читайте также:  Утилита nikto kali linux

which gives this result in my case

MODEL SIZE NAME Samsung SSD 850 232.9G sda Samsung SSD 850 931.5G sdb 

Источник

4 Ways to View Disks and Partitions in Linux

In this guide, we will show how to list storage disks and partitions in Linux systems. We will cover both command-line tools and GUI utilities. By the end of this guide, you will learn how to view or report information about disks and partitions on your Linux server or desktop computer, or workstation.

1. List Linux Disks Using fdisk Command

fdisk is a widely-used command-line tool for manipulating disk partition tables. You can use it to view disks and partitions on your Linux server as follows.

The -l flag implies list partitions, if no device is specified, fdisk will display partitions from all disks. It requires root privileges for you to invoke it, so use the sudo command where necessary:

Check Linux Disk Partitions

2. View Linux Disk Partitions Using lsblk Command

lsblk is a utility for listing block devices. You can use it to view disks and partitions on your Linux computer as follows. It runs well without the sudo command:

View Linux Disk Partitions

To view extra information about disks, use the -f command line option as shown:

View Linux Partitions Info

3. View Linux Disks Using hwinfo Command

hwinfo is another useful utility for viewing information about your hardware, particularly storage disks. If you can not find the hwinfo command on your system, run the following command to install it:

$ sudo apt install hwinfo [On Debian, Ubuntu and Mint] $ sudo yum install hwinfo [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux] $ sudo emerge -a sys-apps/hwinfo [On Gentoo Linux] $ sudo pacman -S hwinfo [On Arch Linux] $ sudo zypper install hwinfo [On OpenSUSE]

Once you have the hwinfo package installed, run the command with the —disk command line option as shown:

Читайте также:  Сеть windows linux samba

View Linux Disk Information

From the output of the previous command, there is a lot of information about a disk or its partitions that hwinfo displays. If you wish to view an overview of block devices, run this command:

View Linux Disks Overview

To show a summary of all disks, run the command:

List Summary of Linux Disks

4. Find Linux Partitions Information Using Disk Tool

On a Linux desktop computer, you can also use a graphical user interface (GUI) application to view a list of disks attached to your computer. First, search for disks application in the system menu. Then open it to view your disks and their partitions.

Find Linux Disk Partitions Info

That’s all for now. For more information about the commands used in this guide, check out their man pages. You can also share your thoughts with us via the comment form below.

Источник

Смотрим список дисков Linux

Linux отображает подключённые жёсткие диски иначе, чем Windows. В операционной системе от Microsoft мы привыкли к тому, что у нас есть диск C, D, E, и нам не нужно задумываться о реальных именах разделов и жёстких дисков. Все диски размещены в проводнике и очень просто доступны.

В Linux такой возможности нет, как и нет такой абстракции. Диски и разделы именуются как есть, и вы будете иметь дело именно с этими именами. В этой статье мы разберём, как посмотреть список дисков Linux.

Как посмотреть список дисков в Linux

В Linux все отображается в файловом виде, в том числе и устройства. Все подключённые к операционной системе Linux устройства размещаются в каталоге /dev/ здесь вы найдете микрофоны, камеры, жёсткие диски, флешки, одним словом, все внешние и внутренние устройства.

Жёсткие диски имеют особенные названия. В зависимости от интерфейса, через который подключён жёсткий диск, название может начинаться на:

  • sd — устройство, подключённое по SCSI;
  • hd — устройство ATA;
  • vd — виртуальное устройство;
  • mmcblk — обозначаются флешки, подключённые через картридер;

В наше время большинство блочных устройств Linux подключаются через интерфейс SCSI. Сюда входят жёсткие диски, USB-флешки, даже ATA-диски теперь тоже подключаются к SCSI через специальный переходник. Поэтому в большинстве случаев вы будете иметь дело именно с дисками sd.

Читайте также:  Windows mac os linux различия

Третья буква в имени диска означает его порядковый номер в системе. Используется алфавитная система. Например sda — первый диск, sdb — второй диск, sdc — третий и так далее. Дальше следует цифра — это номер раздела на диске — sda1, sda2.

Самый простой способ увидеть все подключённые диски — это посмотреть содержимое каталога /dev/ и отфильтровать устройства sd:

Как видите, в моей системе сейчас есть только один диск и два раздела. Дальше мы можем посмотреть, куда примонтирован каждый из разделов:

Здесь, кроме дисков, будут отображаться различные специальные файловые системы: procfs, sysfs, tmpfs, cgroup и так далее. Однако все эти команды не помогут нам получить доступ к информации о дисках. Поэтому нам понадобится кое-что другое. Посмотреть подключённые диски с выводом информации о размере и свободном пространстве можно с помощью утилиты df:

Здесь отображается уже подробная информация. Но вы можете узнать ещё больше с помощью команды lsblk:

В этом случае список примонтированных дисков Linux включает ещё и информацию о точке монтирования, типе раздела (диск, раздел, привод) и его мажорном и минорном номере, по которым можно понять, что это за устройство. Если вам нужна информация о размере, то лучше использовать fdisk:

Это все утилиты, которыми вы можете воспользоваться, чтобы просмотреть список дисков Linux. Но есть ещё и графические утилиты.

Посмотреть список дисков в GUI

Во-первых, если к компьютеру подключено несколько дисков, то вы сможете их увидеть на левой панели файлового менеджера Nautilus или Dolphin. Там будет отображаться список подключенных устройств Linux, их метки и размер:

В Gnome есть программа Disks, которая позволяет настраивать поведение дисков, она же может отображать список подключенных устройств к системе. Вы можете найти её в главном меню:

Утилита отображает всю доступную информацию о дисках и разделах на них, вы можете даже посмотреть информацию о состоянии smart. Список дисков находится на панели слева, а справа разделы на этом диске:

Ещё одна утилита, которую вы можете использовать, чтобы посмотреть список жёстких дисков Linux — это Gparted. Это редактор разделов для Linux, но вы можете посмотреть подключнёные диски и структуру каждого из них. Раскрывающийся список вы найдёте в верхнем правом углу:

А в основной части окна программы отображается список разделов.

Выводы

В этой статье мы разобрали несколько способов посмотреть список примонтированных дисков Linux. Каждый из них может понадобиться в различных ситуациях. Если у вас остались вопросы, спрашивайте в комментариях!

Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.

Источник

Оцените статью
Adblock
detector