Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-04-09
7
Medium Priority
?
258 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 1500 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
Q2 2017 - Latest Malware & Internet Attacks

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out our latest Quarterly Internet Security Report!

 
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

609 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