Strange hard drive noise when I turn off the computer FreeBSD 13

fufukauliza

New Member

Reaction score: 1
Messages: 17

Hello everybody,
I would like to understand if it is normal or not.
When I turn off the computer I noticed that it doesn't turn off all at once but first it seems that the fan (the main one?) Is disconnected, then the network card (I see it on the monitor: the card is put in the down state) and finally the LED power goes off at the same time as a strange noise which I think is the hard disk.
I obviously worried about the hard disk noise thinking it could be a mechanical problem or that in the future it could become. Mine is a 1TB Seagate mechanical hard drive. With Windows this noise is not heard and even the shutdown is different because it is total and immediate, not step by step as it seems to me to happen with Freebsd.
I'd like to understand it all better and know if I can feel comfortable about my hard drive.

Thank you all.
 

im

Member

Reaction score: 37
Messages: 86

If you want to check HDD health just try to read SMART attributes from your HDD.
For FreeBSD you may install sysutils/smartmontools
Then run the command replacing ada2 by your disk device name.
smartctl -A /dev/ada2
Show the output of the commant.

Look at the column RAW_VALUE for attributes 5,197,196,198. Non-zero values usually predict HDD-failure.
Code:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
p.s
For Windows you may use trial version aida64 to read SMART of HDD.
 

mtu

Member

Reaction score: 44
Messages: 70

I obviously worried about the hard disk noise thinking it could be a mechanical problem or that in the future it could become. Mine is a 1TB Seagate mechanical hard drive. With Windows this noise is not heard and even the shutdown is different because it is total and immediate, not step by step as it seems to me to happen with Freebsd.
I also saw strange behavior upon shutdown with FreeBSD, and it's also something that didn't happen with Windows:


In my case, the solution was to turn off the hw.efi.poweroff kernel value with the command:
sysctl hw.efi.poweroff=0

As far as I understand it, there's two ways of telling the computer to power off: Using ACPI or UEFI functions. In my case, it seems that Windows was using ACPI and everything was fine. FreeBSD apparently tried to use UEFI, and it resulted in strange behavior. The above command tells it not to do that.

To make this change permanent, I added
Code:
hw.efi.poweroff=0
to /etc/sysctl.conf.
 
OP
F

fufukauliza

New Member

Reaction score: 1
Messages: 17

If you want to check HDD health just try to read SMART attributes from your HDD.
For FreeBSD you may install sysutils/smartmontools
Then run the command replacing ada2 by your disk device name.
smartctl -A /dev/ada2
Show the output of the commant.

Look at the column RAW_VALUE for attributes 5,197,196,198. Non-zero values usually predict HDD-failure.
Code:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
p.s
For Windows you may use trial version aida64 to read SMART of HDD.
Hi im,
as regards the control of S.M.A.R.T. I recently did an extended check directly from the BIOS and the disk is ok and in fact with Windows, as I said, this noise is never present neither at start-up, nor during work and especially at shutdown.
 

facedebouc

Member

Reaction score: 7
Messages: 43

As stated upper on thread you can check your hdd with sysutils/smartmontools, but the interesting parameter to look at is #192 Power-Off_Retract_Count which is incremented when hdd is not stopped gracefully by spinning it down.
I usually stop my external USB hdd with camcontrol stop /dev/da? to avoid emergency head retract.
I had this problem with older release of FreeBSD at shutdown where internal hdd where not stopped gracefully.
 

drhowarddrfine

Son of Beastie

Reaction score: 2,027
Messages: 4,024

Quit comparing how Windows works to how a professional operating system like FreeBSD works and your life will be a lot easier.

Note: Yeah, I'm in a bad mood this morning.
 

ralphbsz

Son of Beastie

Reaction score: 2,010
Messages: 2,963

Some disks indeed maker a strange noise when turning off; they use the last bit of energy (from running the spindle motor as a generator) to write whatever is in cache to the platters, and then withdraw the head. I wouldn't worry about it.
 

facedebouc

Member

Reaction score: 7
Messages: 43

If your hdd is an ATA/SATA drive, you can check if it will spin-off at system shutdown with the following command :
sysctl kern.cam.ada.spindown_shutdown.
See ada(4) for more information.
 
OP
F

fufukauliza

New Member

Reaction score: 1
Messages: 17

First of all, thank you all for the insights.
Below are the results after the execution of the command to verify the S.M.A.R.T. and also the result of the command to verify its shutdown when the system is shut down.

Screenshot_20210416_213511.png


I understand that the disk is in excellent condition and that it shuts down properly on shutdown.
I'm wrong?

Thanks again.
 

sidetone

Daemon

Reaction score: 713
Messages: 1,557

My HDD started making noise when it started going bad. Turning my computer on and off made it occur more often, until each one stopped functioning.

I switched both to SDD, one at a later time, and they don't make noise.
 

chrbr

Aspiring Daemon

Reaction score: 343
Messages: 861

I understand that the disk is in excellent condition and that it shuts down properly on shutdown.
I am not sure if the disk is in good conditions. Most lines with "Error Rate" show high numbers. The same applies for the "ECC" recovery. Regarding the format: Next time please copy the text output in a code block instead of posting a picture. A code block is better for readability and one can quote lines. Of course this is only practical if you can post to the forum with the computer where the issue appears.
 

mtu

Member

Reaction score: 44
Messages: 70

I understand that the disk is in excellent condition and that it shuts down properly on shutdown.
I'm wrong?
If you hear something that you didn't hear before, then something is happening that wasn't happening before. Don't take some software information more seriously than your own senses :)

Have you tried sysctl hw.efi.poweroff=0?

I am not sure if the disk is in good conditions. Most lines with "Error Rate" show high numbers. The same applies for the "ECC" recovery.
That's true, but other indicators look good (no reallocated or pending sectors).

There are many guides to interpreting S.M.A.R.T. values, you read read a few until you have a feeling that you understand the situation. This is one starting point, but Googling will give you many more: https://ma.juii.net/blog/interpret-smart-attributes
 
OP
F

fufukauliza

New Member

Reaction score: 1
Messages: 17

If you hear something that you didn't hear before, then something is happening that wasn't happening before. Don't take some software information more seriously than your own senses :)

Have you tried sysctl hw.efi.poweroff=0?


That's true, but other indicators look good (no reallocated or pending sectors).

There are many guides to interpreting S.M.A.R.T. values, you read read a few until you have a feeling that you understand the situation. This is one starting point, but Googling will give you many more: https://ma.juii.net/blog/interpret-smart-attributes

You're right but with Windows and even Linux this strange noise doesn't do it so I think it's because the shutdown in freebsd happens in a different way.
I tried the command you suggested to me but nothing has changed.
I wanted to try installing an older version and using not ZFS but UFS.
Also, first of all this I will launch the extended disk diagnostics from the BIOS.
 
OP
F

fufukauliza

New Member

Reaction score: 1
Messages: 17

I am not sure if the disk is in good conditions. Most lines with "Error Rate" show high numbers. The same applies for the "ECC" recovery. Regarding the format: Next time please copy the text output in a code block instead of posting a picture. A code block is better for readability and one can quote lines. Of course this is only practical if you can post to the forum with the computer where the issue appears.

Apparently from my quick search on the net it seems that those high values are a characteristic of Seagate drives but I could be wrong of course.
I will do further insights.
 
Top