# Partition problem and corruption



## Deleted member 9563 (Nov 7, 2013)

I think I may have made an error because the system sometimes crashes on reboot. It runs fine otherwise. It says there is a problem with ada0p4 but a `fsck` allows me to boot again.

I had decided to make a separate /tmp partition (ada0p4) as part of the scheme, and the problem may be there, or perhaps I should have done something to align sectors after making a 512K boot partition. Here is what I have:


```
% gpart show
=>       34  976773101  ada0  GPT  (465G)
         34       1024     1  freebsd-boot  (512k)
       1058   41943040     2  freebsd-ufs  (20G)
   41944098   20971520     3  freebsd-swap  (10G)
   62915618   41943040     4  freebsd-ufs  (20G)
  104858658   67108864     5  freebsd-ufs  (32G)
  171967522   20971520     6  freebsd-ufs  (10G)
  192939042  782237696     7  freebsd-ufs  (373G)
  975176738    1596397        - free -  (779M)
```


```
% df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ada0p2     19G    2.9G     15G    16%    /
devfs          1.0k    1.0k      0B   100%    /dev
/dev/ada0p4     19G     48M     17G     0%    /tmp
/dev/ada0p5     31G    7.8G     20G    27%    /usr
/dev/ada0p6    9.7G     34M    8.9G     0%    /x
/dev/ada0p7    361G    487M    331G     0%    /home
fdescfs        1.0k    1.0k      0B   100%    /dev/fd
procfs         4.0k    4.0k      0B   100%    /proc
```

Is there a problem with that? How should I move forward?


----------



## trh411 (Nov 7, 2013)

There is no problem per se in having a separate /tmp partition. Have you booted into single use mode and run `# fsck -y /dev/ada0p4`?


----------



## wblock@ (Nov 7, 2013)

It's not aligned, but the only problem that will cause is slow writes on a 4K drive. A 500GB drive probably does not use 4K blocks.

What is the error message?

Please show your /etc/fstab.


----------



## Deleted member 9563 (Nov 8, 2013)

I cannot remember the exact message, but upon boot it stops before the shell and I'll see something like "enter full pathname of shell or return". I've hit return and at the shell prompt typed `fsck` - then answered yes to all.

My /etc/fstab:


```
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/ada0p2     /               ufs     rw      1       1
/dev/ada0p3     none            swap    sw      0       0
/dev/ada0p4     /tmp            ufs     rw      2       2
/dev/ada0p5     /usr            ufs     rw      2       2
/dev/ada0p6     /x              ufs     rw      2       2
/dev/ada0p7     /home           ufs     rw      2       2
#
fdesc   /dev/fd         fdescfs         rw      0       0
proc    /proc           procfs          rw      0       0
```


----------



## trh411 (Nov 8, 2013)

Unless I'm mistaken, if you do not specify a filesystem to check, `fsck` will only check mounted filesystems as found in /etc/fstab that have non-zero pass numbers. In single user mode, that would only be the / filesystem, which is mounted as "ro". The /tmp filesystem is not mounted at that point, and therefore would not be checked.

I would try again, using the following explicit command: `# fsck -y /dev/ada0p4`


----------



## Deleted member 9563 (Nov 8, 2013)

Thanks @trh411. Each time it _did_ go through all partitions as far as I could tell. (I've been wrong before though  ) I'm using the computer right now,  but will try you suggestion shortly.

Edit:  I'm back. That was uneventful. No system complaints. The messages upon boot reported all file systems as clean. That's what normally happens, except once in a while.


----------



## Deleted member 9563 (Nov 8, 2013)

I'm wondering if the USB drive which is plugged in, can confuse things. Nevertheless, if computer will continue to operate and no actual files are corrupted, then perhaps I shouldn't worry. I'm just a bit paranoid.  This is a new system and OS installation so now would be the time to fix things if there is some fundamental problem.


----------



## wblock@ (Nov 8, 2013)

Without knowing the actual error, it's hard to tell.  A USB drive should not cause problems.


----------



## Deleted member 9563 (Nov 8, 2013)

wblock@ said:
			
		

> Without knowing the actual error, it's hard to tell.  A USB drive should not cause problems.



If it happens again, I will take more careful note - (beyond just freaking out and running fsck right away).

Thanks for the reassurance - particularly regarding the alignment. That was worrying me. For now I will continue with the machine as is, and make any alignment and other changes at some later date when I fell I need to redo the system.

Thanks all for your help.


----------

