Solved

how to determine where a file is on a umount partitions of the same disk?

Posted on 2009-04-09
7
233 Views
Last Modified: 2013-12-27
In linux, how can I search for a file on umount partitions of the same disk?

For exmple, I'm trying to search for a file name 2530script on the following umounted partitions

/dev/sdc1  
/dev/sdc2  
/dev/sdc3  
/dev/sdc5  
0
Comment
Question by:areyouready344
7 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 24112494
i think you need to mount then search using find command
0
 
LVL 14

Accepted Solution

by:
Deepak Kosaraju earned 500 total points
ID: 24112656
Omarfarid: Is Correct, there is no method of searching for a file on unmounted filesystems. Its not at all possible even on Windows.
0
 
LVL 23

Expert Comment

by:Maciej S
ID: 24112789
Actually, it can be possible, but I wouldn't trust it in 100%.

If all partitions you wrote above are unmounted, you can try this:
strings /dev/sdc1 | grep 2530script
strings /dev/sdc2 | grep 2530script
strings /dev/sdc3 | grep 2530script
strings /dev/sdc5 | grep 2530script
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 23

Expert Comment

by:Maciej S
ID: 24112797
You can also use this when your partitions are mounted - it won't hurt you - but in such situation I would rather use "find" utility :)
0
 
LVL 16

Expert Comment

by:ai_ja_nai
ID: 24114386
oklit had a good idea... but printing on standard output all the filesystem can take a looooooooooooot of time (even if grep cleans away the garbage)
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24114858
areyouready344:

can you clarify why you want it for unmounted partitions? are these raw partitions?
0
 

Author Comment

by:areyouready344
ID: 24277720
The reason why I wanted to search a file on unmounted was because I wasn't sure if linux keep the same mapping of a device file (for example, /dev/sda) to the same scsi hard disk when removing other scsi hard dsik and needed this same device file (/dev/sda) for logging information.

For example, if I remove device file /dev/sdb to a particular scsi disk, will linux change the device file of /dev/sdc to device /dev/sdb now that it has been remove previously. This issue has been resolve because now I use a USB thumb device as the logging location for log files and just create a mount point to it.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In this article we have discussed the manual scenarios to recover data from Windows 10 through some backup and recovery tools which are offered by it.
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now