did you ever delete a file on ext3 and cried at the moon?

Don’t cry,
There’s a solution for this!
I accidentally deleted a very important file this morning, I lost one day of work on that script, I could not accept this loss.
So here how I recovered the file, hoping it will be useful also for you:

– first thing to do is to avoid any other process to claim the inodes you want to preserve since they have still your removed data

Mount -o remount,ro /partition-where-the-file-was (e.g. home)

Then once we are sure nobody will try to write on our deleted file we can run ext3grep

./ext3grep /dev/sdXY –search mydeletedfilename

We’ll get back a list of inodes that might be of interest for our recover action, so we check them all in one run to have a detailed report on each of them:

for block in 165022 (and many other blocks) ; do
./ext3grep /dev/sdXY –ls –block $block | tee -a output.txt Done

Now we got an output that can point us to the proper inode to be recovered:

A sample output of this output.txt

Number of groups: 16
Minimum / maximum journal block: 262658 / 279059 Loading journal descriptors… sorting… done The oldest inode block that is still in the journal, appears to be from 1347980126 = Tue Sep 18 15:55:26 2012 Journal transaction 436815 wraps around, some data blocks might have been lost of this transaction.
Number of descriptors in journal: 15386; min / max sequence numbers: 436198 / 436922
Group: 8

Block 263091 is a directory. The block is a Journal block

.– File type in dir_entry (r=regular file, d=directory, l=symlink)
| .– D: Deleted ; R: Reallocated
Indx Next | Inode | Deletion time Mode File name
1 2 d 122984 drwxr-xr-x ..
3 4 d 123156 D 1348049081 Wed Sep 19 11:04:41 2012 drwxr-xr-x office
4 5 d 123812 D 1348049106 Wed Sep 19 11:05:06 2012 drwxr-xr-x perform_archive

So we look for our filename and the latest date we can find in output.txt

To try and recover an inode we run this:
./ext3grep /dev/sda3 –restore-inode 123002

This way we get a file containing the contents of the inode that might be our original lost file.
And I found it after some tries.
Happy hacking!

the old unix way used to be
grep -i -a -B10 -A100 ‘myfilename’ /dev/sdXY > /var/tmp/recover.txt

but it might not work on a ext3 FS nowdays, I gave it a try and with some effords I think I could recover the file also this way, but ext3grep gave me the full file with no much pain, so I think it should be the preferred way.

small media initiative

Per conto di Autistici/Inventati il draft dell’intervento che terremo a londra il 6 ottobre.

Grassroots movements in italy: when hacking and politics meet to produce independent information
– A little background
In Italy in the late nineties there was a niche of squatters who was interested in cyberpunk culture and since the BBS era (90s) there were groups in the squat movement who were approaching the computer networks as an important tool for modern communication.
In 1998 there was the first hackmeeting initiative in Italy, a hacker gathering held in a squat in Florence, a three days of knowledge sharing, hacking and debates on themes like privacy, (h)acktivism and techno nomadism. This had been the coming out of the italian hacker scene to fight back the mainstream definition of hacker, which at the time where seen basically as ‘computer criminals’, while it is well known that the hacking attitude is not exclusively about cracking computer networks but it involves creativity, intelligence and outreach, and building networks as well.
Slogans like ‘information wants to be free’, ‘we build the internet’ and ‘we believe in running code and rough consensus’ were pretty well taken by technology activists all around our country.
After that, lots of people changed their mind, in Italy, about the definition of hackers – not anymore a dark entity working to destroy, but a rather well defined individual (or collective) willing to liberate information, build networks of people and computers, and mastering and sharing knowledge with everyone.
– The italian mix of hacking and politics
Autistici/Inventati is a typical example of a grassroots collective, born in squats through the encounter of two different groups, and here lies its first peculiarity.
This introduced a duality which somewhat (in our opinion) lead to a better organizational model.
Every interaction within the collective is based on network-based communication, using whatever tool is available (mailing lists, chatrooms, e-mails and so on) to co-ordinate ourselves, or for instance to meet up in person to give birth to our first internet server.

Autistici was a sub-group of a hacklab collective, named LOA, which was gathering hackers from the italian underground scene of Milan, very active on their territory and oriented on a knowledge sharing approach.
Born in 1999, in 2000 they gave birth to a classroom of 24 recycled “486” computers, in order to offer computer programming lessons to everyone.
This example had been followed in many other towns in Italy, where hacklabs were quite present in squats at the time, the first of them founded in 1995 (Freaknet Medialab, Catania).
This evangelization effort led to an offspring of media activists, in a situation where in the beginning, there was perhaps just one person in every squat who was able to write HTML and publish online.
An example of this situation was in the squat were LOA was based, where an e-zine, named chainworkers.org, about casual workers and chainworkers’ rights, was made possible by the effort of a single person out of a whole collective.
Not counting all the knowledge produced by LOA: a lots of courses where taken ‘as is’ by several reference guides on the ‘net and printed by universities’ student collectives as well.
Inventati was a group of activists based in Florence who envisioned the Internet as a key tool for doing politics available to the masses. They used open source tools to cover various no-global events, like during the anti-IMF and World Bank protests in Prague (2000), where they set up some sort of “ante-litteram twitter” in order to have a real time coverage of the event.
We both aimed at using the internet and media tools to provide a service to the movement and do our own communication without being filtered by mainstream media.
An example had been the Media Center of the Genoa G8, which was built with GNU/Linux computers thanks to the efforts of the hacker community and of activists who aimed at providing a media coverage of all the different protests and political alternatives present in those days.
This experience turned out to be the first real evidence of the existence of the new born italy.indymedia.org, which had first been introduced in Italy few months before as a ‘media hoax’ by a couple of local activists. For the G8 Media Center, Indymedia, given the push of Autistici/Inventati and several other individual activists, turned out to be a huge internet subject that was letting ‘the media-activist’ be born in Italy, in a networked environment. Therefore the need for education on internet tools became crucial for lots of activists.
The italian movement was now largely online (2001).
Since then, in Italy there has been a media center for all the most important demonstrations, and media-activists have made audio/video streaming and published texts and images through Indymedia (and other minor similar projects).
As it often happens in these environments, the approach to obtain these results had been ‘learn by doing’ and ‘self manage your own needs and desires to let happen what you want to happen’, by promoting a networked culture based on ‘rough consensus’ — as normally happens in anarchist groups — and inevitably on ‘running code’ — as the hacker culture prescribes.
In the years Autistici/Inventati has become an informal service provider, at first based on a recycled computer, a server where activists could get free and anonymous mailboxes, webspace, mailing lists, as well as some HOWTOs to learn about encryption and the basic usage of a computer connected to the internet. So besides the basic needs of a networked communication mode, we were already offering a GPG key server and an anonymous remailer, providing tools to protect activists from commercial and police attention.
As stated in our policy, we never ask users to give us their personal data, we don’t keep any trackable information about them and we use every possible technical option to keep the sensitive data (e.g. personal emails) hidden from third parties not involved in the communication process. Over time, as our user base was growing — along with police attention –, we set up a network of servers abroad to take advantage of grey areas in international legislation, so as to make our services more resilient and secure.
The choice of introducing new tools has always been preceded by a need to satisfy our community, the activists. We didn’t follow every single Internet hype towards a new way of participating in the Internet mediascape, even though we did real time streaming when the mainstream was still wondering about how to monetize their textual web site.
For example, we launched the Noblogs blogging platform in late 2004, when the “blog” concept was already well established.
At the time, the Indymedia Network in Italy was about to collapse. It was clear that it wasn’t reflecting the complexity of the italian movement anymore, and so we believed we had some chances to collect the different pieces by providing *personal* blogs, and then letting the different groups recombine. This has successfully happened in a number of cases: for instance femminismi.noblogs.org is the result of several feminist blogs which decided to federate and publish their posts in one common place.
The ongoing process of redefinition of the range of tools led us to choose to support Tor as a service and recently to launch our own disposable self-service VPN(Virtual Private Network), so as to allow our users to browse the web in a secure way, since the global surveillance scenario is always evolving and becoming more complex.
From the firewall of an office, spying on employers, to the great firewalls on the Internet borders of many nations, there’s a widespread tendency to control, spy, analyze, monetize every activity everyone is doing online.
Going forward, from this huge amount of ‘learn by doing’ and self organization, in more than 10 years we have suffered seizures of our servers or of hosted sites, requests of personal details of email owners and such. When possible, we faced trials and actually won in court in the name of freedom of expression and satire. In other occasions we have just (passively) resisted by not accomplishing the requests, since we were asked for personal details and, as stated before, we don’t have them.
This is possible since we are not formally an internet service provider but a simple informal association: a narrow legal escape that till today had made our survival possible in frequent occasions.
“Condividere saperi senza fondare poteri” / “Sharing knowledge without establishing powers” is our slogan.
It’s a quote of Primo Moroni, an indipendent left-wing Italian librarian and writer from the 90s, and we get most of our inspiration on sharing from his words.
Looking to the present and future of our collective, we aim to be inspiring for other tech collectives, therefore all of our tools are publicly available and documented.
Every single aspect of our server infrastructure can be replicated by anyone. Our secret dream is to build a federated network of servers like ours.
In the meantime we are trying to understand and improve our organizational model, hoping for it to be replicable as well.
Speaking of ongoing projects, In the near future we will be launching new services where a discreet amount of our users will be involved directly with our infrastructure, we codenamed it as “AIbox”.
The rationale behind that is that we’d like to give a “piece” of Autistici.org to those selected users, whom will end up owning a piece of this resilient “cloud”.
It’s important to say one last (more?) thing about Autistici/Inventati: All this has always being funded by collecting donations.

ho vinto

sentivo puzza di bruciato,
ho detto ad un’amica:
“esco a veder bruciare l’azienda fumando una sigaretta”
esco e la caldaia stava bruciando.
tutti a casa.