# Can't boot FreeBSD after installing NetBSD



## pkubaj (Jun 6, 2011)

I installed NetBSD to compare it with FreeBSD and see what's better for me, but I've decided to keep using FreeBSD. The problem is that I can't FreeBSD now (I didn't erase my HDD). It seems not be able to read /tmp, /usr and /var. It just reports that there is "an unexpected inconsistency". On /usr it can't read block 128. After I run *fsck* (which was suggested) it throws that / is OK, but there are following errors in /tmp:

```
Cannot find file system superblock
ioctl (GCINFO): Inappriopriate ioctl for device
fsck_ufs: /dev/ad12s4e: can't read disk label
```
I'm not sure if it's important, but NetBSD overwrote GRUB2 (which I had used before). Since erasing NetBSD, I have come back to GRUB2.
EDIT: /dev/ad12s4e is my /tmp partition.


----------



## Beeblebrox (Jun 7, 2011)

1. Grub has finished its job once it has passed controll to kernel.  If your kernel is booting, it's not a grub issue.
2. If your root is mounting, but not the other partitions, it's probably a simple problem. After you *fsck* /usr and /var can you mount them from command line?


----------



## pkubaj (Jun 7, 2011)

No, there's an error:

```
g_vfs_done():ad12s4f[READ(offset=65536, length=8192)]error = 5
mount: ad12s4f : Input/output error
```
The same applies to /var.


----------



## da1 (Jun 7, 2011)

Hmm, that looks bad to me. Is your hdd ok?

PS: Just noticed you have a "cannot read disk label" err msg; nasty.


----------



## pkubaj (Jun 7, 2011)

Well, it was OK before. It seems to be OK now as well, since Windows and Linux work flawlessly. FreeBSD is the only troublemaker


----------



## sossego (Jun 7, 2011)

Look at http://forums.freebsd.org/showthread.php?t=15294 . I found this to be the best way to boot Net or Open BSD with  FreeBSD.


----------



## roddierod (Jun 7, 2011)

You didn't happen to try and share /var /tmp and /usr between Net and Free?


----------



## pkubaj (Jun 7, 2011)

@sossego
I've already erased NetBSD. FreeBSD is the only *BSD I have now.

@roddierod
Nope.


----------



## Beeblebrox (Jun 8, 2011)

That's a nasty message.

Contents of /tmp are completely erasable, the system will not care at all.  You could even use tempfs here and mount  "/tmp  tmpfs", thereby placing the contents in memory/swap - for desktops this setup speeds the system up even.

For the disk error I suggest you try something different: boot into single user, change your fstab to comment out /tmp. Then newfs the slice and see if it is mountable anywhere after the newfs.  If not mountable or similar errors, delete the slice (gpart destroy), re-create a slice and try to mount it anywhere after you newfs the newly created slice.


----------



## pkubaj (Jun 8, 2011)

Beeblebrox said:
			
		

> That's a nasty message.
> 
> Contents of /tmp are completely erasable, the system will not care at all.  You could even use tempfs here and mount  "/tmp  tmpfs", thereby placing the contents in memory/swap - for desktops this setup speeds the system up even.
> 
> For the disk error I suggest you try something different: boot into single user, change your fstab to comment out /tmp. Then newfs the slice and see if it is mountable anywhere after the newfs.  If not mountable or similar errors, delete the slice (gpart destroy), re-create a slice and try to mount it anywhere after you newfs the newly created slice.



I can't edit /etc/fstab as I don't have access to any text editor. Both vi and ee are on /usr which I can't mount. And I'd rather not delete it, since I have some data on it + I compile everything from ports and compiling things like LibreOffice or KDE takes a lot of time.


----------



## DutchDaemon (Jun 8, 2011)

/rescue/vi not available?


----------



## pkubaj (Jun 9, 2011)

DutchDaemon said:
			
		

> /rescue/vi not available?



Oh, I didn't even know FreeBSD had such a folder in case of emergency. Too much Linux I guess.

I *newfs*ed all the partitions besides / and put /tmp to RAM. What's really strange is that they seem to have changed IDs. After going to /dev I saw some new partitions. When I did *gpart show ad12s4* it showed four partitions of which one I certainly didn't create and also one has disappeared. Swap is much smaller than before. I think I could've deleted the wrong slice when deleting NetBSD. Is it possible that the additional partition (which is listed as freebsd-ufs) is in fact NetBSD partition, which FreeBSD can't recognize?


----------



## Beeblebrox (Jun 9, 2011)

You probably know about it, but if you have a 64 bit system and > 1G ram I would suggest you look into zfs - so much easier than fiddleing with partitions. Additionally, it provides snapshots, error checking and a whole whole lot more.  You could start by placing your /home (or wherever you keep your personal docs) folder on zfs and then share the partition with your linux system through zfs-fuse (or dajhorn).  zfs is the best solution to provide decent read/write support to both the BSD and linux sides.
DK on NetBSD


----------



## roddierod (Jun 9, 2011)

pkubaj said:
			
		

> Is it possible that the additional partition (which is listed as freebsd-ufs) is in fact NetBSD partition, which FreeBSD can't recognize?



This is why I asked if you attempted to share partitions between the two. Although both filesystem are UFS the implementation are different and they are not compatible with each other. In that, they can not natively read each other partitions, which is what your errors suggested to me.


----------



## pkubaj (Jun 9, 2011)

roddierod said:
			
		

> This is why I asked if you attempted to share partitions between the two. Although both filesystem are UFS the implementation are different and they are not compatible with each other. In that, they can not natively read each other partitions, which is what your errors suggested to me.



I believe I didn't, but anyway I'll reinstall. I'll be off for the whole weekend now, so I'll just write some simple script to compile everything I use, and when I'm back, it will be ready. 



			
				Beeblebrox said:
			
		

> You probably know about it, but if you have a 64 bit system and > 1G ram I would suggest you look into zfs - so much easier than fiddleing with partitions. Additionally, it provides snapshots, error checking and a whole whole lot more.  You could start by placing your /home (or wherever you keep your personal docs) folder on zfs and then share the partition with your linux system through zfs-fuse (or dajhorn).  zfs is the best solution to provide decent read/write support to both the BSD and linux sides.
> DK on NetBSD



I've read that UFS is faster and more stable than ZFS, which is why I haven't switched yet. Is that true? If not, I'll just reinstall with everything on ZFS.


----------



## pkubaj (Jun 9, 2011)

http://www.phoronix.com/scan.php?page=article&item=zfs_ext4_btrfs&num=1
OK, I'm conviced that ZFS is in fact faster than UFS 
I think this may be EOT. Thanks everyone!


----------



## wblock@ (Jun 9, 2011)

pkubaj said:
			
		

> I believe I didn't, but anyway I'll reinstall. I'll be off for the whole weekend now, so I'll just write some simple script to compile everything I use, and when I'm back, it will be ready.



That's trickier than it seems.  ports-mgmt/portmaster has it documented:
`% man portmaster | less -p reinstallation`


----------

