# mount, fdisk and how-to?



## Anonymous (Apr 16, 2010)

I wanted to mount my linux-partition. That was not so easy. I ran:

```
freebsd-2# fdisk -p
# /dev/ad0
g c77622 h16 s63
p 1 0xa5 63 41367249
a 1
p 4 0x05 41367375 36869175
```
and:

```
freebsd-2# fdisk -s
/dev/ad0: 77622 cyl 16 hd 63 sec
Part        Start        Size Type Flags
   1:          63    41367249 0xa5 0x80
   4:    41367375    36869175 0x05 0x00
```
and:

```
freebsd-2# mount
/dev/ad0s1a on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
linprocfs on /usr/compat/linux/proc (linprocfs, local)
```

So i tried: 

```
freebsd-2# mount -t ext2fs /dev/ad0s4a /media/backup
mount: /dev/ad0s4a : No such file or directory
```
which didn't work (of course).


```
freebsd-2# ls /dev | grep ad
ad0
ad0s1
ad0s1a
ad0s1b
ad0s4
ad0s5
```
I have assumed it must be /dev/ad0s5 then,which was correct. 

```
freebsd-2# mount -t ext2fs /dev/ad0s5 /media/backup
freebsd-2#
```
My question:
But how could i figure out the name of the device which i want to mount with a command?

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/mount-unmount.html
leads to
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/disks-naming.html
but i couldn't figure out what i want to know.


----------



## Beastie (Apr 16, 2010)

*Method 1*. Like the first command you used, simply using `% fdisk` (followed by the appropriate device if it's not the default one) will list all the available slices/BIOS partitions and show the filesystem in which they were formatted. For example, let's suppose you have two ATA disks. `% fdisk ad1` will return

```
The data for partition 2 is:
sysid 7 (0x07),(NTFS, OS/2 HPFS, QNX-2 (16 bit) or Advanced UNIX)
```
It means /dev/ad1s2 is a Windows partition formatted in NTFS.

*Method 2*. If it's your machine, then you already know exactly where (i.e. on which slice) you installed FreeBSD, GNU/Linux, Windows, etc., or where that slice you made for your music is, etc.
/dev/ad0s5 in your case shows it's the first logical partition of an extended partition, something you show already know.
It's all quite straightforward.


P.S.: you should have more than just a root partition for FreeBSD. Check the handbook chapter 2, section 2.6.5.


----------



## Anonymous (Apr 17, 2010)

That doesn't look that obvious to me, but it might be i will understand it later. I may mount the partition and thats good.
I added grub to FreeBSD, but it doesn't boot Debian. The entry in /boot/grub/menu.lst looks like this:

```
# Boot Debian-Backup
title Debian-Backup
root (hd0,4)
kernel /boot/vmlinuz-2.6.32-mt-0 ro root=/dev/hda5
initrd /boot/initrd.img-2.6.32-mt-09
makeactive
savedefault
```
I changed the entries in the root and the kernel line, but i end with a grub-error-2.


----------



## sossego (Apr 18, 2010)

What's the grub entry for FreeBSD?


----------



## Anonymous (Apr 18, 2010)

sossego said:
			
		

> What's the grub entry for FreeBSD?


Here it is:

```
# Boot FreeBSD
title FreeBSD 8
root (hd0,0,a)
kernel /boot/loader  # specify the kernel or kernel loader
makeactive
savedefault
```


----------



## sossego (Apr 18, 2010)

Look at chapter 9 of the handbook and also the PC-BSD wiki for some information on configuring grub.


----------



## Anonymous (Apr 18, 2010)

I already looked at chapter 12 of the handbook (chapter 9 is about printing). I also searched the web. As said i tried different edits of the Debian-entry.
As nothing of that did help i posted here.


----------



## sossego (Apr 18, 2010)

My bad, I'm a bit tired.
You could try it quick and dirty by looking for an actual boot entry or by seeing what the maintainers did.

Actually, I take that back.
Go to the web interface for the ports and read the information there.
Search for grub. All the changes can also be seen.


----------



## Anonymous (Apr 19, 2010)

The thread is not solved, and i didn't set it as solved. 
The question is still why the entry of above doesn't boot the Debian backup on /dev/hda0 or /dev/ad0s0. 
For now i added grub to the Debian-backup, which is a workaround.


----------



## Anonymous (Apr 19, 2010)

/dev/hda5 or /dev/ad0s5, i can't edit my posts.


----------



## sossego (Apr 19, 2010)

The first is a Linux entry in the device table.
The second is a FreeBSD entry in the device table.

Use the info page for setup and examples.

Did you run this command:

```
# sysctl kern.geom.debugflags=16
kern.geom.debugflags: 0 -> 16
#
```
 ?


----------

