finding and mounting a fat partition
Mike Meyer
mwm at mired.org
Wed Dec 8 01:49:59 PST 2004
In <NFBBJMMIKLKCDJIPOPLFOEJFEKAA.bagus at cox.net>, Bagus <bagus at cox.net> typed:
>
> Hi,
>
> When I built my box, I split the disk into two partitions, one 8 gig
> partition for freebsd and one 2 gig fat one in case I ever wanted to change
> my mind and install a different operating system on the box. Of course, I've
> never wanted to do that, but I would like to now use that 2 gigs of
> diskspace for stuff now if I could.
>
> I found this little bit of information: http://www.freebsdhowtos.com/61.html
> but when I run a df, I don't see it listed, so I don't know what the device
> is called.
>
> Am I screwed? Any ideas?
You want to use fdisk to find the partition, and change it's type to
FreeBSD. I've got a two-partition disk for the same reason, and it
looks like:
guru# fdisk /dev/da1 /datmp/redhat
******* Working on device /dev/da1 *******
parameters extracted from in-core disklabel are:
cylinders=1777 heads=244 sectors/track=41 (10004 blks/cyl)
Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=1777 heads=244 sectors/track=41 (10004 blks/cyl)
Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
start 41, size 13585391 (6633 Meg), flag 80 (active)
beg: cyl 0/ head 1/ sector 1;
end: cyl 1023/ head 243/ sector 41
The data for partition 2 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
start 13585432, size 4191676 (2046 Meg), flag 0
beg: cyl 1023/ head 255/ sector 63;
end: cyl 1023/ head 243/ sector 41
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
Note that's two slices, partition 1 and partition 2. The second one
has one partition on it, /dev/da1s2a. The first one has three
partitions on it, as disklabel will show you:
guru# disklabel /dev/da1s1 /datmp/redhat
# /dev/da1s1:
type: SCSI
disk: da1s1
label:
flags:
bytes/sector: 512
sectors/track: 41
tracks/cylinder: 244
sectors/cylinder: 10004
cylinders: 1357
sectors/unit: 13585391
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # milliseconds
track-to-track seek: 0 # milliseconds
drivedata: 0
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
a: 131072 0 4.2BSD 1024 8192 23 # (Cyl. 0 - 13*)
b: 1310720 131072 swap # (Cyl. 13*- 144*)
c: 13585391 0 unused 0 0 # (Cyl. 0 - 1357*)
e: 12143599 1441792 4.2BSD 1024 8192 22 # (Cyl. 144*- 1357*)
Basically, what you need to do is use fdisk to find the partition and
change the type to BSD (fdisk -u /dev/da1 for me). Then use disklabel
to write a label on that slice (disklabel -r -w /dev/da1s1
auto). Check to see what it wrote (disklabel /dev/da1s1), and possibly
edit it with disklabel (disklabel -r -e /dev/da1s1). Finally newfs the
partition(s) you want to mount (newfs /dev/da1s1e). You can then add
it to /etc/fstab and mount and use it.
You should, of course, use your disk's actual name where I used da1.
<mike
--
Mike Meyer <mwm at mired.org> http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.
More information about the freebsd-hackers
mailing list