145d1
![]() |
|
|
|
|
|||||||
| Storage Place to ask questions about partitioning, labelling, filesystems, encryption or anything else related to storage area. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I recently formatted my SSD to install ZFS on FreeBSD 9 after I ran through the setup on VirtualBox to make sure I knew how to do it. The install on VirtualBox worked fine, using the same guide I installed ZFS after reformatting my drive an it wouldn't boot, it kept telling me that it couldn't find any ZFS pool to boot from. Is there anything special I need to take into account when installing ZFS on a SSD?
|
|
#2
|
||||
|
||||
|
I use ZFS on SSD from more then a year, works like a charm, I never changed anything specially for SSD.
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#3
|
||||
|
||||
|
Be sure not to export the pool before rebooting.
__________________
Alberto Villa, FreeBSD committer <avilla@FreeBSD.org> http://people.FreeBSD.org/~avilla |
|
#4
|
|||
|
|||
|
Bear in mind that ZFS doesn't support TRIM yet as far as I'm concerned. This means you should better use an SSD with good background garbage collection, otherwise you'll experience performance degradation as time passes by.
This is what pjd (the man who ported ZFS to FreeBSD) had to say about this: http://permalink.gmane.org/gmane.os....aris.zfs/44978 |
|
#5
|
|||
|
|||
|
I can't boot to my zfs install, here is the error I'm getting
Code:
Gptzfsboot: error 1 lba 48 Gptzfsboot: error 1 lba 1 Gptzfsboot: no zfs pools located, can't boot |
|
#6
|
||||
|
||||
|
Was that drive partitioned as GPT?
|
|
#7
|
|||
|
|||
|
I format the drive and create the partitions as follows
Code:
dd if=/dev/zero of=/dev/ada0 gpart create -s gpt ada0 gpart add -b 34 -s 94 -t freebsd-boot ada0 gpart add -t freebsd-zfs -l disk0 ada0 gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0 |
|
#8
|
||||
|
||||
|
@kr651129
Maybe a slight modification to the boot partition, I think it looks a little small, and can start right from the beginning, without "-b". And I always set the first data partition aligned to start at 1MiB "-b 2048" and made to end aligned with 4k. # gpart destroy -F ada0# gpart add -t freebsd-boot -s 64k ada0# gpart add -t freebsd-zfs -b 2048 -a 4k -l disk0 ada0# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0Then there are some things you need to have done to make this work, so I typed them up, in case there is something you may have missed. Remember gnop when making the pool to get ashift=12 # gnop create -S 4096 /dev/gpt/disk0Save your zpool.cache somewhere writeable, if your´re making it from the bsdinstaller: # zpool create -O mountpoint=none -o cachefile=tmp/zpool.cache rpool gpt/disk0.nop# zfs create -o mountpoint=legacy rpool/root# zpool set bootfs=rpool/root rpool# zpool export rpool# gnop destroy /dev/gpt/disk0.nop# zpool import -o cachefile=/tmp/zpool.cache -d /dev/gpt rpoolCopy zpool.cache to /mnt/boot/zfs/. # mount -t zfs rpool/root /mnt# mkdir -p /mnt/boot/zfs# cp /tmp/zpool.cache /mnt/boot/zfs/And finish off by putting entries in fstab and loader.conf Code:
You can of course add filesystems according to your own liking. Just remember to handle their mounts, either with zfs mounting them, or with fstab. /Sebulon |
|
#9
|
||||
|
||||
|
With the data partition starting at 1M, might as well make the freebsd-boot partition as large as possible to avoid having to increase it later if the bootcode gets bigger. At present, that means 512K. Also, it won't hurt to make that partition 4K-aligned, starting at block 40. Probably won't help, either, but the extra space is unused anyway.
# gpart add -t freebsd-boot -b40 -s512k ada0For FreeBSD 9.1, and 9-stable now: # gpart add -t freebsd-boot -a4k -s512k ada0Code:
# gpart show ada0
=> 34 500118125 ada0 GPT (238G)
34 6 - free - (3.0k)
40 1024 1 freebsd-boot (512k)
1064 984 - free - (492k)
2048 ...
|
|
#10
|
||||
|
||||
|
I think that for a 4K alignment the freebsd-boot partition should be added like this:
# gpart add -b 34 -s 94 -t freebsd-boot adaXI haven't seen any changes since r230059 but of course I could be wrong.
__________________
Powered by BareBSD |
|
#11
|
|||
|
|||
|
I see no reason to specify -b for the boot partition, gpart(8) will use the next available sector automatically.
I do recall that there was some talk about -a and -b options conflicting, is that you are referring to? My take on that is that the -a option is a stronger requirement than -b. So if you say: # gpart add -t freebsd-boot -b 34 -a 4k -s 128k ada0This should always create a partition that starts from sector 40, the next sector after 34 that is divisible by 8. |
|
#12
|
||||
|
||||
|
-a rounds the start and size to even multiples of the value given. Up until a couple of months ago, the -b value was ignored if -a was used. The version of gpart(8) in 9-STABLE now and 9.1-RELEASE has that fixed.
With the fixed version, this command will do as you'd expect, creating a 4K-aligned partition starting a 1M: # gpart add -t freebsd-ufs -a4k -b 1m -s 20g ada0The earlier version of gpart(8) would create a 20g aligned partition, but it would start at the next available aligned block. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|