Re: Resizing GPT partitions

2010-06-11 Thread Stephane Dupille
Andrey V. Elsukov bu7c...@yandex.ru écrit :
 I have plan to add `gpart recover` feature in near future.

I've seen that. It seems to me that's a good idea.

 It needs in kernel support too. You can try to download snapshot
 of livefs CD of 9.0-CURRENT and use it.
 http://pub.allbsd.org/FreeBSD-snapshots/

Well, it's becoming too complicated for me. I'll try another approach :
installaing the system in the swap partition, boot on that, make the
other partition, install the system, boot on the right partition,
delete the first one and use it as a real swap.

Thanks for your help !

regards,
SD

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: Resizing GPT partitions

2010-06-10 Thread Stephane Dupille
Andrey V. Elsukov bu7c...@yandex.ru écrit :

Hi,

 Stephane Dupille wrote:
 Currently there is no easy way to do it. GPT holds information about
 first and last usable sectors. You can see them in your output:
 last: 20971486
 first: 34

I had the opportunity to boot that machine from network (a linux), and
parted fix GPT tables correctly. Now, I have in FreeBSD the right last
usable sector :
last: 312581774
first: 34

And dmesg does not say anymore that the secondary GPT table is corrupt
or invalid.

(yeah, one problem fixed)

Unfortunatly, parted does not allow me to resize the last partition
because it does not know the type of the partition.

 You can look at freebsd-geom's mail list archive. There was a topic
 OCE and GPT with similar problem.

Yep, seen it. I applied your patch to resize partition, but I didn't
manage to use it correctly.

# cd /usr/src
# patch  /root/patch
# cd sbin/geom/class/part/
# make
# make install

Did I applied the patch correctly ? It seems not working :
# gpart resize -i 3 ad0
gpart: param 'size': Invalid argument


Thanks for your reply.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Resizing GPT partitions

2010-06-08 Thread Stephane Dupille
Hello,

I installed a FreeBSD 8.0-RELEASE into a virtual machine (with virtual
box), using a GTP partitioning scheme, and zfs. The virtual disk disk
is 10 Go.

I dumped this disk image to a real machine, which has a 160 Go disk.
The system works fine, but I can only use 10 Go of disk space. How can
I gain more space ?

How can I enlarge the last partition of the disk to use the whole disk ?

I tried to create a new partition on the disk, and planned to add it
in the zfs pool, but that didn't work :
# gpart add -t freebsd-zfs -l disk0f ad0
gpart: autofill: No space left on device

That's odd, because it seems that gpart is aware of the new geometry.

What's the problem ?


Some info :

# gpart list
Geom name: ad0
fwheads: 16
fwsectors: 63
last: 20971486
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ad0p1
   Mediasize: 65536 (64K)
   Sectorsize: 512
   Mode: r0w0e0
   rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
   label: (null)
   length: 65536
   offset: 17408
   type: freebsd-boot
   index: 1
   end: 161
   start: 34
2. Name: ad0p2
   Mediasize: 4294967296 (4.0G)
   Sectorsize: 512
   Mode: r1w1e1
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: swap0
   length: 4294967296
   offset: 82944
   type: freebsd-swap
   index: 2
   end: 8388769
   start: 162
3. Name: ad0p3
   Mediasize: 6442351104 (6.0G)
   Sectorsize: 512
   Mode: r1w1e2
   rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
   label: disk0
   length: 6442351104
   offset: 4295050240
   type: freebsd-zfs
   index: 3
   end: 20971486
   start: 8388770
Consumers:
1. Name: ad0
   Mediasize: 160041885696 (149G)
   Sectorsize: 512


# fdisk ad0
*** Working on device /dev/ad0 ***
parameters extracted from in-core disklabel are:
cylinders=310101 heads=16 sectors/track=63 (1008 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=310101 heads=16 sectors/track=63 (1008 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 20971487, size 291610321 (142387 Meg), flag 80 (active)
beg: cyl 1023/ head 255/ sector 63;
end: cyl 1023/ head 80/ sector 63
The data for partition 2 is:
sysid 0 (),(unused)
start 162, size 8388608 (4096 Meg), flag 0
beg: cyl 0/ head 2/ sector 37;
end: cyl 522/ head 45/ sector 5
The data for partition 3 is:
sysid 0 (),(unused)
start 8388770, size 12582717 (6143 Meg), flag 0
beg: cyl 522/ head 45/ sector 6;
end: cyl 1023/ head 105/ sector 47
The data for partition 4 is:
UNUSED
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Resizing GPT partitions

2010-06-08 Thread Stephane Dupille
Hello,

I installed a FreeBSD 8.0-RELEASE into a virtual machine (with virtual
box), using a GTP partitioning scheme, and zfs. The virtual disk disk
is 10 Go.

I dumped this disk image to a real machine, which has a 160 Go disk.
The system works fine, but I can only use 10 Go of disk space. How can
I gain more space ?

How can I enlarge the last partition of the disk to use the whole disk ?

I tried to create a new partition on the disk, and planned to add it
in the zfs pool, but that didn't work :
# gpart add -t freebsd-zfs -l disk0f ad0
gpart: autofill: No space left on device

That's odd, because it seems that gpart is aware of the new geometry.

What's the problem ?


Some info :

# gpart list
Geom name: ad0
fwheads: 16
fwsectors: 63
last: 20971486
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ad0p1
   Mediasize: 65536 (64K)
   Sectorsize: 512
   Mode: r0w0e0
   rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
   label: (null)
   length: 65536
   offset: 17408
   type: freebsd-boot
   index: 1
   end: 161
   start: 34
2. Name: ad0p2
   Mediasize: 4294967296 (4.0G)
   Sectorsize: 512
   Mode: r1w1e1
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: swap0
   length: 4294967296
   offset: 82944
   type: freebsd-swap
   index: 2
   end: 8388769
   start: 162
3. Name: ad0p3
   Mediasize: 6442351104 (6.0G)
   Sectorsize: 512
   Mode: r1w1e2
   rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
   label: disk0
   length: 6442351104
   offset: 4295050240
   type: freebsd-zfs
   index: 3
   end: 20971486
   start: 8388770
Consumers:
1. Name: ad0
   Mediasize: 160041885696 (149G)
   Sectorsize: 512


# fdisk ad0
*** Working on device /dev/ad0 ***
parameters extracted from in-core disklabel are:
cylinders=310101 heads=16 sectors/track=63 (1008 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=310101 heads=16 sectors/track=63 (1008 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 20971487, size 291610321 (142387 Meg), flag 80 (active)
beg: cyl 1023/ head 255/ sector 63;
end: cyl 1023/ head 80/ sector 63
The data for partition 2 is:
sysid 0 (),(unused)
start 162, size 8388608 (4096 Meg), flag 0
beg: cyl 0/ head 2/ sector 37;
end: cyl 522/ head 45/ sector 5
The data for partition 3 is:
sysid 0 (),(unused)
start 8388770, size 12582717 (6143 Meg), flag 0
beg: cyl 522/ head 45/ sector 6;
end: cyl 1023/ head 105/ sector 47
The data for partition 4 is:
UNUSED
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Memory management

2006-07-26 Thread Stephane Dupille
  Hello there,

  I have a computer running FreeBSD 6.1.

  As time passing by, the memory fills up. When the machine starts,
memory is occupied to 30 %, and after two or three weeks memory is
occupied to 100 % and it begins to use swap.

  It is inactive pages that fills up the memory.

  I tried to restart every process, but memory usage does not
decrease. Only a reboot can fix that. And I'm not able to see which
process leaks.

  I was not able to find a correct definition of what inactive
memory is. First, I would like to know what are these kind of pages :
wired, active, inactive, cache and free.

  Is that normal that inactive memory usage grows ? What should I do ?

  Do you have any tools to monitor memory usage of processes ?

  Many thanks, regards,
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Memory management

2006-07-26 Thread Stephane Dupille
Peter Jeremy [EMAIL PROTECTED] écrit :
  As time passing by, the memory fills up. When the machine starts,
memory is occupied to 30 %, and after two or three weeks memory is
occupied to 100 % and it begins to use swap.
 How are you monitoring memory usage?

  Using top, mainly. And ps, swapinfo, vmstat...

  Do you mean 'swap' or 'page'?

  swap.

 A level of page-in's is normal because text and data areas for
 processes are loaded by paging them in.

  OK for that, but when I have 700 MB of inactive memory, and free
memory reaching zero, the system begins to use the swap : swapinfo
says that swap is used (paged out). Is that normal ?

 Wired pages are pages that the kernel has wired to RAM so they cannot
 be paged out.  Active pages are being mapped by virtual memory and
 in use by running processes.  Inactive pages are not currently mapped
 but the kernel knows their contents and can re-map them without
 needing to retrieve them from disk - they may be dirty.  Cache pages
 are similar to active pages but aren't dirty and are higher-priority
 candidates for being freed.  Free pages have no useful content and
 will be used to fulfil page-in requests.

  OK, thanks for the definitions. Why there is two states inactive
and cache, if they are so similar ? (it's just curiosity, my
questions have answers now.)

 Yes.  'Free' memory is basically wasted and so the kernel tries to limit
 it, subject to having sufficient free memory to meet page-faults.  Most
 of your RAM should be wired, active or inactive.  Inactive memory will
 start at 0 and grow as active pages are released.

  OK, sounds clear.

 What should I do ?
 Nothing.  Why do you think you have a problem?

  As long as I was not sure what inactive means, I was not sure of
what to think. My first guess was that inactive memory are like
active memory but was not accessed for some time, and as such have
more priority to be pages out to swap than active memory.

  So i tried to search for the real definition of what inactive
memory is, and what I found was a little bit fuzzy.

  Do you have any tools to monitor memory usage of processes ?
 ps(1)

  ps(1) is ok to check snapshots of process states, but not the
evolution of the memory usages. I looked for a tool mainly to find
processes with memory leaks.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]