Solved

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

Posted on 2009-04-09
7
249 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

688 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