Commands at your service !!

 

GSoC2016Logofever_logoFOSSASIA bring’s people together to share, create, develop and make things with Open Technologies and software. We organize science hack labs, Open Tech events, meetups and coding programs with developers, designers and contributors.
Checkout the FOSSASIA Idea’s page for more information.
(ˢᵒᶜⁱᵉᵗʸserver) aims to be a platform for developing collaborative applications.
sTeam server project repository: sTeam.

Break the PR

The week saw a lot of commands been added to the sTeam-shell script.

The earlier PR sent during the proposal writing period was addressing a lot of issue’s. As a result the PR was cherry picked and rebased to form smaller PR’s for each issue.

Issue.Github IssueGithub PR
Add directory location for libxslt.soIssue-25PR-66
Makefile.in changes to add the files in the tools directory to the installed location.Issue-27PR-67

Import from git script

The import to git script was further enhanced to support the feature whereby a user can specify the name of the object in the sTeam directory when a single object is been imported.

The user can now import a single object to the steam work area using the import-from-git script.

The command works for objects of all mime-types.
Two formats for the command are supported.

Issue.Github IssueGithub PR
Add utility to support single import in import-from-git script .Issue-16PR-76

Format 1:

import-from-git.pike ~/gitfolder/zy.mp3 /home/sTeam/

This would create the object in the sTeam directory. The new object would have the same name as the object in the git directory.

Format 2:

import-from-git.pike ~/gitfolder/zy.mp3 /home/steam/ab.mp3

This would create an object with the name ab.mp3 in the sTeam directory. If the object exists from before, the contents of it will be over written with the contents of the object from the git-folder.

Note: Here ‘/’ at the end of the steam directory is used as a distinguishing factor between a directory and an object. Be careful while passing the steam directory in the command or it would throw error.

Import-changeName
List User’s

The command to list all the existing user’s in the sTeam server was also added to the steam-shell.

Issue.Github IssueGithub PR
List users.Issue-72PR-78

List_user

The user after creation needs to be activated by the root user. Thus a user can then access his steam-shell command line by passing the parameters of user name, host name or port number.

./steam-shell.pike -u uname -h hname -p pno

Passing Arguments to the sTeam-shell

The sTeam shell was modified during it’s integration with vi. This had introduced a bug where by the above parameters where not been able to pass along when a command to the sTeam-shell was passed as an argument. The issue was addressed and resolved.

The user can pass arguments like user name, host and port-number to the steam-shell.pike along with the steam-commands.

Issue.Github IssueGithub PR
Add utility to support passing arguments to the sTeam-shell.Issue-71PR-75

 Eg.

./steam-shell.pike -u user -h host -p portno steam-command

sTeam-shellArguments

Modularize the tasks

The commands for user manipulation were grouped under their operations like create, delete or list. This the commands were modularize.

Issue.Github IssueGithub PR
The user commands have been modularized based on the actions they perform.Issue-73PR-81

The action create, delete and list now support user operations.
Example:

To create a user.

create user test

The terminal would ask for password and email-id.

To delete a user

delete user test

To list all the users

list users

Modularize users

Create a file

The command to create a file of any type was added to the sTeam-shell. The code for creation and deletion of objects in the sTeam shell was modified and optimized.

The user can now create a file of any type from the command line.
The mime-type of the file is auto-detected.

Issue.Github IssueGithub PR
Create a file from sTeam-shellIssue-79PR-82

Usage:

create file filename destination

This would create a file with file name as specified in the given destination. The file name can be like xyz.txt / xyz.pike / xyz.jpg / xyz.mp3. The destination " . " means the current destination.

CreateFile
More commands for groups

The commands to create, join, leave and list groups were added by my colleague Siddhant Gupta. The branch was merged with my working repo. The merge conflicts were successfully resolved. More commands for operations of a group were added.  A user can list all the members of a group, list groups that a user is member of and delete a group.

Issue.Github IssueGithub PR
Create a file from sTeam-shellIssue-80PR-84

Usage

  • To list all the groups that a user is member of.
list my groups
  • To view all the members of a group.
list groupname members
  • To delete a group
delete groupname

GroupCommands
Support for sending mails

The steam-shell user can now send mails. The utility to support mails was added. The earlier web.spm package was analyzed to find the existing classes used in the web interface in order to support this utility. The browser.pike file can in handy.

Issue.Github IssueGithub PR
Add utility to send emails.Issue-74PR-85
 The user can now send emails from the steam-shell.pike.

Usage:

send_email

This would ask the user to enter the recipients. The recipients can be a sTeam user, a group or an external email.

Note: The recipients should be separated by “,”.

Then the user has to write the email subject and the email body.
After this the user would be then notified about the status of the email.

Successfully sent mail

SuccessfullMail

Mail failed due to wrong recipient

UnsuccessfullMailUser
Mail failed due to empty subject

UnsuccessfullMailNoSubject
Logs

Finally, at the end of week, the command to display the logs of the sTeam server from the steam-shell command line were added.

The user can now see the logs of the sTeam server from the command line. The logs are stored in the /var/log/steam/ directory.

Issue.Github IssueGithub PR
Open sTeam-server logs from sTeam-shell.Issue-83PR-86

Usage

log

The user will be notified about the logs and would be asked to input the name of the logs to open.

The log files include errors, events, fulltext.pike, graphic.pike, http, search.pike, security, server, slow_requests, smtp, spm..pike and tex.pike.
Enter the name of the log files you want to open.
Note: The filenames should be separated by ",".

Input the name of the log files to open. The log files would be then opened in a vi window. User can open multiple logs.

LogCommand

Opened Logs

OpenedLogs

The mid term evaluation for Google Summer of Code 2016 set’s in.  The week end will decide the fate of GSoCer’s and determine whether they continue working on their projects or they project work did not meet the expectations of the organization.

All the Best to everyone out there, who’s debugging all the way through mid night. 😛

Happy Coding 🙂

Destruction breeds Creation.

GSoC2016Logofever_logoFOSSASIA bring’s people together to share, create, develop and make things with Open Technologies and software. We organize science hack labs, Open Tech events, meetups and coding programs with developers, designers and contributors.
Checkout the FOSSASIA Idea’s page for more information.
(ˢᵒᶜⁱᵉᵗʸserver) aims to be a platform for developing collaborative applications.
sTeam server project repository: sTeam.

User Utils

User  convenience is an important aspect for any application to succeed. The sTeam root user should be able to create or delete a user. A command to add / delete a user was added successfully.

The root user should be able to add new user’s using the command line.
The parameter’s like username, password, email-id etc. should be asked and then the user should be created.

Issue.Github IssueGithub PR
Create a user.Issue-58PR-59
Delete an objectIssue-56PR-57
Delete a user.Issue-69PR-70

To create a new user:

create_user username password email

The current users can be found by running the command

 _Server->get_module("users")->get_users();

Similarly a command to delete the user was added to the steam-shell.

The user should be able to delete the objects created/existing inside the user area. A steam-shell command needs to be added to delete the objects from the command line.

The usage of command to delete a user inside steam-shell.pike. Only the root user can delete other user.
Command:

delete_user username

UserActivities
In order to delete an object which can be a container, document or a room in the current steam directory, run the command;

delete test.pike

The object would be deleted.

Tab-Completion Module

The tab completion module of the sTeam shell was analyzed during this period. The tab completion module has an issue whereby it doesn’t lists the options on pressing the tab after  ".

query_attribute("

After pressing the tab after ” the options should be listed. But this is not the case. The bug needs to be resolved.

Tab_completion

 Import from git script

The import to git script can now import a single file into the sTeam directory.

The feature for this was added.

Issue.Github IssueGithub PR
Add utility to support single import in import-from-git script .Issue-16PR-76
sudo ./import-from-git.pike gitfolder/xyz.mp3 /home/sTeam/

The xyz.mp3 would be imported to the sTeam directory.

Import-script

The future work would include resolving the tab_completion module issues and enhancing the import script to support the feature where by a user would be able to specify the name of the file in the sTeam directory.

Tabs, Logs and Export.

 

GSoC2016Logofever_logoFOSSASIA bring’s people together to share, create, develop and make things with Open Technologies and software. We organize science hack labs, Open Tech events, meetups and coding programs with developers, designers and contributors.
Checkout the FOSSASIA Idea’s page for more information.
(ˢᵒᶜⁱᵉᵗʸserver) aims to be a platform for developing collaborative applications.
sTeam server project repository: sTeam.

Logs

Week 3 included working on to provide support for logs and exporting of the content from sTeam directory to a git repository. Week 3 also witnessed a breakthrough in sTeam development by Siddhant Gupta who was able to successfully implement the TLS protocol in pike.

The Logs were displayed erroneously. Also the user was not able to scroll down the log to the latest message.  During the course of the week the golden ratio script used in the program was updated to it’s latest version.

Also the editor is opened using sudo command so as to access the vim scrips in the /usr/local/lib/steam/tools directory.
The files are opened using the vim command:
vim -S script -c edit filename1|sp filename2

Only one buffer is accessible at a time. In order to switch the buffer to log buffer the command is CTRL+Ww. Enter this command directly without entering the vim terminal using :.
The log buffer would be accessible, can be edited and scrolled down to the latest log message.

Issue.Github IssueGithub PR
Access the log window till the end.Issue-20PR-48
Open appropriate log window when a sTeam command is executed.Issue-49PR-51

ScrollToLatest

The logs were displayed erroneously. Ideally the log should be displayed based on the buffer where the sTeam function is called and accordingly the relevant log buffer should be called and display the output. This error was fixed.

MultTabs

The log is displayed in the file named after the file which is opened and concatenated with the suffix “-disp”. In Vi the  :% buffer stores the value of the current file. Consequently this value was concatenated with “-disp” to display the buffer accordingly. The Vi script can be seen below.

ViFunc
Export to git script.

The later phase of the week saw that the export-to-git script was tested vigorously.  All the known issue’s based on the script were replicated in the system and solution was found for them.

The export to git script is now capable of exporting multiple sources at a time. If the last argument is always the target repository then any number of previous arguments can be sources.

Issue.Github IssueGithub PR
Support Multiple Source argumentsIssue-14 Issue-19PR-54
Include Source-name in branch name and add branch description.Issue-9PR-55

Example command :
./export-to-git.pike /home/sTeam/file1 /home/coder/file2 /home/sTeam/container3 ~/gitfolder

The export-to-git script also exports the source name in the branch.  To help distinguish between the branches, we need more descriptive names:

./export-to-git.pike /sources/ /tmp/export-test/

This should create the branch sources-cur_time. Also when a file is specifically exported:

./ecport-to-git.pike /home/coder/demo1.txt /temp/export-test/

would create a branch with name home/coder/demo1.txt-cur_time. This is done to avoid ambiguity between files with same name existing in different locations.
Also a description is added fo the branch name using the git command
git config branch.<branch name>.description "describe branch"
To view this description go to the folder where the branch is exported and then enter the git command
git config branch.<branch name>.description

Export to Git script executing when Multiple Source arguments passed and the modified branchname.

GitExportAndBranchName
Branch Description

BranchDesc

Enhancement of steam-shell plugin and Import from git.

GSoC2016Logofever_logoFOSSASIA bring’s people together to share, create, develop and make things with Open Technologies and software. We organize science hack labs, Open Tech events, meetups and coding programs with developers, designers and contributors.
Checkout the FOSSASIA Idea’s page for more information.
(ˢᵒᶜⁱᵉᵗʸserver) aims to be a platform for developing collaborative applications.
sTeam server project repository: sTeam.

Indentation of Output made independent of the screen-width.

The week 2 saw that the work done till date is tested and looked out for errors. The pull requests made by all the other contributors were tested individually. The errors encountered in them were resolved and the solutions updated in the code base.

There were errors encountered in the Pull request. These needed to be modified. The notable one’s were the Indentation of the output displayed by the look command in the steam-shell. The earlier display was taken into consideration that the default size of the linux terminal is 80 char long. However this can differ from individual to individual terminal settings. Therefore the module reference of pike was studied and a method to display the contents in the output of ls command format was written down. Thus now the output is independent of the screenwidth of an individual.

Issue.Github IssueGithub PR
Indentation of output in steal-shell.Issue-24PR-42

Indentation

Also there were minor errors in the edit.pike script. These were resolved too. The edit.pike was not able to exit the program. Therefore an exit(0) call was made. This resulted in the edit.pike being able to exit successfully but a new error was introduced in the steam-shell.pike. When the edit.pike command was called inside it, the steam-shell.pike would exit on successfully completing the edit command. The steam-shell should not exit in this case. There were changes made in the VisTeam.pike, edit.pike and applauncher.pike in order to get the utility working correctly.

Issue.Github IssueGithub PR
Edit.pike hangs on closingIssue-29PR-44
Edit command closes the steam-shell abruptlyIssue-43PR-44

The steam-shell vim plugin was modified and the support for multiline commands was added. Now the user can type the commands in multiplines, format them and then execute them. The output will be displayed in a new tab.

Issue.Github IssueGithub PR
Integrate sTeam-shell into Vi.Issue-37PR-41

An example of it can be seen below:-

ListGates
Output:

OutputMult

The import-from-git.pike script is used to import contents from a normal git repository into the steam directory. The import from git script was studied and understood initially. The issue’s listed were replicated in the system and a possible solution for them was found out.

The script has support for importing multiple documents at the same time. Also the objects imported supported only text mime type. The script was modified to support other mime types by initially detecting them through an external process. However later in the server/factories/Document_factory.pike file the auto detecting of mime type was found out and used in the code. Now the mime types are detected and updated successfully for documents of other mime types like MP3, jpg,png etc

Issue.Github IssueGithub PR
Auto-detect Mime type.Issue-18PR-45

ImportMimeType

The contents of objects of types other than text mime type were not been read by the existing process. As a result this resulted into creation of empty objects with the set mime type. The process to read the contents were modified and the contents of objects of other types were set accordingly. The content is read in the form of a string. Since every object can be read as a string.

However in the import-from-git an issue was encountered. Indexing over Null value with set_contents for every object created by the script. On running the script again the earlier object is successfully imported but the same error is encountered over the next object to be imported. This issue would be looked down in the coming week and tried to solved. Also support for importing single objects will be provided.

Error1

Integrate sTeam-shell into Vi and Indentation of output in the look command to display like ls

 

GSoC2016Logofever_logoFOSSASIA bring’s people together to share, create, develop and make things with Open Technologies and software. We organize science hack labs, Open Tech events, meetups and coding programs with developers, designers and contributors.
Checkout the FOSSASIA Idea’s page for more information.
(ˢᵒᶜⁱᵉᵗʸserver) aims to be a platform for developing collaborative applications.
sTeam server project repository: sTeam.

Indentation of sTeam-shell output

During the 1 st week the Indentaton of the output in the look command in steam-shell is formatted to be displayed in the way the output is displayed when the ls command is executed.

The module reference provided by the pike language is used for formatting.

he screenwidth of the the user is calculated using the command tput rows.
This value is then passed as an argument to the write function to display it in the form of output of an ls command.
The example of this can be seen in the modref by Pike.

Issue.Github IssueGithub PR
Indentation of output in steal-shell.Issue-24PR-42

Example:

write("%-$*s\n", screen_width,"Given a\nlist of\nslosh-n\nseparated\n'words',\nthis option\n"+ "creates a\ntable out\nof them\nthe number of\ncolumns\n"+"be forced\nby specifying a\npresision.\nThe most obvious\n"+"use is for\nformatted\nls output.");

Output:

 Given a          list of          slosh-n
 separated        'words',         this option
 creates a        table out        of them
 the number of    columns          be forced
 by specifying a  presision.       The most obvious
 use is for       formatted        ls output.

The following chnages have been made in order to incorporate the changes:

IndentationCodeChange

Integration of sTeam-shell into Vi

For integration of sTeam-shell.pike into the Vi, the steam-shell is made compatible to be run when a command is passed as an argument to it. The changes have been made in steam-shell.pike and the applauncher.pike. Also a new file called as VisTeam.pike is created. When this is executed it validates the user and opens two vi buffers. One for typing the command and the other to display the log/ output of the executed command.

A steam-shell.vim vi plugin is created so as to be able to run the Steam function in vi. Whenever this function is executed the selected text in the vi visual mode will be executed.

The results are displayed in the log buffer in a new tab. Since the already existing vim scripts Golderratio.vim and watchforchanges.vim divide the command buffer and the log buffer in the ration 2:1, the output is not visible in the logs. Thus a newtab consisting of the logs is opened.

 

Issue.Github IssueGithub PR
Integrate sTeam-shell into Vi.Issue-37PR-41

InsertIntoVI

Execute the command:

ExecuteCommandsTeamDisplay the output:

DisplayTheOutput

Let the Coding Begin….!!!

GSoC2016Logo
fever_logoFOSSASIA bring’s people together to share, create, develop and make things with Open Technologies and software. We organize science hack labs, Open Tech events, meetups and coding programs with developers, designers and contributors.
Checkout the FOSSASIA Idea’s page for more information.
(ˢᵒᶜⁱᵉᵗʸserver) aims to be a platform for developing collaborative applications.
sTeam server project repository: sTeam.

Let the Coding Begin…!!!

Finally May 23, 2016 sets in.

The paths of glory lead but to the grave.
-Thomas Gray

The path of the GSOC journey is a bed of thorns and roses.

The community bonding period has elapsed and the real GSOC journey begins

GSOC-timeline

The community bonding period has lead to some real constructive work been done in the project.
The installation and deployment of the sTeam was largely dependent on the linux environment. This was a major hurdle for the development process.
Also the installation process of the sTeam project was quite cumbersome. These had to be improved.

The community bonding period was spent in addressing these issues.

For simplying the installation process I began with the creation of the .deb package. There was a .deb package for the earlier versions of sTeam. The .deb package was made to incorporate the new changes.
Finally a decision was made to rename the sTeam package to societyserver.
This renaming has lead to several deb source config issues in the package.

debianpackage

These issue’s will be addressed during the later part of the Summer.

In order to facilitate development in all the environments and give the user the ease from the cumbersome installation steps a docker image was made for the sTeam project.
This docker image contains all the necessary dependencies to start the sTeam server.
It also includes the sTeam UI and the Rest API along with it’s dependencies. These have already been installed and developer can start collaborating to it.

docker-image

The docker image can be found at :


https://hub.docker.com/r/ajinkya007/societyserver/

It has all the necessary information for it’s usage and installation.

The community bonding period also included in me exploring the import and export from git commands, the usage of steam-shell, resolution of some minor bugs in it, integrating the steam-shell in vi. This period also witnessed me getting hands on with the other repositories of the societyserver.org.
The repositories which were analyzed and explored include :-

https://github.com/societyserver/sTeam-web-interface-gsoc-2015
https://github.com/societyserver/steam-rest

So having formed a strong bond during this period, the real showdown begins from May 23, 2016.
The coding period has began, and the time to put words into action has come….
Happy Summer GSOC’ers  🙂

Talk is Cheap, Show me the code !!!

Bond, Community Bond

GSoC2016Logofever_logoFOSSASIA bring’s people together to share, create, develop and make things with Open Technologies and software. We organize science hack labs, Open Tech events, meetups and coding programs with developers, designers and contributors.
Checkout the FOSSASIA Idea’s page for more information.
(ˢᵒᶜⁱᵉᵗʸserver) aims to be a platform for developing collaborative applications.
sTeam server project repository: sTeam.

Bond, Community Bond

The bond was very highly covalent :p

The community bonding lead to sharing of knowledge between all the developers all around the world, their views and opinions on various technologies used in the current times.

The community bonding period saw to it that interaction between the organization mentors, developers , project mentors and colleagues and GSOC’ers all round the world takes place on a regular basis.

The interaction was initiated by Lays Rodrigues by forming a facebook group for 2016 GSOC’ers.


https://www.facebook.com/groups/GSoC2016/

The personal webblog can be found at ;


https://laysrodriguesdev.wordpress.com/2016/05/

Lays has also taken an initiative and created a map where by all the GSOC’ers in the world were mapped according to their place of residence. This can be seen at :

The community bonding period also ensured that I got included in the developer groups of the various organizations for ensuring that the development happens throughout the summer.

Notable include : sTeam.devel group

Additions to the FOSSASIA, Societyserver and PlanetGSoC organizations on github.

sTeamDevGroup
OrgList

 https://github.com/ajinkya007

One of the project which would be having the links to the majority of the blogs published by the GSOC’ers during the course of Summer is Planet GSoC developed by Rohan Verma.

Planet GSoC is Google Summer of Code Blog Aggregator.

This can be found at :

http://planetgsoc.github.io/

Data Recovery: Photo Rec step by step.

Run PhotoRec executable

If PhotoRec is not yet installed, it can be downloaded from TestDisk Download. Extract the files from the archive including the sub-directories.

To recover files from hard disk, USB key, Smart Card, CD-ROM, DVD, etc., you need enough rights to access the physical device.

  • Dos.png Under DOS, run photorec.exe
  • Win.png Under Windows, start PhotoRec (ie testdisk-6.13/photorec_win.exe) from an account in the Administrator group. Under Windows Vista or later, right click photorec_win.exe and then click Run as administrator to launch PhotoRec.
  • Linux.png Under Unix/Linux/BSD, you need to be root to run PhotoRec (ie. sudo testdisk-6.13/photorec_static)
  • Macosx.png Under Mac OS X, start PhotoRec (ie testdisk-6.13/photorec). If you are not root, PhotoRec will restart itself using sudo after a confirmation on your part. Sudo will ask for a password – enter your Mac OS X user password.
  • Os2.png Under OS/2, PhotoRec doesn’t handle physical devices, only disk images. Sorry.

To recover files from a media image, run

  • photorec image.dd to carve a raw disk image
  • photorec image.E01 to recover files from an Encase EWF image
  • photorec 'image.???' if the Encase image is split into several files.
  • photorec '/cygdrive/d/evidence/image.???' if the Encase image is split into several files in the directory d:\evidence

Linux.png Macosx.png Most devices should be autodetected including Linux software RAID (that is, /dev/md0) and file system encrypted with cryptsetup, dm-crypt, LUKS or TrueCrypt (ie. /dev/mapper/truecrypt0). To recover files from other devices, run photorec device.

Forensics users can use the parameter /log to create a log file named photorec.log; it records the location of the files recovered by PhotoRec.

Disk selection

PhotoRec startup.png

Available media are listed. Use up/down arrow keys to select the disk that holds the lost files. Press Enter to proceed.

Macosx.png If available, use the raw device, /dev/rdisk* instead of /dev/disk* for faster data transfer.

Source partition selection

PhotoRec src.png

Choose

  • Search after selecting the partition that holds the lost files to start the recovery,
  • Options to modify the options,
  • File Opt to modify the list of file types recovered by PhotoRec.

PhotoRec options

PhotoRec options.png
  • Paranoid By default, recovered files are verified and invalid files rejected.

Enable bruteforce if you want to recover more fragmented JPEG files, note it is a very CPU intensive operation.

  • Allow partial last cylinder modifies how the disk geometry is determined – only non-partitioned media should be affected.
  • The expert mode option allows the user to force the file system block size and the offset. Each filesystem has his own block size (a multiple of the sector size) and offset (0 for NTFS, exFAT, ext2/3/4), these value are fixed when the filesystem has been created/formated. When working on the whole disk (ie. original partitions are lost) or a reformated partition, if PhotoRec has found very few files, you may want to try the minimal value that PhotoRec let you select (it’s the sector size) for the block size (0 will be used for the offset).
  • Enable Keep corrupted files to keep files even if they are invalid in the hope that data may still be salvaged from an invalid file using other tools.
  • Enable Low memory if your system does not have enough memory and crashes during recovery. It may be needed for large file systems that are heavily fragmented. Do not use this option unless absolutely necessary.

Selection of files to recover

PhotoRec files.png

In FileOpts, enable or disable the recovery of certain file types, for example,

[X] riff RIFF audio/video: wav, cdr, avi
...
[X] tif  Tag Image File Format and some raw file formats (pef/nef/dcr/sr2/cr2)
...
[X] zip  zip archive including OpenOffice and MSOffice 2007

The whole list of file formats recovered by PhotoRec contains more than 300 file families representing more than 480 file extensions.

File system type

PhotoRec filesystem.png

Once a partition has been selected and validated with Search, PhotoRec needs to know how the data blocks are allocated. Unless it is an ext2/ext3/ext4 filesystem, choose Other.

Carve the partition or unallocated space only

PhotoRec free.png

PhotoRec can search files from

  • from the whole partition (useful if the filesystem is corrupted) or
  • from the unallocated space only (available for ext2/ext3/ext4, FAT12/FAT16/FAT32 and NTFS). With this option only deleted files are recovered.

Select where recovered files should be written

PhotoRec dst.png

Choose the directory where the recovered files should be written.

  • Dos.png Win.png Os2.png To get the drive list (C:, D:, E:, etc.), use the arrow keys to select .., press the Enter key – repeat until you can select the drive of your choice. Validate with Yes when you get the expected destination.
  • Linux.png File system from external disk may be available in a /media, /mnt or /run/media sub-directory. Mount your destination drive if necessary.
  • Macosx.png Partitions from external disk are usually mounted in /Volumes.

Recovery in progress

PhotoRec running.png

Number of recovered files is updated in real time.

  • During pass 0, PhotoRec searches the first 10 files to determine the blocksize.
  • During pass 1 and later, files are recovered including some fragmented files.

Recovered files are written in recup_dir.1, recup_dir.2… sub-directories. It’s possible to access the files even if the recovery is not finished.

Recovery is completed

PhotoRec end.png

When the recovery is complete, a summary is displayed. Note that if you interrupt the recovery, the next time PhotoRec is restarted you will be asked to resume the recovery.

  • Thumbnails found inside pictures are saved as t*.jpg
  • If you have chosen to keep corrupted files/file fragments, their filenames will beginning by the letter b(roken).
  • Hint: When looking for a specific file. Sort your recovered files by extension and/or date/time. PhotoRec uses time information (metadata) when available in the file header to set the file modification time
  • After Using PhotoRec: Some ideas to sort recovered files or repair broken ones.
  • Win.png You may have disabled your live antivirus protection during the recovery to speed up the process, but it’s recommended to scan the recovered files for viruses before opening them – PhotoRec may have undeleted an infected document or a trojan.

Source: http://www.cgsecurity.org/wiki/PhotoRec_Step_By_Step