Re: Reconfiguring a second partition for data storage in SuSE 9.0

From: Thomas (tdshepard_at_comcast.net)
Date: 02/27/04


Date: 27 Feb 2004 08:33:56 -0800

smugzilla@sbcglobal.net (sz) wrote in message news:<5f1c6b6c.0402261216.156429@posting.google.com>...
> A few weeks ago I installed SuSE 9.0 to a dual-boot WinXP/Linux
> system. I didn't play around with customization settings very much,
> especially when it came to deciding how to use my available disk
> space. Linux is on the second HDD, which has several partitions. I'm
> trying to configure my system so that my empty partition mounts to a
> subdirectory of my home directory (this is a single-user box).

It looks like you are new to this. (Please forgive me if I am wrong
about that.)
So the first advice I have is to be very careful and make sure you
know what you are doing. What to you mean by your "empty partition?"

>
> The first three lines of fstab describing the linux drive are here:
>
> /dev/hdb4 / reiserfs defaults
> 1 1
> /dev/hdb2 /home/pete/str auto defaults
> 0 0
> /dev/hdb3 swap swap pri=42
> 0 0
>
Just a comment: Reiserfs is alleged to be great for lots of reasons.
But I hear it doesn't work well with nfs. If you think you might ever
want to nfs mount this volume, you should consider switching to ext3.

I also don't like the "auto" specification on your /dev/hdb2. It
should work, but why complicate things when this is a partition on a
hard drive whose filesystem type is knowable? I recommend changing
that to whatever is the real filesystem type, reiserfs I assume.

I also think it would be a good idea to change the "0 0" at the end of
the /dev/hdb2 line to "1 2". If you ever decide to backup your drives,
which is, of course, very important you might be doing this via
"dump." The first 0 says that the partition should NOT be backed up.
Not smart. The second 0 says not to check filesystem integrity with
fsck at boot time. Changing to 2 says to check the integrity but do
the ones with "1" first (the root partition). You can ignore this
entire paragraph if your /home/pete/str directory never holds any data
that could be either corrupted by, for example, an improper shutdown,
or for which total loss would be of no consequence. That would be true
for your swap partition, for example.

> The problem I'm getting is that hdb2 has what looks like a nearly
> complete root file system loaded onto it, with huge /bin, /boot and
> /dev directories. Do I need any of this stuff, why is it there in the
> first place, and how can I get rid of it so that I have a nice, clean
> partition on hdb2 where I can store some data? What options should I
> be setting in fstab?

How do you know that you have a complete root file system on hdb2 and
you are not actually looking at the "real" root file system on hdb4?

Here is a test that should help:

First do a "df" at the shell prompt to list all the mounted file
systems.

Log in with a shell prompt as root and unmount the home file system:

cd /
umount /dev/hdb2

Note: there is no "n" in "umount." The umount will fail if any process
is accessing /dev/hdb2. If you can't figure out what processes are
tying up /dev/hdb2, read the fuser man page for a solution. The "cd /"
should make sure it isn't your interactive shell.

Then do

cd /mnt
ls

and take a look at the files in /mnt and choose a name for a new mount
point that doesn't conflict with an existing file or directory.
Assuming you don't already have something called /mnt/test, then do

mkdir test
mount -t auto /dev/hdb2 /mnt/test

Now look in /mnt/test. You should see whatever you previously had in
the "str" subdirectory under your home directory. Do you see anything
that looks like the "nearly complete root file system" you mentioned
above? If not, you were wrong when you thought it was located on
/dev/hdb2. You might have been deceived by symlinks, for example, or
there are other possibilities. Make sure they are not symlinks.

If, in fact, these /bin, /boot, and /dev directories are still there,
then you are probably right. BUT, THIS IS VERY IMPORTANT, report back
to us with your findings before you delete anything. There are still
other things to watch out for. Although it would seem like a strange
way to set up a distro, it would be possible for the /bin, /boot, and
/dev directories double-mounted, so that the ones in your "str"
directory are the same physical directories as the ones under root.
This is possible even if they do not reside on separate partitions. It
is also possible to write a kernel module that would make them appear
there even though they were physically elsewhere (virtual file
systems).

While you are logged in as root, it would be a good idea to VERY
CAREFULLY run "fdisk" or a similar utility to look at all your
partitions, mounted or not.

fdisk /dev/hda
...<startup announcement>...
Command (m for help): p
...<it shows all the partitions on hda>...
Command (m for help): quit

Then repeat using fdisk /dev/hdb.

WARNING: mis-typed commands to fdisk can wipe out your entire drive.
But as long as you type "quit" (or "q") when you exit, you will be OK.
The output from this should at least tell us what other partitions
exist other than the ones shown in /etc/fstab.

Also, the "df" command will list all the MOUNTED file systems, whether
or not they are in /etc/fstab. After thinking about this, I realize
that you should issue the "df" before doing the umount stuff as well.

Finally, to clean up, do this

umount /dev/hdb2
mount /dev/hdb2
ls /mnt/test
(Make sure /mnt/test is empty, or else don't try the next command)
rmdir /mnt/test



Relevant Pages

  • Re: Trying to move /usr - Fixed
    ... After thinking about that mv command, ... Note /dev/ad8s1e is an empty partition (a new disk, ... I'll use user and usrdemo as the names of the ... the root of the file system. ...
    (freebsd-questions)
  • Re: Trying to move /usr
    ... Note /dev/ad8s1e is an empty partition (a new disk, ... to overwrite my own usr directory needlessly. ... Check our partition after the df command, ... the root of the file system. ...
    (freebsd-questions)
  • Re: [SLE] fsck when uptime cannot be broken?
    ... But if you look at the system and the fsck command, ... see that you can set the number of reboots or time before the command ... getting any errors then the file system is fine. ... wouldn't take a partition off-line. ...
    (SuSE)
  • Re: SanDisk Mini Cruzer USB memory stick
    ... I tried the to see if it would still mount: ... No real file system on the stick. ... Enter "d" to delete the partition tables one by one ... Have the Flash Drive formatted by FAT file system with the command ...
    (Fedora)
  • Re: No longer can connect
    ... but I get all sorts off command not found errors ... built for a different operating system, or a different version of your ... Forcing an fsck of the root file system ...
    (SSH)