How to grow up file systems and...

I used your table, switched the disks and it seems to be almost all right.
The only strange thing is that now is not able to start up vnc.
I checked the log file and it seems that it can't write on /tmp...
I tried to create a directory from user Lorenzo and the system give me Permission denied.

What could be happened?

Anyway I have the dump on my NAS so I'll go on re-partitioning the second (small) drive.

Thanks!
 
Sorry man but I have another question.
If I do df -h the output is:
Code:
# df -h
Filesystem           Size    Used   Avail Capacity  Mounted on
/dev/gpt/gprootfs    1.9G    311M    1.5G    17%    /
devfs                1.0K    1.0K      0B   100%    /dev
/dev/gpt/gptmpfs      85G     14K     78G     0%    /tmp
/dev/gpt/gpusrfs      31G    4.6G     24G    16%    /usr
/dev/gpt/gpvarfs     7.7G    134M    7.0G     2%    /var

I can call # bsdlabel on ad4s1 and it shows
Code:
# bsdlabel ad4s1
# /dev/ad4s1:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:  2043904        0    4.2BSD        0     0     0
  b:  8073399  2043904      swap
  c: 41942817        0    unused        0     0         # "raw" part, don't edit
  d:  8019968 10117303    4.2BSD        0     0     0
  e:  2004992 18137271    4.2BSD        0     0     0
  f: 21800554 20142263    4.2BSD        0     0     0
#

Now, the ad4 disk is the old small one 'cause I switched the disks.

How can I check something about my current principal disk? Why in /dev I cannot find ad1s1 or something similar?


EDIT:
...and another one.
I'm trying to follow your guide for the second time to prepare the old small disk to the new partitions. But, correctly, when I try to do
# gpart create -s gpt /dev/ad4
the system gives me:
Code:
gpart: geom 'ad4': File exists

So, do I have to delete ad4?

Thanks.
 
hannibal80 said:
I used your table, switched the disks and it seems to be almost all right.
The only strange thing is that now is not able to start up vnc.
I checked the log file and it seems that it can't write on /tmp...
I tried to create a directory from user Lorenzo and the system give me Permission denied.

What could be happened?

Set the default rights on /tmp, something the installer normally does for you.

# chmod 1777 /tmp

(I think.)

Anyway I have the dump on my NAS so I'll go on re-partitioning the second (small) drive.

Thanks!

Maybe test the new drive for a little bit first?
 
hannibal80 said:
Sorry man but I have another question.
If I do df -h the output is:
Code:
# df -h
Filesystem           Size    Used   Avail Capacity  Mounted on
/dev/gpt/gprootfs    1.9G    311M    1.5G    17%    /
devfs                1.0K    1.0K      0B   100%    /dev
/dev/gpt/gptmpfs      85G     14K     78G     0%    /tmp
/dev/gpt/gpusrfs      31G    4.6G     24G    16%    /usr
/dev/gpt/gpvarfs     7.7G    134M    7.0G     2%    /var

Perfect. Well, /tmp is oddly large, but that was intentional.

How can I check something about my current principal disk? Why in /dev I cannot find ad1s1 or something similar?

Sorry, don't understand the question. The drives will both be in /dev, although they may not have the same drive numbers as before.

...and another one.
I'm trying to follow your guide for the second time to prepare the old small disk to the new partitions. But, correctly, when I try to do
# gpart create -s gpt /dev/ad4
the system gives me:
Code:
gpart: geom 'ad4': File exists

So, do I have to delete ad4?

Remember that doing things like this with both drives attached is dangerous. It is just way too easy to get them mixed up. That's another reason mfsBSD is great. You can boot from it with only the target drive attached, and there's no chance of wiping out the wrong disk.

Anyway, yes, you can "destroy" the GPT (or old MBR/bsdlabel) on the new target disk. The article shows how to do that, and how to do it quickly with the -F option. It also shows that in the man page, gpart(8).
 
wblock@ said:
Sorry, don't understand the question. The drives will both be in /dev, although they may not have the same drive numbers as before.

I mean, # bsdlabel don't work on the bigger drive, or better, I don't know how to call this command on it. If I try I got:
Code:
bsdlabel -A ad1s1
bsdlabel: ad1s1: no valid label found
I have the ad4s1 slice (old small drive) but I don't have any more the ad1s1 (or ad0s1 - new big one). Is this all right? May be it's a silly question because I made the drive with # gpart but you know, I'm a newbie...
 
This is what I have in /dev


Code:
# cd /dev/
# ls -l
total 3
crw-r--r--  1 root  wheel       0,  34 Sep 20 21:59 acpi
crw-r-----  1 root  operator    0,  76 Sep 20 21:59 ad1
crw-r-----  1 root  operator    0,  77 Sep 20 21:59 ad1p1
crw-r-----  1 root  operator    0,  78 Sep 20 21:59 ad1p2
crw-r-----  1 root  operator    0,  79 Sep 20 21:59 ad1p3
crw-r-----  1 root  operator    0,  80 Sep 20 21:59 ad1p4
crw-r-----  1 root  operator    0,  81 Sep 20 21:59 ad1p5
crw-r-----  1 root  operator    0,  82 Sep 20 21:59 ad1p6
crw-r-----  1 root  operator    0,  83 Sep 20 21:59 ad4
crw-r-----  1 root  operator    0, 100 Sep 20 21:59 ad4s1
crw-r-----  1 root  operator    0, 101 Sep 20 21:59 ad4s1a
crw-r-----  1 root  operator    0, 102 Sep 20 21:59 ad4s1b
crw-r-----  1 root  operator    0, 103 Sep 20 21:59 ad4s1d
crw-r-----  1 root  operator    0, 104 Sep 20 21:59 ad4s1e
crw-r-----  1 root  operator    0, 105 Sep 20 21:59 ad4s1f
crw-------  1 root  operator    0,  33 Sep 20 21:59 ata
crw-------  1 root  wheel       0,  52 Sep 20 21:59 atkbd0
crw-------  1 root  kmem        0,  19 Sep 20 21:59 audit
crw-------  1 root  wheel       0,  15 Sep 20 21:59 bpf
lrwxr-xr-x  1 root  wheel            3 Sep 20 21:59 bpf0 -> bpf
crw-------  1 root  wheel       0,   5 Sep 20 22:08 console
crw-------  1 root  wheel       0,  51 Sep 20 21:59 consolectl
crw-rw-rw-  1 root  wheel       0,  13 Sep 20 21:59 ctty
crw-------  1 root  wheel       0,   8 Sep 20 21:59 dcons
crw-------  1 root  wheel       0,   3 Sep 20 21:59 devctl
cr--------  1 root  wheel       0,  69 Sep 20 21:59 devstat
crw-------  1 root  wheel       0,   9 Sep 20 21:59 dgdb
dr-xr-xr-x  2 root  wheel          512 Sep 20 21:59 fd
crw-------  1 root  wheel       0,  17 Sep 20 21:59 fido
crw-r-----  1 root  operator    0,   4 Sep 20 21:59 geom.ctl
dr-xr-xr-x  2 root  wheel          512 Sep 20 21:59 gpt
dr-xr-xr-x  2 root  wheel          512 Sep 20 21:59 gptid
crw-------  1 root  wheel       0,  30 Sep 20 21:59 io
lrwxr-xr-x  1 root  wheel            6 Sep 20 21:59 kbd0 -> atkbd0
lrwxr-xr-x  1 root  wheel            7 Sep 20 21:59 kbd1 -> kbdmux0
lrwxr-xr-x  1 root  wheel            5 Sep 20 23:59 kbd2 -> ukbd0
crw-------  1 root  wheel       0,  26 Sep 20 21:59 kbdmux0
crw-------  1 root  wheel       0,   7 Sep 20 21:59 klog
crw-r-----  1 root  kmem        0,  29 Sep 20 21:59 kmem
lrwxr-xr-x  1 root  wheel           12 Sep 20 21:59 log -> /var/run/log
crw-------  1 root  wheel       0,  56 Sep 20 21:59 mdctl
crw-r-----  1 root  kmem        0,  28 Sep 20 21:59 mem
crw-------  1 root  kmem        0,  18 Sep 20 21:59 nfslock
crw-rw-rw-  1 root  wheel       0,  31 Sep 20 22:11 null
crw-r--r--  1 root  wheel       0,   6 Sep 20 21:59 pci
crw-rw-rw-  1 root  wheel       0,  12 Sep 20 21:59 ptmx
dr-xr-xr-x  2 root  wheel          512 Sep 20 22:00 pts
crw-rw-rw-  1 root  wheel       0,  10 Sep 20 23:59 random
lrwxr-xr-x  1 root  wheel            4 Sep 20 21:59 stderr -> fd/2
lrwxr-xr-x  1 root  wheel            4 Sep 20 21:59 stdin -> fd/0
lrwxr-xr-x  1 root  wheel            4 Sep 20 21:59 stdout -> fd/1
crw-------  1 root  wheel       0,  14 Sep 20 21:59 sysmouse
crw-------  1 root  wheel       0,  35 Sep 20 21:59 ttyv0
crw-------  1 root  wheel       0,  36 Sep 20 21:59 ttyv1
crw-------  1 root  wheel       0,  37 Sep 20 21:59 ttyv2
crw-------  1 root  wheel       0,  38 Sep 20 21:59 ttyv3
crw-------  1 root  wheel       0,  39 Sep 20 21:59 ttyv4
crw-------  1 root  wheel       0,  40 Sep 20 21:59 ttyv5
crw-------  1 root  wheel       0,  41 Sep 20 21:59 ttyv6
crw-------  1 root  wheel       0,  42 Sep 20 21:59 ttyv7
crw-------  1 root  wheel       0,  43 Sep 20 21:59 ttyv8
crw-------  1 root  wheel       0,  44 Sep 20 21:59 ttyv9
crw-------  1 root  wheel       0,  45 Sep 20 21:59 ttyva
crw-------  1 root  wheel       0,  46 Sep 20 21:59 ttyvb
crw-------  1 root  wheel       0,  47 Sep 20 21:59 ttyvc
crw-------  1 root  wheel       0,  48 Sep 20 21:59 ttyvd
crw-------  1 root  wheel       0,  49 Sep 20 21:59 ttyve
crw-------  1 root  wheel       0,  50 Sep 20 21:59 ttyvf
dr-xr-xr-x  2 root  wheel          512 Sep 20 21:59 ufsid
lrwxr-xr-x  1 root  wheel            9 Sep 20 21:59 ugen0.1 -> usb/0.1.0
lrwxr-xr-x  1 root  wheel            9 Sep 20 23:59 ugen0.2 -> usb/0.2.0
lrwxr-xr-x  1 root  wheel            9 Sep 20 21:59 ugen1.1 -> usb/1.1.0
lrwxr-xr-x  1 root  wheel            9 Sep 20 21:59 ugen2.1 -> usb/2.1.0
lrwxr-xr-x  1 root  wheel            9 Sep 20 21:59 ugen3.1 -> usb/3.1.0
lrwxr-xr-x  1 root  wheel            9 Sep 20 21:59 ugen4.1 -> usb/4.1.0
lrwxr-xr-x  1 root  wheel            9 Sep 20 21:59 ugen5.1 -> usb/5.1.0
crw-------  1 root  wheel       0,  90 Sep 20 23:59 ukbd0
crw-r--r--  1 root  operator    0, 120 Sep 20 23:59 ums0
lrwxr-xr-x  1 root  wheel            6 Sep 20 21:59 urandom -> random
dr-xr-xr-x  2 root  wheel          512 Sep 20 21:59 usb
crw-r--r--  1 root  operator    0,  54 Sep 20 21:59 usbctl
crw-------  1 root  operator    0,  55 Sep 20 21:59 xpt0
crw-rw-rw-  1 root  wheel       0,  32 Sep 20 21:59 zero
 
MBR is the old way. fdisk(8) is for editing the MBR (slices), and bsdlabel(8) is for creating BSD "partitions". The only reason to use MBR any more is if a drive is dual-booting with Windows XP or other old operating systems which don't understand GPT.

GPT is the new way. Everything is just a partition, and gpart(8) is all you need. The output from /dev shows that. ad1 just has GPT partitions, while ad4 still has the old slice scheme on it.

Drive numbers are arbitrary, determined by driver, controller, and cables. Use labels and forget about drive numbers.
 
Just to try, I downloaded FreeBSD-8.2-RELEASE-amd64-memstick.img and put in /usr/dist. Then I tried to copy it in my 8gb usb stick with # dd if=FreeBSD-8.2-RELEASE-amd64-memstick.img of=/dev/da0 bs=10240 but I have this error:
Code:
(da0:umass-sim0:0:0:0): AutoSense failed
(da0:umass-sim0:0:0:0): AutoSense failed
dd: /dev/da0: Input/output error

what can it be?
 
Yes, you are right. But it's a week that I'm trying working on it... and it's so frustrating. I would like to do so much thing with this box and FreeBSD but I'm still so far that I can't see the light.
Anyway, I'll do that, thank you for your help.
 
Ok, today I had some time and I worked on it a little bit.

Finally, I was able to create a USB stick with mfsBSD on it:

Code:
# dd if=/dev/zero of=/dev/da0 bs=1k count=1
1+0 records in
1+0 records out
1024 bytes transferred in 0.003000 secs (341331 bytes/sec)
# bsdlabel -Bw da0 auto
#
# newfs -L FreeBSD /dev/da0a
/dev/da0a: 7653.0MB (15673328 sectors) block size 16384, fragment size 2048
        using 42 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
super-block backups (for fsck -b #) at:
 160, 376416, 752672, 1128928, 1505184, 1881440, 2257696, 2633952, 3010208,
 3386464, 3762720, 4138976, 4515232, 4891488, 5267744, 5644000, 6020256,
 6396512, 6772768, 7149024, 7525280, 7901536, 8277792, 8654048, 9030304,
 9406560, 9782816, 10159072, 10535328, 10911584, 11287840, 11664096, 12040352,
 12416608, 12792864, 13169120, 13545376, 13921632, 14297888, 14674144,
 15050400, 15426656
# cd /mnt
# mkdir iso
# cd /usr/dist/
# ls -l
total 1088880
-rw-r--r--  1 Lorenzo  wheel  1087774720 Sep 20 19:18 FreeBSD-8.2-RELEASE-amd64-memstick.img
-rw-r--r--  1 Lorenzo  wheel    26652672 Sep 18 23:19 mfsbsd-8.2-amd64.iso
# mdconfig -a -t vnode -f mfsbsd-8.2-amd64.iso -u 0 && mount -r -t cd9660 /dev/md0 /mnt/iso
# cd /mnt/
# mkdir USB-Stick
# mount /dev/da0a /mnt/USB-Stick
# cp -R /mnt/iso/* /mnt/USB-Stick/
# cd /mnt/USB-Stick/
# ls -l
total 19350
drwxrwxr-x  2 root  operator       512 Sep 22 08:55 .snap
dr-xr-xr-x  7 root  wheel         1024 Sep 22 14:38 boot
-r--r--r--  1 root  wheel         2048 Sep 22 14:38 boot.catalog
-r-xr-xr-x  1 root  wheel     19778366 Sep 22 14:38 mfsroot.gz
#
# shtudown -p now

Obviously, it was not so easy but, after some attempts, I did it.

After the shutdown I unplugged the 2T drive, plugged the USB stick and 250gb drive on first position.

Then I followed your instruction, as for the first time. The only thing to do more was to
#mfsbsd gpart destroy -F ad1
so the small 250gb disk.

Now I'm at the "restore" point of your guide Disk Setup On FreeBSD but, if I'm not wrong, I do not have to do this:
Code:
# mount /dev/da0s1a /mnt
# (cd /mnt && gzcat root.dump.gz | restore -ruf -)
# umount /mnt
but I have to do:
Code:
# mkdir /tmp/root /tmp/var /tmp/usr
# ssh -c blowfish Lorenzo@192.168.0.100 gzcat root.dump.gz | (cd /tmp/root && restore -ruf -)
# ssh -c blowfish Lorenzo@192.168.0.100 gzcat var.dump.gz  | (cd /tmp/var  && restore -ruf -)
# ssh -c blowfish Lorenzo@192.168.0.100 gzcat usr.dump.gz  | (cd /tmp/usr  && restore -ruf -)
as in the restore part of dump via SSH of your other guide Backup Options For FreeBSD, where 192.168.0.100 is my FreeNAS server.

Is it right?

Thank you!
 
This is what I did:

Code:
mfsbsd# mkdir /250G
mfsbsd# mount /dev/gpt/gprootfs /250G/
mfsbsd# mount /dev/gpt/gpusrfs /250G/usr/
mfsbsd# mount /dev/gpt/gpvarfs /250G/var

and
Code:
mfsbsd# ssh -c blowfish Lorenzo@192.168.0.100 dd bs=64k if=/mnt/repository/Backup/freeBSD/20110916
/root.dump.gz | ( cd /250G/ && gzcat | restore -ruf - )
mfsbsd# ssh -c blowfish Lorenzo@192.168.0.100 dd bs=64k if=/mnt/repository/Backup/freeBSD/20110916
/var.dump.gz | ( cd /250G/var && gzcat | restore -ruf - )
mfsbsd# ssh -c blowfish Lorenzo@192.168.0.100 dd bs=64k if=/mnt/repository/Backup/freeBSD/20110916
/usr.dump.gz | ( cd /250G/usr && gzcat | restore -ruf - )

then I modified the /250G/etc/fstab like this

Code:
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/gpt/gpswap         none            swap    sw              0       0
/dev/gpt/gprootfs       /               ufs     rw              1       1
/dev/gpt/gptmpfs        /tmp            ufs     rw              2       2
/dev/gpt/gpusrfs        /usr            ufs     rw              2       2
/dev/gpt/gpvarfs        /var            ufs     rw              2       2

After that I rebooted and pulled out the USB.

Now, it seems to work but not as before. Before I had some scripts, as one for auto start up of vnc that now does not seems to work.

So, calling # df -h I have

Code:
# df -h
Filesystem           Size    Used   Avail Capacity  Mounted on
/dev/gpt/gprootfs    1.9G    325M    1.5G    18%    /
devfs                1.0K    1.0K      0B   100%    /dev
/dev/gpt/gptmpfs      85G    4.6G     74G     6%    /tmp
/dev/gpt/gpusrfs      93G    4.6G     81G     5%    /usr
/dev/gpt/gpvarfs     7.7G    166M    7.0G     2%    /var
/dev/md0              62M     62M   -4.8M   109%    /usr
/dev/md1              62M    4.0K     57M     0%    /usr/local

I don't know what /dev/md0 and /dev/md1 are. The USB is out, there is only one disk, ad1.

If I try to unmount it the system give me this:
Code:
#umount /dev/md0
umount: umount of /usr failed: Device busy

Any idea?
 
hannibal80 said:
After the shutdown I unplugged the 2T drive, plugged the USB stick and 250gb drive on first position.

Then I followed your instruction, as for the first time. The only thing to do more was to
#mfsbsd gpart destroy -F ad1
so the small 250gb disk.

Yes, and then use gpart to create new ones.

but I have to do:
Code:
# mkdir /tmp/root /tmp/var /tmp/usr
# ssh -c blowfish Lorenzo@192.168.0.100 gzcat root.dump.gz | (cd /tmp/root && restore -ruf -)

Not quite. That will restore into a directory in /tmp, like if you wanted to search for a deleted file.
 
hannibal80 said:
Now, it seems to work but not as before. Before I had some scripts, as one for auto start up of vnc that now does not seems to work.

So, calling # df -h I have

Code:
# df -h
Filesystem           Size    Used   Avail Capacity  Mounted on
/dev/gpt/gprootfs    1.9G    325M    1.5G    18%    /
devfs                1.0K    1.0K      0B   100%    /dev
/dev/gpt/gptmpfs      85G    4.6G     74G     6%    /tmp
/dev/gpt/gpusrfs      93G    4.6G     81G     5%    /usr
/dev/gpt/gpvarfs     7.7G    166M    7.0G     2%    /var
/dev/md0              62M     62M   -4.8M   109%    /usr
/dev/md1              62M    4.0K     57M     0%    /usr/local

md0 and md1 are memory disks, something to do with the custom mfsBSD you made (I think). Notice that /usr is mounted twice. Check the /etc/rc.conf for lines with mdmfs.
 
This is my rc.conf

Code:
# -- sysinstall generated deltas -- # Sun Jul 31 22:42:42 2011
# Created: Sun Jul 31 22:42:42 2011
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
keymap="it.iso"

#configurazione DHCP
ifconfig_bge0="DHCP"

#configurazione SSH
sshd_enable="YES"

#configurazione mouse e tastiere x11/xorg
hald_enable="YES"
dbus_enable="YES"

#configurazione tightvnc
tightvnc_enable="YES"

#configurazione serviio
serviio_enable="YES"
#serviio_args="-Dserviio.remoteHost=192.168.0.160"

I think I made some mistakes before I restored the dumps. I'll do the whole story again.
 
Ok, now it finally works!

Code:
# df -h
Filesystem           Size    Used   Avail Capacity  Mounted on
/dev/gpt/gprootfs    1.9G    311M    1.5G    17%    /
devfs                1.0K    1.0K      0B   100%    /dev
/dev/gpt/gptmpfs      62G     20K     57G     0%    /tmp
/dev/gpt/gpusrfs      70G    4.6G     60G     7%    /usr
/dev/gpt/gpvarfs     7.7G    134M    7.0G     2%    /var

Really thanks for your help!
 
Back
Top