Hitchhiker's Guide to Openbsd


Download 1.27 Mb.
Pdf ko'rish
bet225/258
Sana04.04.2023
Hajmi1.27 Mb.
#1328980
1   ...   221   222   223   224   225   226   227   228   ...   258
Bog'liq
obsd-faq49

14.14 - Why does 
df(1)
 tell me I have over 100% of my disk used?
People are sometimes surprised to find they have negative available disk space, or more than 100% of a 
filesystem in use, as shown by 
df(1)

When a filesystem is created with 
newfs(8)
, some of the available space is held in reserve from normal users. This 
provides a margin of error when you accidently fill the disk, and helps keep disk fragmentation to a minimum. 
Default for this is 5% of the disk capacity, so if the root user has been carelessly filling the disk, you may see up 
to 105% of the available capacity in use. 
If the 5% value is not appropriate for you, you can change it with the 
tunefs(8)
 command. 
14.15 - Recovering partitions after deleting the disklabel
If you have a damaged partition table, there are various things you can attempt to do to recover it. 
Firstly, panic. You usually do so anyways, so you might as well get it over with. Just don't do anything stupid. 
Panic away from your machine. Then relax, and see if the steps below won't help you out. 
A copy of the disklabel for each disk is saved in 
/var/backups
as part of the daily system maintenance. 
Assuming you still have the var partition, you can simply read the output, and put it back into disklabel. 
In the event that you can no longer see that partition, there are two options. Fix enough of the disc so you can see 
it, or fix enough of the disc so that you can get your data off. Depending on what happened, one or other of those 
may be preferable (with dying discs you want the data first, with sloppy fingers you can just have the label) 
The first tool you need is 
scan_ffs(8)
(note the underscore, it isn't called "scanffs"). scan_ffs(8) will look through 
a disc, and try and find partitions and also tell you what information it finds about them. You can use this 
information to recreate the disklabel. If you just want 
/var
back, you can recreate the partition for 
/var
, and 
then recover the backed up label and add the rest from that. 
disklabel(8)
will update both the kernel's understanding of the disklabel, and then attempt to write the label to 
disk. Therefore, even if the area of the disk containing the disklabel is unreadable, you will be able to 
mount(8)
 it 
until the next reboot. 
http://www.openbsd.org/faq/faq14.html (24 of 34)9/4/2011 10:02:25 AM


14 - Disk Setup

Download 1.27 Mb.

Do'stlaringiz bilan baham:
1   ...   221   222   223   224   225   226   227   228   ...   258




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling