dam034
January 25, 2026, 1:47pm
1
Dear users,
I have a pc with ubuntu server 22.04 installed, and I use it as lamp and nas server.
Since yesterday, the filesystem seems in read-only mode and I can’t do writing operation in the files. I open ssh client to connect to the server, and if I tried to do any writing operation on the disk, it gave me an error: file system in read-only mode.
So I have reboot the server and then lamp and samba services were down.
Then I connected a monitor to the server and used the console. I browsed through the server folders with “cd” command and I was able to verify that no files were lost.
So doing another reboot, the lamp and nas services were on again, but when I did writing operation, in the monitor (of the server) I could see these messages:
So I want to know if I have to replace the hard disk, because it can be corrupted or near to the end of its life.
What you advice to do?
Thanks
Hi,
could be a controller problem, loose cable or more likely your disk.
You can check whether the cable is loose but if you have not moved a bad drive is more likely.
For checking the health of your drive you will need smartctl
sudo smartctl -a /dev/sda
and check the output for errors. I would simply backup all your files and replace the drive.
1 Like
dam034
January 26, 2026, 3:12pm
3
Hi,
thanks for your reply.
The server is a Nipogi minipc with the ssd provided by the vendor, and after I added a 1tb hdd.
The hdd is giving me problems.
So I executed the command:
root@nipogi:~#smartctl -a /dev/sda
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.15.0-127-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Seagate Barracuda 2.5 5400
Device Model: ST1000LM048-2E7172
Serial Number: C120DTP1
LU WWN Device Id: 5 000c50 0f6719887
Firmware Version: 0001
User Capacity: 1.000.204.886.016 bytes [1,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Form Factor: 2.5 inches
TRIM Command: Available
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-3 T13/2161-D revision 3b
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Mon Jan 26 16:04:16 2026 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
See vendor-specific Attribute list for marginal Attributes.
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 0) seconds.
Offline data collection
capabilities: (0x71) SMART execute Offline immediate.
No Auto Offline data collection support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 167) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x3035) SCT Status supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 077 064 006 Pre-fail Always - 51389744
3 Spin_Up_Time 0x0003 099 099 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 29
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 071 060 045 Pre-fail Always - 11231962
9 Power_On_Hours 0x0032 083 083 000 Old_age Always - 15088 (9 28 0)
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 29
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
188 Command_Timeout 0x0032 100 100 000 Old_age Always - 0
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 062 037 040 Old_age Always In_the_past 38 (Min/Max 34/50 #31)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 1
193 Load_Cycle_Count 0x0032 022 022 000 Old_age Always - 157057
194 Temperature_Celsius 0x0022 038 063 000 Old_age Always - 38 (0 15 0 0 0)
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 5
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 661 (88 209 0)
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 9628816876
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 1168058774
254 Free_Fall_Sensor 0x0032 100 100 000 Old_age Always - 0
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
When I do writing operations in the hdd, I can hear somewhat loud mechanical noise from hdd.
What you advice me?
Thanks, as you can see in the output you have multiple errors. So it would be a good time to copy over your data either to a spare machine or whatever you are using for backup purpose. However in doing so I recommend not simply copy via cp instead use rsync - it’s super reliable and powerful.
dam034
January 27, 2026, 3:55pm
5
I have to copy entire folders containing files and symbolic links.
I want to keep sym links and last time modification of all files/folders.
How can I do?
Thanks
I do not know what is your backup medium but here I assume you are using an external drive with ext4/xfs/btrfs file system you would backup for example /home/yourusername/
rsync -avHAX --delete --progress /home/yourusername /mnt/backup/
Breaking down this command:
-a (Archive mode combines several other options and essentially tells rsync to preserve permissions, ownership, timestamps, symbolic links,…)
-v (verbose mode)
-H (preserve hard links)
-A (preserve ACLs (Access Control Lists)
-X (preserve extended attributes)
–delete (delete files on the destination that are no longer exists on your source) Be cautious with this switch as in case you delete something in your source it will delete the same files also in your backup - like its 1:1 mirror of your source.
–progress (shows the progress of the backup)
ogra
January 27, 2026, 7:18pm
7
Make sure the filesystem on the target disk actually supports symlinks (i.e. don’t use any FAT variant)
1 Like
dam034
January 29, 2026, 4:51pm
8
I want to backup my server in my local pc and in an external hard disk. Both are ubuntu and are formatted with ext4. Also the hard disk has ext4.
Is it possible?
No problem as you can do rsync over ssh. EXT4 is fine for this purpose.
dam034
February 3, 2026, 1:16pm
10
Now I want to know how can I mount automatically at boot the new hard disk at the same mount point of the old.
Can I post here or I need to open a new topic?
Thanks
yancek
February 3, 2026, 2:29pm
11
Check the /etc/fstab file and replace the device, partition for the old device with the device, partition for the new device. Obviously, can’t have both drives attached.
1 Like
dam034
February 4, 2026, 12:23pm
12
This is server’s fstab:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb2 during curtin installation
/dev/disk/by-uuid/e5af9c9d-4bb6-4013-8251-f6ec5f34c1e7 / ext4 defaults 0 1
# /srv was on /dev/sda1 during curtin installation
/dev/disk/by-uuid/d97db283-0f7b-4c34-84bd-68c28cb3a65e /srv ext4 defaults 0 1
# /boot/efi was on /dev/sdb1 during curtin installation
/dev/disk/by-uuid/C3C2-9080 /boot/efi vfat defaults 0 1
/swap.img none swap sw 0 0
Now I have to replace the uuid on /srv mount point. Right?
Can I get the uuid on this local pc and after type it in the server?
Thanks
You mean you are remote logged in via ssh - of course
sudo blkid /dev/yournewdrive
will show you the UUID.
dam034
February 6, 2026, 2:39pm
14
I created GPT table partition on the new hdd, and I ecexuted smartctl to see if it is good or has manufacturing defects, this is the result:
root@corcierge:/home/vincent# smartctl -a /dev/sdb
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-6.8.0-45-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Seagate Mobile HDD
Device Model: ST1000LM035-1RK172
Serial Number: ZDE671DK
LU WWN Device Id: 5 000c50 0a58ce530
Firmware Version: SDM2
User Capacity: 1.000.204.886.016 bytes [1,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Form Factor: 2.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-3 T13/2161-D revision 3b
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Fri Feb 6 15:32:07 2026 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 0) seconds.
Offline data collection
capabilities: (0x71) SMART execute Offline immediate.
No Auto Offline data collection support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 162) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x3035) SCT Status supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 075 066 006 Pre-fail Always - 33374498
3 Spin_Up_Time 0x0003 100 100 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 6
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 100 253 045 Pre-fail Always - 15171
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 0 (157 94 0)
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 3
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
188 Command_Timeout 0x0032 100 100 000 Old_age Always - 0
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 081 067 040 Old_age Always - 19 (Min/Max 18/19)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 2
193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always - 17
194 Temperature_Celsius 0x0022 019 040 000 Old_age Always - 19 (0 18 0 0 0)
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 0 (3 82 0)
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 33193387
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 181111
254 Free_Fall_Sensor 0x0032 100 100 000 Old_age Always - 0
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
I hear some small noise coming from the disk, I don’t know if it’s normal or not. If you want, I can record it and send it here for you to hear.
Can I trust him?
dam034:
smartctl -t]
A healthy hard drive typically produces a low humming or quiet whirring noise during operation or when accessing data whereas a defective drive can produce clicking or other loud noises which are indicators for mechanical or electrical failures which can lead to a potential data loss.
It is up to you - always have a backup of your data and even a new drive can be defective (had once a drive which I had to replace within a day after a stress tested it). Maybe you can put some load on drive to check how it behaves until you decide whether you put in production.