I have moved swap to its own partition using this commands:

... it turned out, that having swap as a plane file in /usr was
not a good decission, we deleted (after making DUMPS) the 'ssdusrfs'
again, created swap and re-created 'ssdusrfs'; this must be done while
/dev/gpt/ssdusrfs is not mounted!

# gpart show -l ada0
=>       40  488397088  ada0  GPT  (233G)
         40       1024     1  ssdboot  (512K)
       1064        984        - free -  (492K)
       2048    4194304     2  ssdrootfs  (2.0G)
    4196352    4194304     3  ssdvarfs  (2.0G)
    8390656  480006144     4  ssdusrfs  (229G)
  488396800        328        - free -  (164K)

be carefully with the correct number of the index, in our case 4; check
the output of 'gpart show -l ada0' before doing this:

# gpart delete -i 4 ada0

create the swap partition:

# gpart add -t freebsd-swap -l ssdswap -a 1m -s 8g ada0

and the rest is our 'ssdusrfs' again:

# gpart add -t freebsd-ufs -l ssdusrfs -a 1m ada0
# newfs -U -t /dev/gpt/ssdusrfs

the new /etc/fstab should look like this:

# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/gpt/ssdswap        none            swap    sw              0       0
/dev/gpt/ssdrootfs      /               ufs     rw      1       1
/dev/gpt/ssdvarfs       /var            ufs     rw      2       2
tmpfs                   /tmp            tmpfs   rw,mode=01777   0       0
/dev/gpt/ssdusrfs       /usr            ufs     rw      2       2

we need gzip and some shared libs (which normaly are in /usr); I copied
them on some other system into the externals disk where the DUMP is:

# cp -p /usr/bin/gzip /usr/lib/liblzma.so.5 /usr/lib/libbz2.so.4 /mnt

now mount and restore the DUMP:

# mount tmpfs
# mount /usr
# cd /usr
# mount -o ro /dev/da0s2a /mnt

# gzip -dc /mnt/e6330/dumpse6330-20160726/usr.dmp.gz | restore -x -f -
# umount /mnt
# reboot

Matthias Apitz, ✉ g...@unixarea.de, ⌂ http://www.unixarea.de/  ☎ 
"Wer übersieht, dass wir uns den anderen weggenommen haben und sie uns 
wiederhaben wollen,
kann von den Kämpfen der letzten Tage keinen verstehen. Und kann natürlich auch 
dieser Kämpfe bestehen." Hermann Kant in jW 1.10.1989
freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to