Solved format ext4 empty partition to ufs slice

userxbw

Well-Known Member

Reaction score: 29
Messages: 294

what is the proper way to change a linux partition into a Fbsd slice?

I have a 500GB sdd in two partitions, the larger one is being used, whereas the 64GB is not, and I'm thinking of making it into a UFS filesystem to use with FBSD.
Code:
#  gpart show
=>       63  976773105  ada0  MBR  (466G)
         63         63        - free -  (32K)
        126  135030658     1  linux-data  [active]  (64G)
  135030784  841742336     2  linux-data  (401G)
  976773120         48        - free -  (24K)
would this be the proper way following this guild line?
I'm asking because I do not want to screw up these partitons and lose everything on that drive.
Code:
# SCSI / USB platters
# dev name da0
# (S)ATA platters
# dev name ad0
#
# WIPE THE PARTITION
gpart destroy -F da0

# CREATE GPT style SLICE (partition)
gpart create -s gpt da0

# CREATE FFS SLICE (filling entire platter)
gpart add -t freebsd-ufs da0

# FORMAT THE NEW FFS SLICE
newfs -U /dev/da0p1
commands
Code:
gpart destroy -F ada0s1
gpart create -s gpt ada0s1
gpart add -t freebsd-ufs ada0s1
newfs -U /dev/ada0s1
if not then a little help please.
 

Phishfry

Son of Beastie

Reaction score: 1,524
Messages: 4,429

what is the proper way to change a linux partition into a Fbsd slice?
These commands you show are not correct.
gpart destroy -F ada0s1
gpart create -s gpt ada0s1
MBR uses slices.
GPT does not.
So no need to do anything with the MBR scheme.
Just work on the disk partition that you want to change.

You commands should look something like this:
gpart create -s bsd ada0s1
gpart add -t freebsd-ufs ada0s1
newfs -U /dev/ada0s1a
Use at your own risk!
If this don't work you may need to destroy ada0s1 with linux-data showing.
I am concerned that it is showing partiton 1 as Active. This means bootable. Make sure you have the right partitions.
Using gpart show -p ada0 shows the partition name and not just the index number.
Warrens page has everything you could ever need.
 

roccobaroccoSC

Aspiring Daemon

Reaction score: 145
Messages: 600

I am concerned that it is showing partiton 1 as Active. This means bootable. Make sure you have the right partitions.
Good point! It may well be that an operating system is booting from this partition.
What the OP probably wants to do is to keep a data partition but replace the OS with FreeBSD. Just a speculation.

In such a case I would read the docu about MBR boot on FreeBSD, for example here: https://daemon-notes.com/articles/system/install-ufs/gpart-mbr
 
OP
OP
userxbw

userxbw

Well-Known Member

Reaction score: 29
Messages: 294

Code:
$  gpart show -p ada0
=>       63  976773105    ada0  MBR  (466G)
         63         63          - free -  (32K)
        126  135030658  ada0s1  linux-data  [active]  (64G)
  135030784  841742336  ada0s2  linux-data  (401G)
  976773120         48          - free -  (24K)
It is a spare drive, this is a HP EliteBook 840 G2
w/PCIe slot and when I put one in that it swaps the drives around, where I'd think it should be the primary drive a, it stays the secondary drive b, and that is the one I use to boot OS'es from. it shows up dev/sdb in Linux and ada1 Fbsd
Code:
$ ls /dev/ada1*
/dev/ada1    /dev/ada1s2  /dev/ada1s3a /dev/ada1s4  /dev/ada1s6
/dev/ada1s1  /dev/ada1s3  /dev/ada1s3b /dev/ada1s5
that is my boot stick (drive) I have my OSes on.

/dev/sda or /dev/ada0 is my storage drive so yes it is what one might call 'backwards' to the way most others run there systems. I put my OSes on the lesser sized drive, and am using the bigger drive for share storage space.

I left that space "blank" so I could give myself a bit of room to have to install another OS if I wanted to, but every other *BSD I've burned to a stick fails, so screw it.

Instead of merging it into the enter drive, I thought I'd change it to UFS and give it to freeBSD exclusively for storage.

Yeah I made it bootable because it was space for another OS, I've already ran through enoiugh Linux and keep going back to SLackwARE, so I got WIN10, SLACKWARE,AND FREEbsd on the PCIe stick, and the other (500GB) sdd is storage space.

In Linux I could just format that into a different format, is that the same for FreeBSD?
or do I got to destroy it and recreate it then formate it?

maybe go back into Linux delete that partiton anf leave it then go into FreeBSd and see what it says, and yes remove the boot flag too.
##################### BACK####################
Code:
$ gpart show -p  ada0
=>       63  976773105    ada0  MBR  (466G)
         63  135030721          - free -  (64G)
  135030784  841742336  ada0s2  linux-data  (401G)
  976773120         48          - free -  (24K)
Code:
$ ls /dev/ada0*
/dev/ada0   /dev/ada0s2
so it show might be,
Code:
gpart create -s bsd ada0s1
gpart add -t freebsd-ufs ada0s1
newfs -U /dev/ada0s1a
but why a and not just
Code:
newfs -U /dev/ada0s1
because the second partition/slice is named ada0s2 not s2b. because it is taking up the whole space, unlike on the PCIe stick where it only had one part to use for a few slices OS and swap on install, so it named it
Code:
$ ls /dev/ada1s3*
/dev/ada1s3  /dev/ada1s3a /dev/ada1s3b
where ada1s3 is the entire slice and the 3a and 3b are the OS and swap parts within the entire slice.
 
OP
OP
userxbw

userxbw

Well-Known Member

Reaction score: 29
Messages: 294

screw it, it's being a pain in my butt, not a big enough deal to shut down the gov to get it to do that.
 

roccobaroccoSC

Aspiring Daemon

Reaction score: 145
Messages: 600

For the changing device names there is an easy fix! Do not use them. Put labels on your partitions in FreeBSD (look here: https://daemon-notes.com/articles/system/part-fs/mbr ) and then you can use them by name (/dev/label/...)
If you used GPT instead of MBR, you could address them by gptid. I think there are other options, for example - Disk ID. But I don't know which ones are specific for GPT and which ones work for MBR too. Look into the man page.

Under Linux you could use similar addressing schemes - not by device name but by guid, label or disk id. When you do that, the devices will be properly addressed, no matter how you swap them. You could even put them in a different machine - no problem.
 
OP
OP
userxbw

userxbw

Well-Known Member

Reaction score: 29
Messages: 294

yeah it was the first part, and gpart kept looking at the tail end and showing no room of course, so I'll out this in the maybe late pile of things to do.
 
Top