Bitcoin Forum
February 23, 2017, 04:08:08 PM *
News: Latest stable version of Bitcoin Core: 0.13.2  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Ubuntu: cannot remove .bitcoin directory  (Read 1909 times)
AntiGoogle
Newbie
*
Offline Offline

Activity: 2


View Profile
August 17, 2011, 03:22:42 PM
 #1

Please help. I installed bitcoin just to look at what it was like, because a friend had been telling me about it. Then I decided to remove it. I deleted all files in the directory created by tar and the directory itself. Then I checked my computer and found a hidden bitcoin directory in the /home/username directory. I tried to empty it and to delete it but it went into hidding instead:

alan@alan:~$ cd .bitcoin/
alan@alan:~/.bitcoin$ rm -rf *
alan@alan:~/.bitcoin$ ls
alan@alan:~/.bitcoin$ sudo ls
alan@alan:~/.bitcoin$ cd ..
alan@alan:~$ rmdir .bitcoin
rmdir: failed to remove `.bitcoin': Directory not empty
alan@alan:~$ sudo rmdir .bitcoin
rmdir: failed to remove `.bitcoin': Directory not empty
alan@alan:~$ cd .bitcoin
alan@alan:~/.bitcoin$ ls
alan@alan:~/.bitcoin$ sudo ls
alan@alan:~/.bitcoin$ sudo rm -rf *
alan@alan:~/.bitcoin$ cd ..
alan@alan:~$ sudo rmdir .bitcoin
rmdir: failed to remove `.bitcoin': Directory not empty
alan@alan:~$ sudo chmod -R 777 .bitcoin
alan@alan:~$ cd .bitcoin/
alan@alan:~/.bitcoin$ ls
alan@alan:~/.bitcoin$ sudo rm -rf *
alan@alan:~/.bitcoin$ cd ..
alan@alan:~$ sudo rmdir ./bitcoin
rmdir: failed to remove `./bitcoin': No such file or directory
alan@alan:~$ sudo ls .bit*
alan@alan:~$ mkdir .bitcoin
mkdir: cannot create directory `.bitcoin': File exists
alan@alan:~$ sudo ls .bitcoin
alan@alan:~$ cd .bitcoin
alan@alan:~/.bitcoin$

How do I remove it please?

AG

1487866088
Hero Member
*
Offline Offline

Posts: 1487866088

View Profile Personal Message (Offline)

Ignore
1487866088
Reply with quote  #2

1487866088
Report to moderator
1487866088
Hero Member
*
Offline Offline

Posts: 1487866088

View Profile Personal Message (Offline)

Ignore
1487866088
Reply with quote  #2

1487866088
Report to moderator
1487866088
Hero Member
*
Offline Offline

Posts: 1487866088

View Profile Personal Message (Offline)

Ignore
1487866088
Reply with quote  #2

1487866088
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1487866088
Hero Member
*
Offline Offline

Posts: 1487866088

View Profile Personal Message (Offline)

Ignore
1487866088
Reply with quote  #2

1487866088
Report to moderator
Bitsky
Hero Member
*****
Offline Offline

Activity: 547


View Profile
August 17, 2011, 03:39:20 PM
 #2

Switch to root and when in .bitcoin, do a "cd .." and then "rm -rf .bitcoin"
The directory most likely contains some hidden files, which are not shown with just a "ls"; do a "ls -la" instead.

Bounty: Earn up to 68.7 BTC
Like my post? Feel free to drop a tip to 1BitskyZbfR4irjyXDaGAM2wYKQknwX36Y
Bert
Full Member
***
Offline Offline

Activity: 126



View Profile
August 17, 2011, 03:48:32 PM
 #3

what Bitsky or.
sudo rm -fr .bircoin/.??*
sudo rmdir .bitcoin

The reason I got into the habit of using .??* instead of .* is that some very old and buggy flavours of UNIX would recurse backwards upon seeing the .. folder. And lets just say that something nasty would happen.

Tip jar: 1BW6kXgUjGrFTqEpyP8LpVEPQDLTkbATZ6
AntiGoogle
Newbie
*
Offline Offline

Activity: 2


View Profile
August 17, 2011, 04:10:25 PM
 #4

Thank you. It worked  Smiley .

There was a file called .lock in the .bitcoin directory. It kept being recreated:
alan@alan:~/.bitcoin$ sudo rm -f .lock
alan@alan:~/.bitcoin$ sudo rm -f .lock
alan@alan:~/.bitcoin$ sudo rm -f .lock
alan@alan:~/.bitcoin$ sudo rm -f .lock
etc... Never a "file not found".

The solution was to send all commands in one line:
alan@alan:~/.bitcoin$ sudo rm -f .lock;cd ..;sudo rmdir .bitcoin
This deleted the .bitcoin directory before it could re-create its .lock file

Now what is the process which kept re-creating .lock? Would this still be running on my machine somewhere?

AG
Bitsky
Hero Member
*****
Offline Offline

Activity: 547


View Profile
August 17, 2011, 04:19:38 PM
 #5

With "lsof .lock" you could check what program holds that file open. If that lists nothing, dig through "ps axu" (as root) and look for a bitcoin related program. Kill it and voila.

Bounty: Earn up to 68.7 BTC
Like my post? Feel free to drop a tip to 1BitskyZbfR4irjyXDaGAM2wYKQknwX36Y
Bert
Full Member
***
Offline Offline

Activity: 126



View Profile
August 17, 2011, 04:23:11 PM
 #6

I would check for bitcoin or bitcoind, at a guess one of them was running while you deleted the folder. And it is probably still running.
ps -ef | grep bitcoin

Tip jar: 1BW6kXgUjGrFTqEpyP8LpVEPQDLTkbATZ6
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!