Page 1 of 1

Windows users script feedback

Posted: 12 Oct 2012, 02:26
by brokenman
If you have a partition with windows installed please run the attached script after booting into Porteus and let me know the console output. It simply searches for all partitions with windows installed. I am looking for the fastest way to find windows partitions.

Thanks in advance to those that help.

Code: Select all

#!/bin/bash

get_windows_drives(){
for drive in `blkid|egrep "ntfs|vfat"|cut -d: -f1`; do
  if [[ `grep $drive /proc/mounts` ]]; then
    find `sed 's@dev@mnt@g' <<<$drive` -maxdepth 3 -type d -name "*ystem32" 2>/dev/null
      else
    echo "$drive is not mounted!"
  fi
done
}

time get_windows_drives

Re: Windows users script feedback

Posted: 12 Oct 2012, 10:46
by wread
Hi, Jay!
Here is what I get:

root@porteus:~# ./get_windows_drives
/mnt/sda1/WINDOWS/system32
/mnt/sda1/WORKSSETUP/System32

real 0m6.568s
user 0m0.141s
sys 0m0.068s
root@porteus:~#

This is an old Toshiba Satellite with 1.4 Mz Intel Celeron.

Regards!

Re: Windows users script feedback

Posted: 13 Oct 2012, 16:48
by Iapetus

Code: Select all

/mnt/sda1/WINDOWS/system32

real	0m17.043s
user	0m0.312s
sys	0m0.094s
I'm on a 2.4 ghz dual core processor with 2 GB RAM, but still slower than wread...

When I run this a second time, however, I get this:

Code: Select all

/mnt/sda1/WINDOWS/system32

real	0m0.635s
user	0m0.216s
sys	0m0.038s
So perhaps it's taking me a while for my drive to wake up the first time. Maybe you could wake the drives up at the start of the script, so they're ready when you need to run your search?