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

Re: df reports wrong partition sizes?

Ron Farrer wrote:

> Marc O. Sandlus (Marc.O.Sandlus@ruhr-uni-bochum.de) wrote:
> > It appears from this list, that /usr/src was mounted *before* /usr
> > I guess that this causes your problems, since the mount point /usr/src didn't
> > exist (yet) at the time /dev/sda7 was mounted.
> Quite possible! Here is my fstab:
> # /etc/fstab: static file system information.
> #
> # <file system> <mount point> <type> <options>                  <dump>
> # <pass>
> /dev/sda8       /             ext2   defaults,errors=remount-ro 0      1
> /dev/sda6       none          swap   sw                         0      0
> proc            /proc         proc   defaults                   0      0
> /dev/sda7 /usr/src ext2 defaults 0 2
> /dev/sdb5 /usr ext2 defaults 0 2
> /dev/sda5 /bp vfat defaults 0 2
> So sda7 *does* get mounted before sdb5. Should I change it or will I
> screw up anything with such a screwy partitioning scheme?

Yes, you should change it, but be careful:
All your files in /usr/src actually reside on /dev/sdb5 (yes, the same as /usr).
/dev/sda7 will be empty! You have wasted 595952 kB till now (maybe you will find
some old files on /dev/sda7, from a time before you changed /etc/fstab)

If you just re-order the two lines in /etc/fstab you will miss the files which are
in /usr/src now, so I suggest you do the following (as root at bash prompt #):

1. Unmount hidden partition:
# umount /dev/sda7

2. Check if you can still see the files in /usr/src:
# ls -RAal /usr/src
If you get an error here or if /usr/src does not contain the files it used to
contain: *stop now*, I was wrong; if not, procede and you'll gain 600 MB!

3. Get /usr/src out of your way:
# mv /usr/src /usr/src.backup

4. Create new dir:
# mkdir /usr/src

5. Mount /dev/sda7 again (now it gets mounted *after* /dev/sdb5):
# mount /dev/sda7

6. Check if /usr/src is empty (if you want, backup files in case it's not empty):
# ls -RAal /usr/src
# mkdir /usr/src_dev_sda7.backup
# cp -a /usr/src /usr/src_dev_sda7.backup

7. Free space on /usr/src, in case it wasn't empty (see 6.) (treat file starting
with "." inside /usr/src/ separately; 8. likewise)
# rm -rf /usr/src/*

8. Copy files from partition /dev/sdb5 to /dev/sda7:
# cp -a /usr/src.backup/* /usr/src

9. Change /etc/fstab by swapping the two lines regarding /usr and /usr/src

Don't forget to delete your backups if you feel confident that this procedure

I would be happy to receive your report,
Good luck,

Reply to: