Bitcoin Forum
May 09, 2024, 07:07:14 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Ubuntu: cannot remove .bitcoin directory  (Read 2056 times)
AntiGoogle (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


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

1715238434
Hero Member
*
Offline Offline

Posts: 1715238434

View Profile Personal Message (Offline)

Ignore
1715238434
Reply with quote  #2

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

Posts: 1715238434

View Profile Personal Message (Offline)

Ignore
1715238434
Reply with quote  #2

1715238434
Report to moderator
1715238434
Hero Member
*
Offline Offline

Posts: 1715238434

View Profile Personal Message (Offline)

Ignore
1715238434
Reply with quote  #2

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

Activity: 576
Merit: 514


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
Merit: 100



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 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


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: 576
Merit: 514


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
Merit: 100



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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!