LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-17-2022, 05:32 AM   #1
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,515

Rep: Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604
Disk Question for hardware heads.


I've recently found a load of orphaned inodes on a partition. Rather than rely on the repair, I restored a backup.

Is there a way to relate those inodes to files or directories which can cut down the amount of rewriting and allow me to be a bit more diagnostic about the files?

Last edited by business_kid; 04-17-2022 at 05:37 AM.
 
Old 04-17-2022, 06:49 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,253
Blog Entries: 21

Rep: Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777
There's a libc function called readdir which will read out directory entries. It returns structures that have an inode number as the first field and a filename as the last. You could write a little program that runs this function on each directory in turn and picks up the filenames corresponding to the inodes. Maybe write them into a file on another partition.
 
Old 04-17-2022, 08:23 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,190

Rep: Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941
1. how do you know you have orphaned inodes?
2. did you try to run fsck -N on that filesystem?
3. you can use testdisk or photorec or similar to recover lost files.
 
Old 04-18-2022, 04:52 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,515

Original Poster
Rep: Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604
Thanks, hazel, but a libc function isn't a lot of use unless I can use it!
What you're effectively telling me is that no program uses it?

@pan64: I don't see a path to an answer in your questions, but as you ask:
  1. e2fsck told me.
  2. Yes, it doesn't do much.
  3. I don't need to, e2fsck fixed them.
 
Old 04-18-2022, 05:10 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,378

Rep: Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190
By definition, orphans aren't related to any current non-deleted entity. Recovering them is moot.
Quote:
Originally Posted by business_kid View Post
I don't need to, e2fsck fixed them.
So why do you care ?.
 
Old 04-18-2022, 03:11 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,515

Original Poster
Rep: Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604
Quote:
Originally Posted by syg00 View Post
By definition, orphans aren't related to any current non-deleted entity. Recovering them is moot.So why do you care ?.
Because I lost sound in my RazPi 4 overnight. I fsck'ed the disk, found orphaned inodes, but still no sound. I restored a backup, but still no sound. But if I use an sdcard instead of disk drive, I have sound
 
Old 04-18-2022, 03:42 PM   #7
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Rep: Reputation: 164Reputation: 164
You peaked my interest here, so I did a little bit of reading. In particular, https://unix.stackexchange.com/quest...orphaned-inode
I don't know if this does anything for you, but ...
Quote:
An orphaned inode is a file that is “semi-deleted”: it has no more directory entry, but it's still open in some process, so the data is still present on the disk. When the last process that has this file open closes it, the file will be fully deleted and the orphaned inode will disappear.
 
Old 04-19-2022, 12:23 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,190

Rep: Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941Reputation: 7941
Quote:
Originally Posted by business_kid View Post
Because I lost sound in my RazPi 4 overnight. I fsck'ed the disk, found orphaned inodes, but still no sound. I restored a backup, but still no sound. But if I use an sdcard instead of disk drive, I have sound
Looks like your installation is corrupted. Probably would be better to save important data (including configs) and reinstall. Recovering is not that simple [sometimes].
Or just compare the content on the sdcard and disk drive.
 
Old 04-19-2022, 06:21 AM   #9
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,515

Original Poster
Rep: Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604
The cause of this was (100%) a rough power down.

I deleted the filesystems (/boot & / but not /home). I remade the filesystems, and restored a backup again.

I have a little progress, but no sound.

In pavucontrol, there's a sort of 'VU Meter' on the "Playback" & "Output Devices" tabs. Now I have sound on the "Playback" tab, but not the "Output Devices." Is that in the least way diagnostic? Is it a firmware issue?

BTW, I'm recovering from Covid and am back running with full sound on the sdcard.

Last edited by business_kid; 04-19-2022 at 06:23 AM.
 
Old 04-24-2022, 01:57 PM   #10
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,515

Original Poster
Rep: Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604
Ok, I FINALLY got this.

I've done disk restores, etc. and still ended up exactly where I was - no sound.

I had vu displays in pavucontrol/playback, but none in output devices. I was trawling through that, and discovered a 3rd icon to the left of the lock symbol. I clicked on it, and sound was restored. It was some sort of mute thing.

I'm mentally exhausted, but it's sorted.

EDIT: As soon asw I clicked on this unlabelled icon, it vanished. I'm sure I passed it many times without noticing it.

Last edited by business_kid; 04-25-2022 at 07:55 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to change sectors, heads and cylinders in hard disk kaushalsingh Linux - Newbie 2 12-24-2009 08:13 AM
Hard Disk Independent R/W Heads ??? Guilherme General 1 02-13-2007 09:53 AM
How can I calcuate disk space from cylinders, heads, and sectors? abefroman Linux - Hardware 2 08-14-2005 09:59 PM
just a heads up about remote Xsessions and disk space antken Linux - General 0 11-26-2003 03:40 PM
xinerama and dual heads phliver Linux - Software 3 08-05-2003 02:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration