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 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: 552
Thanked 14 Times in 13 Posts
Default

gillindu, it looks like I'm going to be relatively tied up for most of the rest of the day. If my replies are delayed that would be the reason why.
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
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.
Would a changed number affect the NetBSD's boot, or you're concerned about the other partitions on the disk, after that one? Because, if it's the second case - yes, there're few partitions on the disk after that one, indeed, but, none of them is vital for any OS, so I could easily make changes in fstab.

Quote:
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.
Never will I. The "g" will be (I hope it will ) a new ffs partition created (by newfs) inside the slice as the final step at the end of all this process. That's why I'm looking to increase the slice and that's all we're talking about, isn't it?

Last edited by gillindu; 31st January 2012 at 07:00 PM.
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
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 ...
I've imagined it was something alike

Quote:
my eyes suck.
Don't tell it to me! Luckily, my calculator's got good glasses.

Quote:
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.
Ah, better so...
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: 552
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by gillindu View Post
Would a changed number affect the NetBSD's boot, or you're concerned about the other partitions on the disk, after that one? Because, if it's the second case - yes, there're few partitions on the disk after that one, indeed, but, none of them is vital for any OS, so I could easily make changes in fstab.
My concern is that if the logical partitions are not linked in the same order that they occur on the disk (by increasing LBA for example) then some programs will get confused. I think I've had this happen but don't recall the details anymore. The expert option f should fix this.

Quote:
Never will I. The "g" will be (I hope it will ) a new ffs partition created (by newfs) inside the slice as the final step at the end of all this process. That's why I'm looking to increase the slice and that's all we're talking about, isn't it?
I was just too lazy to look up what was g and i ... and didn't trust my eyes anymore ... so wanted to say it in words to make sure.
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

During my last double-check of my original disklabel table and all my fdisk outputs, I've discovered that all my logical partitions were distanced by 63 sectors from one another. The NetBSD slice too, it was starting 63 sectors after the end of its preceding (NTFS) partition. I can only vaguely suspect why it's so, but, it does make some sense about those 189 sectors "missing" from c: 63 x 3 (for its 3 subpartitions that are not distanced themselves) = 189! There used to be a free space after that partition, so it didn't cause any troubles. But now, I should make sure to have the slice starting at the same point as before, but, ending 63 sectors before the start of the next (ext2) partition. Or, maybe it should be 63 x number of intended sub-partitions?
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've started plain fstab, but, I don't see there is an option to choose the type of a partition one would create (!?) Cfdisk does have that option. (Might it be that your Linux fdisk is nothing else, but, a meta-program, that, in realty, runs cfdisk?). So, I've run cfdisk, deleted the "sun-ufs" partition and, after that (without having committed the change), I've chosen "New" in that same free space. Under "custom" it offers the list of partition types, so I've chosen "sun-ufs". Then it has proposed me a partition's starting point and it was immediately after the end of the preceding partition. I've corrected it (+63) to have the same starting point as before. At my surprise, it has proposed an ending point as much as 15531 sectors before the start of the next partition. I didn't even try to increase it, I've accepted the proposal. (I don't mind if I lose a couple of megabytes, as long as I make it right in disklabel table... and I've taken a note from cfdisk's info.) But, when, at the end, I've tried "Make FS", it said - "Can't create filesystem sun-ufs, you'll have to choose another... Press any key to continue". So, I've followed your advice - to exit (c)fdisk without saving changes and I think I'll wait till you have some time, never mind when it might be.
Reply With Quote
Old 1st February 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: 552
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by gillindu View Post
But now, I should make sure to have the slice starting at the same point as before, but, ending 63 sectors before the start of the next (ext2) partition. Or, maybe it should be 63 x number of intended sub-partitions?
I'm not an expert but I think the 63 sector thing is related to being compatible with ancient potions of the WinDOS universe. Also involved may be aligning partitions on cylinder boundaries, which really have only hypothetical meaning these days ... Linux' fdisk does it that way by default and if you do it different it'll give a warning message, AFAICT.

My sense is that 63 sector gap between the partitions should be enough. E.g., the ext2 partition has no idea what's inside the prior slice.
Reply With Quote
Old 1st February 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: 552
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by gillindu View Post
I've started plain fstab, but, I don't see there is an option to choose the type of a partition one would create (!?)
You meant fdisk, right? You can set the partition type in fdisk (Linux') with the t option. It should be set to A9 (hex) for NetBSD. You can get a list of type codes with the l option. See ye olde man page.

Quote:
Cfdisk does have that option. (Might it be that your Linux fdisk is nothing else, but, a meta-program, that, in realty, runs cfdisk?).
They're separate programs on my system:
Code:
-rwxr-xr-x 1 root root 85380 Sep 10  2008 /sbin/fdisk*
-rwxr-xr-x 1 root root 53208 Sep 10  2008 /sbin/cfdisk*
Quote:
So, I've run cfdisk, deleted the "sun-ufs" partition and, after that (without having committed the change), I've chosen "New" in that same free space. Under "custom" it offers the list of partition types, so I've chosen "sun-ufs".
I don't know where you're getting sun-ufs from?? Use NetBSD as above.

Quote:
But, when, at the end, I've tried "Make FS",it said - "Can't create filesystem sun-ufs, you'll have to choose another... Press any key to continue".
Are you saying you tried to make a ufs filesystem in Linux' cfdisk? That sounds like a recipe for disaster, if even possible. You should only demarcate the fdisk-partitions (one of which is a NetBSD slice) with fdisk. Make the FFS filesystem with newfs from a running NetBSD system, such as the install CD, once the disklabel is set up for the slice.
Reply With Quote
Old 1st February 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
You meant fdisk, right?
Obviously my mind hasn't been too fresh.

Quote:
You can set the partition type in fdisk (Linux') with the t option. It should be set to A9 (hex) for NetBSD. You can get a list of type codes with the l option. See ye olde man page.
Yes, I had seen about the -l option (and I've checked it). But, since I didn't see a way to set the type, I've assumed it only could recognize those types for listing. I didn't realize what "change a partition's system Id" meant - I've taken it for uuid.

Quote:
I don't know where you're getting sun-ufs from?? Use NetBSD as above.
Both cfdisk and parted identify that partition as "sun-ufs". For fdisk and sfdisk it's "a9 NetBSD"

Quote:
Are you saying you tried to make a ufs filesystem in Linux' cfdisk? That sounds like a recipe for disaster, if even possible.
I didn't try. I've retired in time

OK, now I'm done with it and I'm going to boot the NetBSD InstallCD. Should I re-create wd0a, wd0b and wd0h too (/, swap and /usr), or I just have to change disklabel? (Creating of the new partition is something I can leave for a later moment.)
BTW, fdisk has propsed me the same default values for START and END as cfdisk. There's always that gap of 15531 sectors till the next partition. I don't understand why, but, I've accepted it. (And I've corrected my protofile and saved it at a place accessible from the InstallCD)

Last edited by gillindu; 1st February 2012 at 07:05 AM.
Reply With Quote
Old 1st February 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
OK, now I'm done with it and I'm going to boot the NetBSD InstallCD. Should I re-create wd0a, wd0b and wd0h too (/, swap and /usr), or I just have to change disklabel?
Done that too. Changed the disklabel, it seems everything OK. I can mount and list both wd0a and wd0h It seems... (better not to say, for the moment ). Of course, I could create wd0g now, as well (may I, by chance, do it from the running NetBSD?), but, I'd prefer to go first under (disk) NetBSD to see... whether it will boot.
Reply With Quote
Old 1st February 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Thanked 0 Times in 0 Posts
Thumbs up

Quote:
Originally Posted by gillindu View Post
but, I'd prefer to go first under (disk) NetBSD to see... whether it will boot.
YES, IT DOES!!!!!
Reply With Quote
Old 1st February 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
Make the FFS filesystem with newfs from a running NetBSD system, such as the install CD, once the disklabel is set up for the slice.
For the slice only, or also for the new partition I'm going to create? I've done the later
Code:
			<...>
 g:  12273471 200957274     4.2BSD   2048 16384     0  
 h:  11514762 189442512     4.2BSD   2048 16384     0  
			<...>
and run the command
Code:
newfs /dev/wd0g
first without paremetars, and then with "-0 1", but, I was getting
Code:
newfs: /dev/wd0g is a block device. use raw device
So, I'm assuming I should have run the command on the entire disk (wd0), but, since "newfs is used to initialize and clear file systems before first use", I am concerned whether it will format all ffs partitions it will see from disklabel? How will it know it should deal only with /dev/wd0g? The man page doesn't specify whether that program runs (or might be run) interactively and I don't understand its syntax (or, at least, I don't understand what does it intend by "special").
Reply With Quote
Old 1st February 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Thanked 0 Times in 0 Posts
Default

[QUOTE=IdOp;42364]the command
Code:
newfs /dev/wd0g
It probably should have been
Code:
newfs /dev/rwd0g
Am I correct? (The man page says no a word about it... or I don't understand.)
But, I'm looking now at NetBSD's /dev (mounted from Debian) and rwd0d is marked as being last modified a week ago (???), rwd1d - the day before yesterday (?) and all other rdwXY devices seem to have been as they are since the very first installation (only rwd0h somewhat later)
Reply With Quote
Old 1st February 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: 552
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by gillindu View Post
... the command
Code:
newfs /dev/wd0g
It probably should have been
Code:
newfs /dev/rwd0g
Am I correct? (The man page says no a word about it... or I don't understand.)
But, I'm looking now at NetBSD's /dev (mounted from Debian) and rwd0d is marked as being last modified a week ago (???), rwd1d - the day before yesterday (?) and all other rdwXY devices seem to have been as they are since the very first installation (only rwd0h somewhat later)
Hi, I've still been busy, sorry, and have just read the above posts. It looks like you're making good progress!

Yes, I think "raw device" means use rwd0g. It may be in the man page so would be good idea to recheck it carefully. Certainly it should not be done on the entire disk, nor the entire slice, nor any BSD-partition in the slice that is already formatted. It would wipe out all the data on any of those! newfs is like mke2fs under Linux, or format under DOS. It makes a new empty filesystem ready on the prepared partition, and will kill anything that is already there! So just do the new one you created.

As for the other new ext2 partition outside the NetBSD slice, that I would again create with fdisk, using f to fix the order (expert mode again) if needed, and then format it with mke2fs running from Linux. After that you can go to NetBSD and add it to your disklabel if it isn't there already.

Hope this helps, got to run for a bit again ...
Reply With Quote
Old 1st February 2012
gillindu gillindu is offline
Port Guard
 
Join Date: Jan 2012
Posts: 36
Thanked 0 Times in 0 Posts
Thumbs up

Quote:
Originally Posted by gillindu View Post
It probably should have been
Code:
newfs /dev/rwd0g
Am I correct?
It seems I was. I've booted from the InstallCD (checked disklabel to see whether it was what it was supposed to be), executed the former command, it did its job... then I've mounted both /dev/wd0a and /dev/wd0h and listed them, to see if the content was still there , it was. Then "fsck /dev/wd0g", it was clear, I've mounted it. Now, I'm under the installed NetBSD and the job is done!!!

P.S. Well... almost done. I only have to export some big /usr/subdirectory (/usr/pkg) to the new partition, to add the mounting point in /etc/fstab and to delete the original content (from InstallCD shell)

Thank you, IdOp, for your assistence!
Reply With Quote
Old 1st February 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: 552
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by gillindu View Post
Now, I'm under the installed NetBSD and the job is done!!!
That is awesome!

Quote:
P.S. Well... almost done. I only have to export some big /usr/subdirectory (/usr/pkg) to the new partition, to add the mounting point in /etc/fstab and to delete the original content (from InstallCD shell)
Why do you need to do it from that shell?

Quote:
Thank you, IdOp, for your assistence!
You're very welcome, gillindu! I'm glad nothing went too far off the rails. I hope you will enjoy using and continuing to learn about the system!
Reply With Quote
Old 1st February 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
As for the other new ext2 partition outside the NetBSD slice, that I would again create with fdisk,
Why should I do it??? It's already here! (I've created both while doing this. Remember?) Or, you maybe suspect some Linux disk utility might have changed its features? Well, I'll see... if it works (in NetBSD) - good. If not - I'll tune it. However, the order is OK. (I did have a little problem in Linux that I forgot it would happen by reordering, but, it's already solved.)
And once again - thank you very much! Only... I see (I'm new in this forum) that in your header you have "Thanked 14 Times in 13 Posts" and your result hasn't changed after my last thanksgiving few posts above. Maybe that thanksgiving hasn't been sufficient? So, what should I do (I am too dumb for any phone) to thank you officially?
Reply With Quote
Old 1st February 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
Why do you need to do it from that shell?
Maybe it's not necessary, I don't know yet (I've just finished copying and in this moment I'm running diff to verify whether they're identical). If I mount the new partition as /usr/pkg now, I obviously won't be able to remove from /usr what would remain beyond the mounting point. If I don't mount the new partiton, I'm not sure the system would allow me to delete the contents of /usr/pkg (or, at leaste, something of that), something is probably in use. And I feel it more simple just to boot from the InstallCD, for a moment, then to examine who is using what, where and why.
Reply With Quote
Old 1st February 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: 552
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by gillindu View Post
Why should I do it??? It's already here! (I've created both while doing this. Remember?) Or, you maybe suspect some Linux disk utility might have changed its features? Well, I'll see... if it works (in NetBSD) - good. If not - I'll tune it. However, the order is OK. (I did have a little problem in Linux that I forgot it would happen by reordering, but, it's already solved.)
Maybe I misread your prior post and thought you were going to do it again, sorry about that! It sounds like that's all done then.

Quote:
And once again - thank you very much! Only... I see (I'm new in this forum) that in your header you have "Thanked 14 Times in 13 Posts" and your result hasn't changed after my last thanksgiving few posts above. Maybe that thanksgiving hasn't been sufficient? So, what should I do (I am too dumb for any phone) to thank you officially?
You're welcome, again too. I think the forum software has been changed so that thanks are not kept track of anymore. So no worries about that, the thanks you've said in your post are official to me.
Reply With Quote
Old 1st February 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: 552
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by gillindu View Post
Maybe it's not necessary, I don't know yet (I've just finished copying and in this moment I'm running diff to verify whether they're identical). If I mount the new partition as /usr/pkg now, I obviously won't be able to remove from /usr what would remain beyond the mounting point. If I don't mount the new partiton, I'm not sure the system would allow me to delete the contents of /usr/pkg (or, at leaste, something of that), something is probably in use. And I feel it more simple just to boot from the InstallCD, for a moment, then to examine who is using what, where and why.
Thanks for explaining, it sounds reasonable.
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 05:17 AM.


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