resize partition

After installation FreeBSD 8.0 on server our hoster forget make /tmp partition, and we haven't noticed about it. But now we want /tmp as suspect.

I try to use gpart but without success. I do follow. On server exists /home partition about 500GB, so i whnat to extent /tmp from /home.

At initial state:
Code:
freebsd# gpart show
=>        32  1171743776  da0  MBR  (559G)
          32  1171743328    1  freebsd  [active]  (559G)
  1171743360         448       - free -  (224K)

=>         0  1171743328  da0s1  BSD  (559G)
           0     2097152      1  freebsd-ufs  (1.0G)
     2097152    41943040      4  freebsd-ufs  (20G)
    44040192    83886080      5  freebsd-ufs  (40G)
   127926272     8388608      2  freebsd-swap  (4.0G)
   136314880  1035428448      6  freebsd-ufs  (494G)            <---- /home


so i do follow, backup /home on other server, then umount /home

Code:
freebsd# umount /home

then i delete home:

Code:
freebsd# gpart -i 6 da0s1
freebsd# gpart show
=>        32  1171743776  da0  MBR  (559G)
          32  1171743328    1  freebsd  [active]  (559G)
  1171743360         448       - free -  (224K)

=>         0  1171743328  da0s1  BSD  (559G)
           0     2097152      1  freebsd-ufs  (1.0G)
     2097152    41943040      4  freebsd-ufs  (20G)
    44040192    83886080      5  freebsd-ufs  (40G)
   127926272     8388608      2  freebsd-swap  (4.0G)
   136314880  1035428448      6  - free -  (494G)

then i add 2 partitons:
Code:
freebsd# gpart add -s 8388608 -t freebsd-ufs da0s1
added da0s1f

freebsd# gpart add -t freebsd-ufs da0s1
added da0s1g
now my partition looks like:
Code:
freebsd# gpart show 
=>        32  1171743776  da0  MBR  (559G)
          32  1171743328    1  freebsd  [active]  (559G)
  1171743360         448       - free -  (224K)

=>         0  1171743328  da0s1  BSD  (559G)
           0     2097152      1  freebsd-ufs  (1.0G)
     2097152    41943040      4  freebsd-ufs  (20G)
    44040192    83886080      5  freebsd-ufs  (40G)
   127926272     8388608      2  freebsd-swap  (4.0G)
   136314880     8388608      6  freebsd-ufs  (4G)
   144703488  1027039840      7  freebsd-ufs  (490G)


And finally I try to mount new partition:

Code:
freebsd# mount /dev/da0s1g /home

And got error invalid argument

Why this happens? And how to resize partition on working system?
 
Please use "#" symbol, to do it like this:
Code:
At initial state:
freebsd# gpart show
=> 32 1171743776 da0 MBR (559G)
32 1171743328 1 freebsd [active] (559G)
1171743360 448 - free - (224K)

=> 0 1171743328 da0s1 BSD (559G)
0 2097152 1 freebsd-ufs (1.0G)
2097152 41943040 4 freebsd-ufs (20G)
44040192 83886080 5 freebsd-ufs (40G)
127926272 8388608 2 freebsd-swap (4.0G)
136314880 1035428448 6 freebsd-ufs (494G) <---- /home
Will be easier to read it :D
And how to resize partition on working system?
Is not actually resize of partition but could do the job.
Take for example that /home is full . You could copy /home to /usr, remove /home from / and make ln -s of /usr/home on /
 
tantra35 said:
then i add 2 partitons:
Code:
freebsd# gpart add -s 8388608 -t freebsd-ufs da0s1
added da0s1f

freebsd# gpart add -t freebsd-ufs da0s1
added da0s1g

now my partition looks like:
Code:
freebsd# gpart show 
=>        32  1171743776  da0  MBR  (559G)
          32  1171743328    1  freebsd  [active]  (559G)
  1171743360         448       - free -  (224K)

=>         0  1171743328  da0s1  BSD  (559G)
           0     2097152      1  freebsd-ufs  (1.0G)
     2097152    41943040      4  freebsd-ufs  (20G)
    44040192    83886080      5  freebsd-ufs  (40G)
   127926272     8388608      2  freebsd-swap  (4.0G)
   136314880     8388608      6  freebsd-ufs  (4G)
   144703488  1027039840      7  freebsd-ufs  (490G)

And finally I try to mount new partition:
Code:
freebsd# mount /dev/da0s1g /home
And got error invalid argumet

Why this happens? And how to resize partition on working system?

First, expect DD to be along to remind you to use proper formatting. I've added 'code' tags above.

Anyway, did you remember to newfs(8) the added partitions? Reallocating space does not adjust the filesystems.
 
Back
Top