The problem
Recently my Samsung TV didn't recognize my external USB hard disk drive anymore. That was a really bad feeling since I recorded some interesting videos on it actually. The TV suggested to format the disk when I was trying to start the recording. Since I have set the user language of my TV to German, I got the error message called "Angeschl. USB evtl. nicht für Aufnahmefunktion geeignet! Mögchten Sie das Gerät formatieren?"Well, formatting the disk was an option at all, because I didn't want to loose those videos.
The solution
I knew that the disk was formatted by the TV with a non-standard file system, and I was wondering whether I could fix the issue by using Linux. I did and I have created the following instructions, because the issue happened to me the 2nd time already and if you read this, you have a similar problem with your TV/hard disk drive right now, probably. Here we go, this is my recipe ...1. Start Linux
If you don't have Linux installed on your computer, download a live CD/DVD from the web, burn it and boot from it. Alternatively setup Linux on an USB pendrive and boot from there. In my case, I was using Ubuntu 12.04 since that is one of my preferred Linux systems, but any modern GNU/Linux system should do the trick as well. You can download Ubuntu from ubuntu.com. Nonetheless, please take into account that the following instructions have been tested on Ubuntu 12.04 only and dependent on your actual problem/environment, the instructions below have to be modified probably in order to meet your actual needs.2. Open a terminal
Shortcut on Ubuntu: Ctrl+Alt+T3. Disable the automounter
In worst case, the automounter could try to mount a corrupt file system and it could crash the Linux kernel. Therefore at first please disable the automounter by running gsettings under the normal user:$ gsettings set org.gnome.desktop.media-handling automount 'false'
$ gsettings set org.gnome.desktop.media-handling automount-open 'false'
4. Attach the USB disk to your computer
If your computer crashes, you didn't follow my instructions, go to step 2 ;-)
5. Identify both the device and the filesystem
I use gparted since it is the most comfortable graphical way to get an overview on the disks that have been attached. gparted is part of the Live CD, but it is not installed by default. If you don't have it, install it by typing$ sudo apt-get install gparted
Start gparted by typing
$ sudo gparted
In my case, the external disk is /dev/sdb and it has one partition called /dev/sdb1. It has been formatted by the televison set with the xfs filesystem:
Close gparted again.
Update 12.06.2021: since the problem happend again after seven years (yes, I still have that TV) and gparted have a hard time to read the disk this time, I was using the command line tool lsblk with the option to print out the file system:
$ lsblk -f
in order to find the xfs partition.
6. Install the xfs packages if not done yet
$ sudo apt-get install xfsprogs$ sudo apt-get install xfsdump
7. Perform a xfs_check
$ sudo xfs_check /dev/sdb1
ERROR: The filesystem has valuable metadata changes in a log which needs to
be replayed. Mount the filesystem to replay the log, and unmount it before
re-running xfs_check. If you are unable to mount the filesystem, then use
the xfs_repair -L option to destroy the log and attempt a repair.
Note that destroying the log may cause corruption -- please attempt a mount
of the filesystem before doing this.
Since we cannot mount the file system, we have to execute the xfs_repair program.
Update 12.06.2021: I have just learned that xfs_check was removed in 2014, the functionality of xfs_check is now managed by xfs_repair. See also https://fossies.org/linux/xfsprogs/doc/CHANGES
So the correct command to check the xfs filesystem is now
$ sudo xfs_repair -n /dev/sdb1
8. Execute xfs_repair
$ sudo xfs_repair -L /dev/sdb1Phase 1 - find and verify superblock...
Phase 2 - using internal log
- zero log...
ALERT: The filesystem has valuable metadata changes in a log which is being
destroyed because the -L option was used.
- scan filesystem freespace and inode maps...
- found root inode chunk
Phase 3 - for each AG...
- scan and clear agi unlinked lists...
- process known inodes and perform inode discovery...
- agno = 0
- agno = 1
- agno = 2
- agno = 3
- process newly discovered inodes...
Phase 4 - check for duplicate blocks...
- setting up duplicate extent list...
- check for inodes claiming duplicate blocks...
- agno = 0
- agno = 3
- agno = 2
- agno = 1
Phase 5 - rebuild AG headers and trees...
- reset superblock...
Phase 6 - check inode connectivity...
- resetting contents of realtime bitmap and summary inodes
- traversing filesystem ...
- traversal finished ...
- moving disconnected inodes to lost+found ...
Phase 7 - verify and correct link counts...
done
9. Perform an xfs_check again
$ sudo xfs_check /dev/sdb1
$
No errors anymore :-)
Update 12.06.2021: as already explained in step 7, the correct command is now
$ sudo xfs_repair -n /dev/sdb1
10. Enable the automounter again
$ gsettings set org.gnome.desktop.media-handling automount 'true'$ gsettings set org.gnome.desktop.media-handling automount-open 'true'
11. Disconnect the disk by unplugging the USB-disk from the computer
The file system wasn't mounted yet, so it is ok to disconnect the disk by unplugging the cable.12. Connect the disk by plugging the USB-disk to the computer
The automounter has been enabled again, you should see the disk icon on your desktop.13. Check whether files are there
$ ls /media/*-*/CONTENTS/*.srf | wc -l
41
Bingo. In my case the filenames of the videos are stored with suffix .srf, that could be different in your case. The wc command counts the lines that the ls command produces, in other words there are 41 videos on that partition.
Update 12.06.2021: Ubuntu 20.04 (and a few releases earlier) mount mobile media disks under /media/$USER so in my case the correct command is now:
$ ls /media/$USER/*-*/CONTENTS/*.srf | wc -l
Dear Johann,
ReplyDeleteThanks a lot for your post. It helped me to solve the same problem with a D8000 Samnsung Tv. Nevertheless, let me point something that hapened to me that could be useful for people experimenting the same problem.
I use a 500 Gb disk with two partitions, and the TV experimented the same problem with both many times. As most of the Tv shows recorded could be watched online, I just reformated the partition each time... but, finally, this was bothering me. So when it hapened again this afeternoon I tried to find a solution.
As said, my hard drive has two partitions with different sizes. The small one had this problem in the past but, it is working fine since it was filled up and has no new recordings. The big one failed (again) this afternoon. When I tried to use the xfs_repatir following your instruactions it didn't worked. So i did a fdisk o the drive and it showed that both partitions were labeled as NTFS (id 7). With the "t" comand I changed the partitions label to "linux" and then xfs_repair worked perfectly.
I guess that this maybe hapened because the drive was partitioned in windows, and then the partitions formated to XFS by the TV. The thing is that even the partition working perfectly had a NTFS label, although the TV recognized it as XFS.
Thanks again and best regards.
Just to point out that I changed the label to Linux using id 83
Delete