|
NetBSD General Other questions regarding NetBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|
|||
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 ;) |
|
|||
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 |
|
|||
Quote:
Quote:
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) 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*) |
|
|||||
Quote:
Quote:
Quote:
Quote:
Quote:
|
|
||||
Quote:
Quote:
Quote:
Quote:
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! |
|
|||
Excuse me, are you sure it should go with that regex metacharacter? (Why?)
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. |
|
||||
Quote:
Quote:
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. |
|
||||
Quote:
Quote:
Quote:
|
|
||||
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?
|
|
|||
Quote:
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!) |
|
|||
Quote:
???? Could it be - that! (Although I do not understand exactly - what ) Any comment? |
|
|||
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... |
|
||||
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.
|
|
|||
Quote:
Quote:
|
|
|||
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*) |
|
||||
Quote:
|
|
|||
Quote:
|
|
|||
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!? |
|
||||
Quote:
Quote:
Quote:
|
Thread Tools | |
Display Modes | |
|
|
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 |