# Sysinstall partition 2 drives



## Stamps (May 12, 2009)

Hi a have old laptop so i want to run freebsd server on it without X. For experimental purpuses. I do everything remotely over putty.

Here is something i cant figure out.

I have 2 drives. 1GB on Compact flash hard attached to ide adapter and 2 GB usb key.

Sysinstall detects them both and i can partition them and put labels on them. But i would like to have /usr on usb key. and everything else / on CF card.

I manage to do everything right so i have this structure before actual install:

On CF card:
/
swap
On Usb key:
/usr

But then firs just after install begins i get /usr mounting error and everything gets installed on CF card.

The problem is if i use minimal install there is enough space but if i put ports on it CF is too small. So i would like to have /usr on usb key.

Any idea what i am doing wrong?


----------



## Stamps (May 13, 2009)

I did a bit of googling. So my question is this even posible?

To have / root on one partition on slice 1 and /usr in another partition on slice 2?


----------



## tangram (May 13, 2009)

Have a look at http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html, especially 9.1 and 9.2 if you want to change stuff post install.

Regarding the sysinstall, if it recognizes the drives in the Select Drive for FDisk stage I'm sure you can mess around at ease as described in http://www.freebsd.org/doc/en/books/handbook/install-steps.html.


----------



## Stamps (May 13, 2009)

I to directory structure like this:

http://www.freebsd.org/doc/en/books/handbook/install/disklabel-auto.png

On 1GB CF card attached to ide adapter i have this:

/      (512Mb)
swap   (256Mb)
/var   (256mb)

On usb key 2GB attached to USB port i have this:

/tmp   (250B)
/usr   (1750MB)

so the structure loks like this:

ad0s1a /      (512Mb)
ad0s1b swap   (256Mb)
ad0s1d /var   (256mb)
da0s1d /tmp   (250B)
da0s1e /usr   (1750MB)

Then if i proceed with install or press W button to save information this command starts:

Doing newfs -U -02 /mnt/dev ...

But this is the resoult:

Error mounting /mnt/dev/da0s1d on /mnt/tmp :invalid argument

And the same for da0s1e. So what could be the problem? Usb key can't work this way? Should i use Custom Newfs?...

After reboot if i go into labeling i get something like this:

ad0s1a *      (512Mb)
ad0s1b swap   (256Mb)
ad0s1d *      (256mb)
da0s1d *      (250B)
da0s1e *      (1750MB)

I can use M and mount it to right points but after W to save or install i get same as the above. 

Error mounting .... :invalid argument


----------



## DutchDaemon (May 13, 2009)

What filesystem is on the USB key _now_? Have you tried formatting it to UFS first?


----------



## Stamps (May 13, 2009)

I did a minimal install now on CF and tried to format USB key to UFS manually. 

This is what i did:

fdisk -BI /dev/da0
bsdlabel -B -w da0s1
newfs -U -L testUSB /dev/da0s1a

And this is the resoult:


```
/dev/da0s1a: 1961.0MB (4016168 sectors) block size 16384, fragment size 2048
        using 11 cylinder groups of 183.77MB, 11761 blks, 23552 inodes.
        with soft updates
super-block backups (for fsck -b #) at:
 160, 376512, 752864, 1129216, 1505568, 1881920, 2258272, 2634624, 3010976, 3387328, 3763680
cg 0: [B]bad magic number[/B]
```

bad magic number? :\

I tried -O1 -O2 switches but it is the same.

Maybee USB key just isn't meant to be used for freebsd "HDD"?


----------



## phoenix (May 13, 2009)

Using USB flash drives for harddrives in FreeBSD works just fine.  I do this on my home computer (/ and /usr on USB, everything else on ZFS using the 3 SATA harddrives).  I also do this on a backup storage server at work (2x 2 GB USB in RAID1 using gmirror for / and /usr, with everything else on ZFS).

Sounds like your USB stick is dead or dying, though.

Try formatting it with FAT (use newfs_msdos(8) instead of newfs(8)) to make sure it can be formatted.  Then try formatting it back to UFS.

If that works, you can use it, but keep an eye on the logs to make sure it doesn't start to crap out.  If that doesn't work, then most likely it's toast.


----------



## Stamps (May 14, 2009)

I test the usb key on windows machine and doesn't look like it's corrupted in any way.

I found this:

http://www.nabble.com/FreeBSD-USB-Install-td21331602.html

And this:

http://typo.submonkey.net/articles/2006/04/13/installing-freebsd-on-usb-stick-episode-2

I am trying now with different thing from this two articles.

I hope it will work in the end. If not then i will just have to get bigger flash drive when prices go down a bit maybee some cheap SSD drive.

I will report if i manage to make it work.


----------



## Stamps (May 15, 2009)

This is beyond my scope. Maybe is hardware thing maybe i didn't do something right but i lost patience and went and bought 8GB CF card so i don't have this problem with not enough space and anymore it works fine now.

But thanks for all answers.


----------

