DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD General

NetBSD General Other questions regarding NetBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 28th January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Thanked 0 Times in 0 Posts
Default resizing or creating of partitions in NetBSD after installation?

First, I have to say - I'm much more familiar with Linux than with BSD and I'm not sure I really understand the BSD terminology or concept of labels and slices.

Now, my situation: I have NetBSD installed (and working well) on a disk with various other Windows and Linux partitions. NetBSD is installed on two partitions (/dev/wd0a for / and /dev/wd0h for /usr... well, and also /dev/wd0b for swap). They both fit into what disklabel declares as "unused", that is "c" (I suppose it would be /dev/wd0c) and what is being seen "from outside" (for example - parted from Linux) just as a single "sun-ufs" partition (but, from Linux I can only mount the NetBSD's /, it doesn't see it's /usr... I suppose it's normal ). That wd0c (or, maybe, better to say - wd0h), happens to be, by physical order on the disk, the very last partition that fits into the maximal range disklabel can see (I have all partitions from wd0e to wd0p, of Windows or Linux type, and they are all before the NetBSD partition; there're also some partitions at the and of the disk, but, they are ignored by disklabel).

Now, my problem: it's coming to be quite packed on my /usr; in fact, it's more than full and I've already had to pull out /pkgsrc ant to declare a new path, but, it's still nearly full. And I have a plenty of free space just after the NetBSD partition. I'd like either to make a new partition, or to enlarge (indestructibly!) the present /usr. I don't mind which solution I would apply, but, I'm not sure if any of them is available (and, if yes - how?)

A) Is it possible to resize (indestructibly!) a NetBSD partition? Maybe from a LiveCD? With another BSD?

B) If I create a new partition, would disklabel see it? May I instruct disklabel to ignore some of Windows partitions and just to jump over, so that the new partition may fit into its range? For, example, I don't care to have access from NetBSD to the present wd0g... may I make a NetBSD partiton and tell disklabel to take it for a new wd0g (obviously, I'd like to preserve "wd0h" for /usr)? And... would I lose that partition (Windows or whatever) on the disk, too? For other OS's.

Can I do something? (Except to reinstall NetBSD and take more space.) And, in the case of "yes", please - what exactly? Thanks in advance.

Last edited by J65nko; 28th January 2012 at 02:40 PM. Reason: Some whitespace added ;)
Reply With Quote
  #2   (View Single Post)  
Old 28th January 2012
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,116
Thanked 182 Times in 149 Posts
Default

OpenBSD and FreeBSD have a utility called growfs See http://www.freebsd.org/cgi/man.cgi?q...SD+9.0-RELEASE

Somebody ported this to NetBSD, but AFAIK it is not part of the NetBSD base system. NetBSD seemed to have had resize_ffs but I cannot find much documentation about it.
See http://old.nabble.com/-HEADS-UP--gro...html#a30041716

BTW your problem would be more understandable if you would post your fdisk and disklabel output
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 28th January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by J65nko View Post

Somebody ported this to NetBSD, but AFAIK it is not part of the NetBSD base system.
I've just found it. However, it obviously cannot be run on a mounted partition. So, can that utility be found on a FreeBSD LiveCD (supposing that it exists) and would it be safe to run it on a NetBSD partition?

Quote:
BTW your problem would be more understandable if you would post your fdisk and disklabel output
fdisk:
Code:
Disk: /dev/wd0d
NetBSD disklabel disk geometry:
cylinders: 310101, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 312581808

BIOS disk geometry:
cylinders: 1024, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 312581808

Partition table:
0: Primary DOS with 32 bit FAT - LBA (sysid 12)
    bootmenu: WINDOWS
    start 63, size 12321792 (6017 MB, Cyls 0-766), Active
1: Primary DOS with 32 bit FAT - LBA (sysid 12)
    start 12321855, size 18442620 (9005 MB, Cyls 767-1914)
2: Primary DOS with 32 bit FAT - LBA (sysid 12)
    start 30764475, size 22523130 (10998 MB, Cyls 1915-3316)
3: Ext. partition - LBA (sysid 15)
    start 53287605, size 259289100 (126606 MB, Cyls 3317-19456)
Extended partition table:
E0: Primary DOS with 32 bit FAT (sysid 11)
    start 53287668, size 16402302 (8009 MB, Cyls 3317-4337)
E1: NTFS, OS/2 HPFS, QNX2 or Advanced UNIX (sysid 7)
    start 69690033, size 8193087 (4001 MB, Cyls 4338-4847)
E2: NTFS, OS/2 HPFS, QNX2 or Advanced UNIX (sysid 7)
    start 77883183, size 8401932 (4103 MB, Cyls 4848-5370)
E3: NTFS, OS/2 HPFS, QNX2 or Advanced UNIX (sysid 7)
    start 86285178, size 16595082 (8103 MB, Cyls 5371-6403)
E4: Primary DOS with 32 bit FAT (sysid 11)
    start 102880323, size 1429722 (698 MB, Cyls 6404-6492)
E5: Primary DOS with 32 bit FAT (sysid 11)
    start 104310108, size 17607177 (8597 MB, Cyls 6493-7588)
E6: Linux native (sysid 131)
    start 121917348, size 42154497 (20583 MB, Cyls 7589-10212)
E7: NTFS, OS/2 HPFS, QNX2 or Advanced UNIX (sysid 7)
    start 164071908, size 16386237 (8001 MB, Cyls 10213-11232)
E8: NetBSD (sysid 169)
    start 180458208, size 20498877 (10009 MB, Cyls 11233-12508)
E9: Linux swap or Prime or Solaris (sysid 130)
    start 286053453, size 273042 (133 MB, Cyls 17806-17822)
        PBR is not bootable: All bytes are identical (0x00)
E10: Linux swap or Prime or Solaris (sysid 130)
    start 286326558, size 273042 (133 MB, Cyls 17823-17839)
        PBR is not bootable: All bytes are identical (0x00)
E11: Linux native (sysid 131)
    start 286599663, size 514017 (251 MB, Cyls 17840-17871)
        PBR is not bootable: All bytes are identical (0xf6)
E12: Linux native (sysid 131)
    start 287113743, size 25462962 (12433 MB, Cyls 17872-19456)
        PBR is not bootable: All bytes are identical (0xf6)
Bootselector enabled, timeout 7 seconds.
First active partition: 0
Drive serial number: 149817581 (0x08ee08ed)
disklabel:
Code:
# /dev/rwd0d:
type: unknown
disk: BIGMAXTOR
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 310101
total sectors: 312581808
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0		# microseconds
track-to-track seek: 0	# microseconds
drivedata: 0 

16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:   8721216 180458208     4.2BSD   2048 16384     0  # (Cyl. 179026 - 187677)
 b:    263088 189179424       swap                     # (Cyl. 187678 - 187938)
 c:  20498877 180458208     unused      0     0        # (Cyl. 179026 - 199362*)
 d: 312581808         0     unused      0     0        # (Cyl.      0 - 310100)
 e:  12321792        63      MSDOS                     # (Cyl.      0*-  12224*)
 f:  18442620  12321855      MSDOS                     # (Cyl.  12224*-  30520*)
 g:  24579450  30764475      MSDOS                     # (Cyl.  30520*-  54904*)
 h:  11514762 189442512     4.2BSD   2048 16384     0  # (Cyl. 187939 - 199362*)
 i:  14345982  55343988      MSDOS                     # (Cyl.  54904*-  69136*)
 j:   8193087  69690033       NTFS                     # (Cyl.  69136*-  77264)
 k:   8401932  77883183       NTFS                     # (Cyl.  77265*-  85600*)
 l:  15759702  86285178       NTFS                     # (Cyl.  85600*- 101234)
 m:   1429722 102880323      MSDOS                     # (Cyl. 102063*- 103482*)
 n:  17607177 104310108      MSDOS                     # (Cyl. 103482*- 120949*)
 o:  42154497 121917348 Linux Ext2      0     0        # (Cyl. 120949*- 162769*)
 p:  16386237 164071908       NTFS                     # (Cyl. 162769*- 179025*)
Reply With Quote
  #4   (View Single Post)  
Old 28th January 2012
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 534
Thanked 14 Times in 13 Posts
Default

Hi gillindu,

I'm not familiar with tools to re-size a NetBSD partition, so I can't answer some of your questions about that, but a few general comments might be helpful.

Any resizing would have to stay within the NetBSD slice of the disk, which is E8 on your fdisk output and c: on your disklabel output (also, d: on the disklabel output refers to the whole disk). Since there are other extended partitions on either side of the NetBSD one, the possibility of expanding the NetBSD slice would seem to be nil unless you eliminated the neighbours, probably/perhaps not an option for you.

One thing you could consider is to create a new Linux ext2 partition outside of the NetBSD slice and use it (or redeploy an existing partition). It could be defined in your disklabel to replace one of the other many DOS and Linux partitions if you don't use it from NetBSD. Then the new ext2 one could be mounted in the NetBSD filesystem wherever you want. To create an ext2 that NetBSD can work with you need to use the following options at mke2fs time:

Code:
-I 128 -O ^dir_index
This is admittedly not the ideal solution but it could be considered to get something workable if other ideas don't pan out.
Reply With Quote
  #5   (View Single Post)  
Old 29th January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by IdOp View Post
Hi gillindu,

Any resizing would have to stay within the NetBSD slice of the disk, which is E8 on your fdisk output and c: on your disklabel output (also, d: on the disklabel output refers to the whole disk).
That far, I think I've already understood "slices", even myself

Quote:
Since there are other extended partitions on either side of the NetBSD one, the possibility of expanding the NetBSD slice would seem to be nil unless you eliminated the neighbours, probably/perhaps not an option for you.
Well, not exactly. The disklabel output might not be very clear, since it isn't listed by order on the disk, but, there is about 40GB of free space *between* the NetBSD partition and the next Linux partition near the end of the disk. (And even if it were not, I could make some space, that wouldn't be a problem.)

Quote:
One thing you could consider is to create a new Linux ext2 partition outside of the NetBSD slice and use it (or redeploy an existing partition).
But, NetBSD wouldn't see it(?) As well as it doesn't see those Linux partitions at the end of the disk.

Quote:
It could be defined in your disklabel to replace one of the other many DOS and Linux partitions if you don't use it from NetBSD. Then the new ext2 one could be mounted in the NetBSD filesystem wherever you want. To create an ext2 that NetBSD can work with you need to use the following options at mke2fs time:
Oh, BINGO! Well... not yet But - a sort of, a halfBINGO Anyway, it was definitely a thing I wanted to know. So, it is possible! Disklabel doesn't need to comprise contiguous partitions. So, how could I do it. What should I do to pull a Windows partiton out of it?

Quote:
This is admittedly not the ideal solution but it could be considered to get something workable if other ideas don't pan out.
Thank you very much! Now, there is something that, in extremis, I can do (I only need to know how exactly I should deal with disklabel). Of course, I'd still prefer to have a native filesystem. (And I do have a free space!)
Reply With Quote
  #6   (View Single Post)  
Old 29th January 2012
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 534
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by gillindu View Post
That far, I think I've already understood "slices", even myself
Awesome (you had mentioned something about d: so I thought I'd add a comment about it.)

Quote:
Well, not exactly. The disklabel output might not be very clear, since it isn't listed by order on the disk, but, there is about 40GB of free space *between* the NetBSD partition and the next Linux partition near the end of the disk.
You're quite right. I had just assumed your fdisk E9 was located contiguous at the end of the NetBSD E8, without checking. But yup there's 40Gig in between there.

Quote:
But, NetBSD wouldn't see it(?) As well as it doesn't see those Linux partitions at the end of the disk.
Well, I assume all those DOS and Linux partitions were added by default, until the disklabel capacity to hold more partition references was full. But if you're not using one of those DOS/Linux disklabel entries, you can get rid of it and put in a new definition of your own. In this way you can reference one or more partitions that you really want. Just edit the disklabel.


Quote:
So, it is possible! Disklabel doesn't need to comprise contiguous partitions. So, how could I do it. What should I do to pull a Windows partiton out of it?
You'll have to begin by studying carefully the disklabel(8) man page. You'll probably want to use the -e flag, which will edit it with what's in your EDITOR environment variable (e.g., emacs, vi). Then you just have to over-write, in the editor, one of the existing DOS or Linux entries with the start, size and filesystem type of the new ext2fs partition you really want to access. The overall format should be the same as you see for existing Linux entries.

Disklabel can be confusing and scarey at first, and it is very important to be careful not to trash any entries you want to keep, because this is after all how the OS tries to find them and you don't want it going off into the wrong part of the disk!
Reply With Quote
  #7   (View Single Post)  
Old 30th January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Thanked 0 Times in 0 Posts
Default

Excuse me, are you sure it should go with that regex metacharacter? (Why?)
Quote:
Originally Posted by IdOp View Post
Code:
-I 128 -O ^dir_index
When, under Linux, I try to run an operation on that partition (with sfdisk, or parted), I'm getting "
Code:
Error: File system has an incompatible feature enabled. 
Compatible features are has_journal, dir_index, filetype,
sparse_super and large_file. Use tune2fs or debugfs to
remove features.
And why do I need to run an operation (move) on it? Because I've come to the point to do the first trial (not only a trial, it's also a step in my proceeding) with the NetBSD install shell. (I've already done two trials with re-arranging the existing partitions inside disklabel.) Good news - it works (I mean disklabel from the install shell). Bad news - it have found that my partitions (wd0h and its new neighbor) were overlapping. (Of course, it's also a good news, rather then bad, as it doesn't let you go on if your partitions are overlapping). What I've done? I've created two ext2 partitions next to the NetBSD's one, at its right side. The first one (the one in the middle) is meant to serve just as a placeholder for the future NetBSD partition (unnecessary step, of course, but, I think it can make the proceeding more clear and I can prepare the disklabel - apart of wd0c - as well as /etc/fstab - apart of partition type). The second one happens to be wanted (it should be the "parking place" for VMware guest OS's I've got the idea a couple of posts above), but, I would have created a (temporary) partition in any case - to serve me as a marker, as a delimiter of the free space when I delete the first one to make room to enlarge the slice. So, since I plan to continue to use that partition the way I've said, I've created it with your option, but, I've got a problem. Now, I'm going to debug it, since in this moment I don't need to have it available for NetBSD, but, the question stays about the latter use. BTW, it's a very small overlapping (126 sectors) and I've just put my new partition at the beginning of the free space I had been presented, but, it seems that Linux partitioning programs are getting a bit confused with the NetBSD slice.
Reply With Quote
  #8   (View Single Post)  
Old 30th January 2012
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 534
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by gillindu View Post
Excuse me, are you sure it should go with that regex metacharacter? (Why?)
The hat ^ disables the following feature; see the mke2fs man page. BTW, I think I found out about this stuff from here (which someone else had linked earlier in this forum).

Quote:
When, under Linux, I try to run an operation on that partition (with sfdisk, or parted), I'm getting "
Code:
Error: File system has an incompatible feature enabled. 
Compatible features are has_journal, dir_index, filetype,
sparse_super and large_file. Use tune2fs or debugfs to
remove features.
Maybe some features are enabled by default and they don't mix? Do you have an /etc/mke2fs.conf ?

I haven't had time to absorb the rest of your post yet, but will try to respond later today. In the meantime good luck with the experiments.
Reply With Quote
  #9   (View Single Post)  
Old 30th January 2012
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 534
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by gillindu View Post
Code:
Error: File system has an incompatible feature enabled. 
Compatible features are has_journal, dir_index, filetype,
sparse_super and large_file. Use tune2fs or debugfs to
remove features.
And why do I need to run an operation (move) on it?
I'm not quite sure I'm following this. By "(move)" are you referring to "remove" in the error message? If so, I think it's asking you to remove one of the conflicting features ... or that is my best guess given the limited info.

Quote:
Because I've come to the point to do the first trial (not only a trial, it's also a step in my proceeding) with the NetBSD install shell. (I've already done two trials with re-arranging the existing partitions inside disklabel.) Good news - it works (I mean disklabel from the install shell). Bad news - it have found that my partitions (wd0h and its new neighbor) were overlapping. (Of course, it's also a good news, rather then bad, as it doesn't let you go on if your partitions are overlapping). What I've done? I've created two ext2 partitions next to the NetBSD's one, at its right side.
To clarify: are these in the 40GB of free space? Or somewhere else (you mentioned using another disk)?

Quote:
The first one (the one in the middle) is meant to serve just as a placeholder for the future NetBSD partition (unnecessary step, of course, but, I think it can make the proceeding more clear and I can prepare the disklabel - apart of wd0c - as well as /etc/fstab - apart of partition type). The second one happens to be wanted (it should be the "parking place" for VMware guest OS's I've got the idea a couple of posts above), but, I would have created a (temporary) partition in any case - to serve me as a marker, as a delimiter of the free space when I delete the first one to make room to enlarge the slice. So, since I plan to continue to use that partition the way I've said, I've created it with your option, but, I've got a problem. Now, I'm going to debug it, since in this moment I don't need to have it available for NetBSD, but, the question stays about the latter use. BTW, it's a very small overlapping (126 sectors) and I've just put my new partition at the beginning of the free space I had been presented, but, it seems that Linux partitioning programs are getting a bit confused with the NetBSD slice.
I'm also getting a bit confused toward the end of this paragraph.
Reply With Quote
Old 31st January 2012
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 534
Thanked 14 Times in 13 Posts
Default

When you boot the "real NetBSD" (on disk), are the outputs of fdisk and disklabel what you think they should be? In other words, does it appear that the disklabel update from your protofile is being used by the rebooted system?
Reply With Quote
Old 31st January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by IdOp View Post
When you boot the "real NetBSD" (on disk), are the outputs of fdisk and disklabel what you think they should be? In other words, does it appear that the disklabel update from your protofile is being used by the rebooted system?
Disklabel, as far as I can see (maybe I'm missing something) - yes. Moreover, to make room for one of these partitions in disklabel, I've pulled off the ex-wd0j and made the ex-wd0i - new wd0j (just to have a kind of marker). And yes - /dev/wd0j can be mounted and it is what is shold be. So, the new disklabel table has been accepted.
But, fdisk... as the first thing it says that "Extended partition table is corrupt". And then... I'm still trying to understand something (it's a rather long output). The sizes seem to be as they should be, but, one of them seems to start nearly where it should (1 or 2 sectors of shift, I'm not sure), while the another one seems to be completely misplaced! And now, looking at the sfdisk output (from Linux), it seems to be... my mistake! I've copied from the wrong columns.
So, now, when I try to run "disklabel -R wd0 newproto" (with the corrected values)... I'm getting again that wd0g and wd0h overlap! (Now it would be for 62 sectors and not 126 as before.) After the sfdisk output, there should be 28 sectors of free space. It seems again that the size of the NetBSD's slice (wd0c) is slightly mispresented in the partition table, so the Linux utilities get fooled (at least, that would be my understanding)
(And that's why I didn't go directly to expand the slice, but, I've tried first with this "placeholder"! Better that such things happen now!)
Reply With Quote
Old 31st January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by gillindu View Post
Especially since I discovered that wd0a+wd0h+wd0b(swap) sizes do not exactly match the wd0c size! The difference (overlapping) is very small (189 sectors), but, here it is.
Quote:
Originally Posted by gillindu View Post
(Now it would be for 62 sectors and not 126 as before.)
127+62=189!

????
Could it be - that! (Although I do not understand exactly - what ) Any comment?
Reply With Quote
Old 31st January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Thanked 0 Times in 0 Posts
Default

I went to Linux to resize the offending partition (wd0g in NetBSD), to "cut" the first 62 sectors off. I came back under NetBSD, I've corrected the protofile (offset + 62s; size - 62s for the partiton in causa), I've run disklabel, I've mounted the partitons and - voilà, it works! For both partitions.
Now, there's only left to do "the real thing" - to delete the partition in the middle, to expand the slice and so on. But, I'll wait a bit. Maybe there could be a room for some valuable advice, or for some warning...
Reply With Quote
Old 31st January 2012
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 534
Thanked 14 Times in 13 Posts
Default

It's getting hard for me to follow this, without knowing exactly what you've done, or seen output from the commands. (Also, I never used sfdisk, plain fdisk has always worked for me.) What I can think of at the moment is, if you look through your fdisk and disklabel partitions and try to match up the ones that agree (and kind of ignore those) and then compare the ones that differ, looking for any clues as to what went wrong.
Reply With Quote
Old 31st January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by IdOp View Post
It's getting hard for me to follow this, without knowing exactly what you've done, or seen output from the commands.
Well, it seems that the problem has been caused by NetBSD's partitioning. As we've seen in some post above, it seems that it has invaded the neighbor's yard with one of its subpartitions by 189 sectors. Linux utilities do see the NertBSD slice, but, they don't see its subpartitions, so, if I make (in Linux) a partition adjacent to the slice, it will cross the border of a slice's subpartition. I think (and I'm waiting for some comment) that, expanding the slice (if I manage to do it), I should fill the whole space that will remain after I delete the partition in the middle. But, when I'll be creating the new subpartition (if I manage to boot ), I think I shoud abstain from going to the bottom, that is, I should leave a couple of hundreds of free sectors at the border of the slice. (Of curse, I should reflect it in the disklabel table.)

Quote:
(Also, I never used sfdisk, plain fdisk has always worked for me.)
For the next step (the decisive one) it looks like I'll have to use plain fdisk anyway. I'm not sure whether some other Linux utility (parted?) can deal with the NetBSD slices.
Reply With Quote
Old 31st January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Thanked 0 Times in 0 Posts
Default

And this is how my disklabel table looks now:
Code:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:   8721216 180458208     4.2BSD   2048 16384     0  # (Cyl. 179026 - 187677)
 b:    263088 189179424       swap                     # (Cyl. 187678 - 187938)
 c:  20498877 180458208     unused      0     0        # (Cyl. 179026 - 199362*)
 d: 312581808         0     unused      0     0        # (Cyl.      0 - 310100)
 g:  12289000 200957274 Linux Ext2      0     0        # (Cyl. 102063*- 103482*)
 h:  11514762 189442512     4.2BSD   2048 16384     0  # (Cyl. 187939 - 199362*)
 i:  12289062 213246275 Linux Ext2      0     0        # (Cyl.  30520*-  54904*)
(Only the partitions that are somehow concerned have been displayed, I've left out those that shouldn't be affected in any way.) The "g" is going to be deleted to make space for the expanded "c".
Reply With Quote
Old 31st January 2012
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 534
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by gillindu View Post
And this is how my disklabel table looks now:
Code:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:   8721216 180458208     4.2BSD   2048 16384     0  # (Cyl. 179026 - 187677)
 b:    263088 189179424       swap                     # (Cyl. 187678 - 187938)
 c:  20498877 180458208     unused      0     0        # (Cyl. 179026 - 199362*)
 d: 312581808         0     unused      0     0        # (Cyl.      0 - 310100)
 g:  12289000 200957274 Linux Ext2      0     0        # (Cyl. 102063*- 103482*)
 h:  11514762 189442512     4.2BSD   2048 16384     0  # (Cyl. 187939 - 199362*)
 i:  12289062 213246275 Linux Ext2      0     0        # (Cyl.  30520*-  54904*)
(Only the partitions that are somehow concerned have been displayed, I've left out those that shouldn't be affected in any way.) The "g" is going to be deleted to make space for the expanded "c".
I had some other comments, but when I saw the above table, I thought it would be worth delaying those. The table doesn't look right (unless I'm missing something). Look at partition a: ... it goes to a last sector of 197179503. Doesn't this mean the root ( / ) partition overlaps both the swap and the h: partition?
Reply With Quote
Old 31st January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by IdOp View Post
I had some other comments, but when I saw the above table, I thought it would be worth delaying those. The table doesn't look right (unless I'm missing something). Look at partition a: ... it goes to a last sector of 197179503. Doesn't this mean the root ( / ) partition overlaps both the swap and the h: partition?
Sorry, I don't understand what do you mean by "197179503" (both sizes and offsets already are displayed in sectors), but, there certainly is some overlapping among the slice's subpartitions. But, it has been so since the very beginning, I have never touched either of them (a, b, c, d, or h), that's how NetBSD did it during the installation (and I've saved the original disklabe and fdisk output)
Reply With Quote
Old 31st January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Thanked 0 Times in 0 Posts
Default

So, I have deleted the wd0g and now I have a simple situation - just about 6000MB of free space at the right side of the NetBSD slice.
But... in (linux) fdisk there is no an option to resize a partition!!! (Or, at least, I don't see it, neither under "x", that is, under "extra functionality, experts only".) Only to delete a partition, or to add a new one. Oh, yes, there's also an option to "create a new empty Sun disklabel", as well as to "edit BSD label". But, when I try the second one, I'm being said that "there is no *BSD partition on /dev/hda". The same when I run fdisk on that particular (NetBSD's) partition. On the other side, cfdisk does have options to resize or move partitions, but, it seems that neither of these options is available for Sun-ufs filesystem. Futhermore, there is an option to edit it (to "edit this BSD disklabel"), but, when I try it - the program crashes (bug in the program)! So, how can I increase the slice!?
Reply With Quote
Old 31st January 2012
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 534
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by gillindu View Post
But... in (linux) fdisk there is no an option to resize a partition!!! (Or, at least, I don't see it, neither under "x", that is, under "extra functionality, experts only".) Only to delete a partition, or to add a new one.
You will need both of these. First delete the old partition (the one that is the whole NetBSD slice). Then add a new partition at the same slot and location. That is, it should start at the same offset, but the size should be bigger as you wish. Be sure to be working in sectors. And make a note of the new offset and size since you will have to put the same in the disklabel.

Quote:
Oh, yes, there's also an option to "create a new empty Sun disklabel", as well as to "edit BSD label". But, when I try the second one, I'm being said that "there is no *BSD partition on /dev/hda". The same when I run fdisk on that particular (NetBSD's) partition.
I would never use these. If you want to edit disklabels you should use the appropriate tool from the BSD in question. The Linux tools can't be expected to support and be up to date with all varieties of BSD, so should not be used or trusted for this, IMO. For making the overall fdisk type partitions, the fdisks from the two systems should of course agree exactly.

Quote:
On the other side, cfdisk does have options to resize or move partitions, but, it seems that neither of these options is available for Sun-ufs filesystem. Futhermore, there is an option to edit it (to "edit this BSD disklabel"), but, when I try it - the program crashes (bug in the program)! So, how can I increase the slice!?
Again, just use fdisk as above.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NetBSD 5.1 Installation issues acottag NetBSD Installation and Upgrading 8 14th January 2011 05:06 AM
Resizing slices jewsofeast NetBSD General 1 20th November 2010 11:34 AM
Resizing /usr jewsofeast OpenBSD Installation and Upgrading 11 19th November 2010 01:46 PM
Resizing /usr abdo88 FreeBSD General 15 12th July 2008 01:49 PM
NetBSD installation problem fgs NetBSD Installation and Upgrading 3 26th June 2008 04:01 PM


All times are GMT. The time now is 02:56 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick