NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

mbrlabel question



Hello,

I have NetBSD installed in a Acer Aspire One laptop (MBR). Debian GNU
Linux was installed first in this computer.

I would like to mount the Linux partition inside NetBSD to copy some
files using fuse-ext2 package.

netbsd-acer# fdisk wd0
Disk: /dev/rwd0
NetBSD disklabel disk geometry:
cylinders: 465141, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 468862128, bytes/sector: 512

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

Partitions aligned to 2048 sector boundaries, offset 2048

Partition table:
0: Linux native (sysid 131)
    start 2048, size 307703808 (150246 MB, Cyls 0-19153/204/59)
        PBR is not bootable: All bytes are identical (0x00)
1: Linux swap or Prime or Solaris (sysid 130)
    start 307705856, size 7727104 (3773 MB, Cyls 19153/204/60-19634/202/24)
        PBR is not bootable: All bytes are identical (0x00)
2: NetBSD (sysid 169)
    start 315435008, size 153427120 (74916 MB, Cyls
19634/234/57-29185/80/63), Active
3: <UNUSED>
First active partition: 2
Drive serial number: 3245312946 (0xc16f8bb2)


netbsd-acer# disklabel /dev/wd0
# /dev/wd0:
type: unknown
disk: wd
label: fictious
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 465141
total sectors: 468862128
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

4 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a: 149253312 315435008     4.2BSD      0     0     0  # (Cyl. 312931*- 461000*)
 b:   4173808 464688320       swap                     # (Cyl. 461000*- 465140)
 c: 153427120 315435008     unused      0     0        # (Cyl. 312931*- 465140)
 d: 468862128         0     unused      0     0        # (Cyl.      0 - 465140)
netbsd-acer#

There is not an entry for the Linux ext4  partition and Linux swap partition.

I discovered mbrlabel command:

netbsd-acer# mbrlabel /dev/wd0
Found Linux Ext2 partition; size 307703808 (150246 MB), offset 2048
  adding Linux Ext2 partition to slot e.
Found swap partition; size 7727104 (3773 MB), offset 307705856
  adding swap partition to slot f.
Found 4.2BSD partition; size 153427120 (74915 MB), offset 315435008
  skipping existing unused partition at slot c.

6 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a: 149253312 315435008     4.2BSD      0     0     0  # (Cyl. 312931*- 461000*)
 b:   4173808 464688320       swap                     # (Cyl. 461000*- 465140)
 c: 153427120 315435008     unused      0     0        # (Cyl. 312931*- 465140)
 d: 468862128         0     unused      0     0        # (Cyl.      0 - 465140)
 e: 307703808      2048 Linux Ext2      0     0        # (Cyl.      2*- 305263*)
 f:   7727104 307705856       swap                     # (Cyl. 305263*- 312929*)

Not updating disk label.
netbsd-acer#

I think this command can add the labels of the Linux and swap
partitions as wd0e and wd0f, but reading the man page the subject is
not clear to me. Before issuing the actual mbrlabel command I want to
understand it well and be sure I am not going to break anything.

     The following options are available:

     -f         Force an update, even if there has been no change.

     -q         Performs operations in a quiet fashion.

     -r         In conjunction with -w, also update the on-disk label.

     -s sector  Specifies the logical sector number that has to be read from
                the disk in order to find the MBR.  Useful if the disk has
                remapping drivers on it and the MBR is located in a non-
                standard place.  Defaults to 0.

     -w         Update the in-core label if it has been changed.  See also -r.

I do not know the difference between the in-core and on-disk options,
what I should use and if I can break something with it.

Thanks so much.
Ramiro


Home | Main Index | Thread Index | Old Index