DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 16th May 2014
bsdnotbdsm bsdnotbdsm is offline
Port Guard
 
Join Date: Jan 2013
Posts: 26
Thanked 0 Times in 0 Posts
Default Got my ports tree deleted after attempting ports update

Hello,
The following happened on my FreeBSD 9.1 virtual machine which had the full ports tree in place under /usr/ports:
Code:
[root@virtbsd91 ~]# portsnap fetch && portsnap update && portmaster -ad                                                                                                                                                          
Looking up portsnap.FreeBSD.org mirrors... 7 mirrors found.                                                                                                                                                                      
Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... done.                                                                                                                                                           
Fetching snapshot metadata... done.                                                                                                                                                                                              
Updating from Mon May 12 14:22:54 CEST 2014 to Fri May 16 01:08:12 CEST 2014.                                                                                                                                                    
Fetching 4 metadata patches... done.                                                                                                                                                                                             
Applying metadata patches... done.                                                                                                                                                                                               
Fetching 0 metadata files... done.                                                                                                                                                                                               
Fetching 402 patches.....10....20....30....40....50....60....70....80....90....100....110....120....130....140....150....160....170....180....190....200....210....220....230....240....250....260....270....280....290....300....310....320....330....340....350....360....370....380....390....400. done.                                                                                                                                                       
Applying patches... done.                                                                                                                                                                                                        
Fetching 18 new ports or files... done.                                                                                                                                                                                          
Removing old files and directories... done.                                                                                                                                                                                      
Extracting new files:                                                                                                                                                                                                            
comm: /usr/ports/.portsnap.INDEX: No such file or directory                                                                                                                                                                      
/usr/sbin/portsnap: cannot create /usr/ports/.portsnap.INDEX: No such file or directory                                                                                                                                          
Building new INDEX files... /usr/sbin/portsnap: cannot create /usr/ports/INDEX-7: No such file or directory                                                                                                                      
[root@virtbsd91 ~]# 
[root@virtbsd91 ~]# 
[root@virtbsd91 ~]# portsnap fetch && portsnap update && portmaster -ad
Looking up portsnap.FreeBSD.org mirrors... 7 mirrors found.
Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... done.
Ports tree hasn't changed since last snapshot.
No updates needed.
/usr/ports was not created by portsnap.
You must run 'portsnap extract' before running 'portsnap update'.
[root@virtbsd91 ~]# ls /usr/    
bin/     games/   home/    include/ lib/     lib32/   libdata/ libexec/ local/   obj/     sbin/    share/   src/     
[root@virtbsd91 ~]# ls /usr/ports/
ls: /usr/ports/: No such file or directory
These are machine details:
[root@virtbsd91 ~]# uname -a
Code:
FreeBSD virtbsd91 9.1-RELEASE-p11 FreeBSD 9.1-RELEASE-p11 #0: Tue Apr  8 20:54:56 UTC 2014     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
Of course I did NOT delete ports tree myself:
Code:
[root@virtbsd91 ~]# history |grep rm |grep port |grep -v grep
[root@virtbsd91 ~]#
So, what happened with the ports tree?! How is it posible to be deleted during normal upgrade operation?! Needless to say, I never experienced such situation before.
Anyone experienced similar situation?

If yes, please reply. I'm trying to understand what went wrong there.

Regards.
Reply With Quote
  #2   (View Single Post)  
Old 16th May 2014
J65nko J65nko is online now
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,154
Thanked 182 Times in 149 Posts
Default

I think the solution can be found in these error messages that you got:
Code:
No updates needed.
/usr/ports was not created by portsnap.
You must run 'portsnap extract' before running 'portsnap update'.
An possible error could be caused by insufficient disk space. What is the ouput of # df -h?
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 18th May 2014
bsdnotbdsm bsdnotbdsm is offline
Port Guard
 
Join Date: Jan 2013
Posts: 26
Thanked 0 Times in 0 Posts
Default

Hello,
Thanks for the reply first of all.
All ended up well in the end.
Indeed "mkdir /usr/ports && cd /usr/ports && portsnap extract" fixed the issue.

Disk space is not a problem, this is the status after(!) extracting ports tree:
Code:
[root@virtbsd91 ~]# df -m
Filesystem    1M-blocks Used Avail Capacity  Mounted on
/dev/ada0p2        9905 5740  3372    63%    /
devfs                 0    0     0   100%    /dev

I think the main problem (root cause) was a / filesystem corruption I had 1 week ago, that prevented me to boot. I fixed it with fsck /dev/ada0p2 but without using journal. After fsck fix, system booted up, but it seems some index files required by portsnap were deleted.
With regards to the error messages that I've posted in the first post of this thread, this is the relevant section which seems to be the stopper for extracting the ports tree:
Code:
Extracting new files:
comm: /usr/ports/.portsnap.INDEX: No such file or directory
/usr/sbin/portsnap: cannot create /usr/ports/.portsnap.INDEX: No such file or directory
Anyway, after re-extracting the ports tree, all is OK like before. The database with installed packages was not affected, so I could just continue the ports update operation, like nothing happened.

And yes, again with regards to the errors, and as a final proof that a missing file was the issue, this is the current status:
Code:
[root@virtbsd91 ~]# ls -al /usr/ports/.portsnap.INDEX
-rw-r--r--  1 root  wheel  2107349 May 18 13:29 /usr/ports/.portsnap.INDEX
So: Problem solved!

Last edited by bsdnotbdsm; 18th May 2014 at 06:07 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenBSD ports tree now locked ocicat News 0 21st January 2011 03:30 PM
OpenBSD 4.8 ports tree locked! ocicat News 0 2nd August 2010 07:31 PM
Is my ports tree corrupt or sth? TerryP FreeBSD Ports and Packages 1 29th June 2010 09:51 PM
return of the -stable ports tree ocicat OpenBSD Packages and Ports 3 24th October 2009 04:11 AM
STABLE ports tree has returned.. BSDfan666 OpenBSD Packages and Ports 2 26th July 2009 07:36 PM


All times are GMT. The time now is 12:10 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick