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
Old 30th January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Default

Quote:
Originally Posted by IdOp View Post
I'm not quite sure I'm following this.
I'm not surprised.
Quote:
By "(move)" are you referring to "remove" in the error message?
No. I wanted to "push" them 127 sectors right, since they (more exactly - the first of them) were invading the NetBSD slice's space. And they realy did, disklabel didn't complain without reason - I've studied the "sfdisk -l -uS" output and it was that. Well, rather then "moved" they should have been resized, in two steps: first reduced at the begining and then expanded at the other side (and it was more simple to delete them and create again, from the correct starting point). However, it's done.

Quote:
To clarify: are these in the 40GB of free space? Or somewhere else (you mentioned using another disk)?
Yes, I do. But, I don't want to use all that space. So, I wanted to delimit the space where I can expand the slice into. (And I did want the second ext2 partition, anyway.) Yes, I know it's completely unnecessary, but, it gives to me some sort of guidance.
Reply With Quote
Old 30th January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Default

And now, I'm at the following point:
I've added two ext2 partitions next to the NetBSD slice. I've adjusted the protofile, providing the output od "sfdisk -l -uS". I've booted the install CD and from the shell prompt, after having mounted the ext2 partition where the file had been saved, I've run disklabel -R wd0 [path]protofile". Everything went OK.
Now I should have on my disk ... wd0h<->wd0g<->wd0i... or, in other words ...wd0c<->wd0g<->wd0i...
wd0i should remain where it is. wd0g is just a placeholder for a new (ffs) wd0g that will be created after I'll have wd0c expanded towards wd0i.
So, I've booted into the real NetBSD, but... I can mount neither of them:
Code:
mount_ext2fs: /dev/wd0g on /mnt/tmp: incorrect super block
The same for the wd0i (yes, I did do "fsck -f" in Linux).
Of course I wouldn't care if I can't mount this wd0g for itself (anyway, I want just to go to Linux, delete it and to expand the NetBSD slice into its place), but, I'm concerned, because it means there is something wrong. (And I do care about the other partition!) Might it again be some extra feature?

Last edited by gillindu; 30th January 2012 at 10:33 PM.
Reply With Quote
Old 30th January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Default

Quote:
Originally Posted by gillindu View Post
I've booted the install CD and from the shell prompt
Of course, this was just for test, at this point. I might have done it under NetBSD. Only the next step I'll do have to do with the InstallCD.

Last edited by gillindu; 31st January 2012 at 12:03 AM.
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: 1,027
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
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
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
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: 1,027
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
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
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
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
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: 1,027
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
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
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
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
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: 1,027
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
Old 31st January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Default

Quote:
Originally Posted by gillindu View Post
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.
Or, better to say, I don't see an overlapping among them, (offset(a)+size(a)=offset(b); offset(b)+size(b)=offset(h)... at least, that would be my understanding), but rather a piece of h goes out of c.

Last edited by gillindu; 31st January 2012 at 05:33 PM.
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: 1,027
Default

Quote:
Originally Posted by gillindu View Post
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)
I got 197179503 by adding the size to the offset of a:, and subtracting 1, to get the last sector of the BSD-partition described by a: . Maybe this overlap is another example of the wonkyness of the install program's default selections? I'm coming to the conclusion that any default partitioning offered by install should always be checked with a fine tooth comb and probably done over by hand editing.

Maybe the NetBSD stuff should be backed up and re-install? With careful consideration of the disklabel at install time? .... if I'm not missing anything and there really is overlap.
Reply With Quote
Old 31st January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Default

Quote:
Originally Posted by IdOp View Post
You will need both of these. First delete the old partition (the one that is the whole NetBSD slice).
HUHHH!

Quote:
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.
This time, I would do it with the correct size, to cover all a+b+h (and now also the future g) space, that is - to include also the part that has been missing from c since the very beninning. What do you think about?

Quote:
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.
yes!

Quote:
I would never use these. If you want to edit disklabels you should use the appropriate tool from the BSD in question.
For certain, neither would I either... in normal circumstances. But now, I've only wanted to see...
Reply With Quote
Old 31st January 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Default

Quote:
Originally Posted by IdOp View Post
I got 197179503 by adding the size to the offset of a:, and subtracting 1, to get the last sector of the BSD-partition described by a:
Well, I'm still failing to see it makes 197179503... never mind. However, I think I've understood I should decrease (in the disklabel table) all their sizes (a, b and h) by 1 sector, so it should be; offset+size+1 = the next offset.
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: 1,027
Default

Quote:
Originally Posted by gillindu View Post
HUHHH!
My advice was a bit mixed up, but I think you can still do it with fdisk. It's trickier because we're dealing with logical partitions (which form a linked list in the extended partition), rather than primary partitions. What will happen when you delete the partition is the ones after it will be renumbered downward by 1. Then when you create the new partition to replace the one you deleted, it will be put at the end of the list. This is not good, but you can fix it by going into expert mode in fdisk. That is option x. In expert mode, use option f to fix the ordering, and option p to print the new table so you can check it. Then back to the regular menu (non-expert) with r. If you can't get it to do what you want, exit fdisk without saving changes, and try to think of another way.

Quote:
This time, I would do it with the correct size, to cover all a+b+h (and now also the future g) space, that is - to include also the part that has been missing from c since the very beninning. What do you think about?
Well, I wouldn't put into the NetBSD slice any space that you want to use for an ext2 partition. Keep those outside. Only put NetBSD filesystems and swap inside its 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: 1,027
Default

Quote:
Originally Posted by gillindu View Post
Well, I'm still failing to see it makes 197179503... never mind.
180458208 + 8721216 - 1 = 189179423

You're right Sorry, I know what happened, I was reading both of the 0 in the first number as an 8 ... my eyes suck.

Quote:
However, I think I've understood I should decrease (in the disklabel table) all their sizes (a, b and h) by 1 sector, so it should be; offset+size+1 = the next offset.
No, don't do this. It's like this:

offset + size = first sector of space AFTER the partition

offside + size - 1 = last sector of the partition

Just think of size=1 as an example in the above and it should make sense I hope.
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 11:19 AM.


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