UFS shrink partition size on UFS (clone to smaller ssd)

rjohn

Member

Reaction score: 6
Messages: 71

Hello,

Is there a way to shrink a partition on a UFS filesystem? I want to make my freebsd-ufs 100 GB instead of 108 GB that is now and the rest 8 go to - free -
Code:
freebsd# gpart show
=>       63  312581745  ada0  MBR  (149G)
         63       1985        - free -  (993K)
       2048  234442752     1  freebsd  [active]  (112G)
  234444800   78137008        - free -  (37G)

=>        0  234442752  ada0s1  BSD  (112G)
          0  226492416       1  freebsd-ufs  (108G)
  226492416    7949166       2  freebsd-swap  (3.8G)
  234441582       1170          - free -  (585K)
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,371
Messages: 29,907

is there a way to shrink a partition on a UFS filesystem
Short and simple answer, no. You will have to backup the data, remove the old partition, create a new, smaller one and restore data from backup.
 
OP
OP
rjohn

rjohn

Member

Reaction score: 6
Messages: 71

my final goal is to clone this hard disk to a smaller SSD using a 3rd party software like acronis/ghost,though this will be an easy way to get rid of the extra size partition.

what do you suggest as an easier solution for this ?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,371
Messages: 29,907

what do you suggest as an easier solution for this ?
Do a fresh install on the new SSD and copy any data you need from the old one.
 
OP
OP
rjohn

rjohn

Member

Reaction score: 6
Messages: 71

will this transfer all my settings and installed programs ?
using CP command?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,371
Messages: 29,907

will this transfer all my settings and installed programs ?
No, it will not. Just make a list of things that are installed and install those fresh too. Then look at any configuration files that may need changing. If you've done this often enough it's typically quicker than trying to clone a disk.

By "data" I mean actual data, like the documents in your home directory for example.
 
Top