# Extracting installation images in root?



## justinnoor (Dec 13, 2018)

A USB installation drive was created for *Freebsd-12.0-release-memstick.img. *The compressed *img.xz *file was downloaded via a browser from an Ubuntu Linux machine. It was then extracted with `$ xz -dk Freebsd-12.0-memstick.img.xz`

Should the *img.xz *file have been extracted in root?


----------



## ShelLuser (Dec 13, 2018)

Why did you extract it in the first place? I hardly bother with memory sticks myself, but iirc a common procedure is to use dd to dump the image onto the memory stick.

Even so; I don't see how root privileges would have made a difference. It most certainly won't matter for the FreeBSD session because you'd be root anyway. At the least it might be better for cosmetic purposes (root:wheel might look cleaner) but that's all there is to it.


----------



## justinnoor (Dec 13, 2018)

Thank you. The *img.xz* is the compressed image, correct? I’m under the impression that it is, therefore, I’m also assuming it needs to be decompressed, hence the extraction. I opted for this image because I downloaded it from a browser. The full size image may have taken too long.


----------



## Deleted member 30996 (Dec 13, 2018)

ShelLuser said:


> Why did you extract it in the first place? I hardly bother with memory sticks myself, but iirc a common procedure is to use dd to dump the image onto the memory stick.



I prefer the .img format because I can use the same stick over and over. After I `cd` to the same directory as the .img file I use this command for my FreeBSD machines:


```
# dd bs=1m if=FreeBSD-12.0-RELEASE-amd64-memstick.img of=/dev/da0 conv=sync
```

You'll need to set the correct designation for your Linux disk labeling scheme and make sure the stick is not mounted when you run `dd` on the stick.


----------



## SirDice (Dec 13, 2018)

justinnoor said:


> Should the *img.xz *file have been extracted with  sudo privileges?


I'm wondering why you think it's needed.


----------



## justinnoor (Dec 13, 2018)

SirDice said:


> I'm wondering why you think it's needed.



The other day I installed Arch Linux on a Raspberry Pi and the image extraction had to be done in root per the instructions. Now I’m paranoid hah.

Anyway the 12.0 rel installation went fine and I’m very much enjoying it. Thanks 

https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-3


----------



## SirDice (Dec 13, 2018)

Ah, right. There's a big difference here though. That Arch Linux file isn't an "image" file, it's basically a file structure you need to use to overwrite the existing install, as some of those files need to be root owned you have to extract them as root. In the FreeBSD IMG case it's just a file you extract. Actually 'burning' that image file to a stick or CD does require root privileges.


----------



## justinnoor (Dec 13, 2018)

SirDice said:


> It’s (Arch Linux) is basically a file structure you need to use to overwrite the existing install, as some of those files need to be root owned. In the FreeBSD IMG case it's just a file you extract. Actually 'burning' that image file to a stick or CD does require root privileges.



Got it. That makes sense.

Yes on the actual flash process I used `# dd if=Freebsd-12.0 of=/dev/sdx bs=1M conv=sync`


----------

