Re: problem while creating new partition



On Mar 31, 10:36 am, David Bolt <blacklist...@xxxxxxxxxx> wrote:
On Sat, 31 Mar 2007, mmccaws2 <mmcc...@xxxxxxxxxxx> wrote:-

<snip>

Filesystem Size Used Avail Use% Mounted on
/dev/sdb5 39G 36G 653M 99% /
/dev/sdb1 108G 23G 80G 22% /home

<Snip>

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 5196 19457 114559483+ 83 Linux
/dev/sdb2 129 5195 40700677+ f W95 Ext'd
(LBA)
/dev/sdb3 1 128 1028128+ 82 Linux swap /
Solaris
/dev/sdb5 129 5195 40700646 83 Linux

Based on the results of fdisk and df, make sure you're logged in as root
on one of the consoles. Then, make sure _all_ the other users are logged
off. This includes any that are connected over a network, or those using
a graphical desktop.

Next, use the following commands:

init 1
umount /home
mv /home /home.old
mkdir -p /home
mount /home
init $(runlevel | awk '{print $1}')

Now for an explanation as to what they do:

The command "init 1" will drop the system into single-user, no-network
mode. This is required so as to make sure there are no open files on the
mounted /home .

The command "umount /home" should be self-explanatory. If it isn't, it
un-mounts whatever partition is mounted on /home .

The "mv /home /home.old" command renames the directory /home as
/home.old . As you weren't initially using a separate /home partition,
all the files and directories you had before adding the separate
partition as /home should now appear in /home.old .

The "mkdir -p /home" will create a new, empty /home directory ready to
mount the partition containing your new /home .

And this is exactly what happens when you use the "mount /home" command.

Finally, the "init $(runlevel | awk '{print $1}')" command will take the
system back to the previous run-level[0].

Then, all you need to do is copy the contents of /home.old into /home,
taking care not to overwrite any files. In the case where a file exists
in both /home.old and /home, you'll need to examine them both to decide
which one to keep.

[0] To do this I've used the command runlevel, which displays a short
string consisting of the previous run-level, and the present one,
separated by a space. The output from "runlevel" is piped to awk, which
separates the input string into pieces, in this case using a space as
the separator. The '{print $1}' tells awk to print the character(s) upto
the first separator, which would be the previous run-level. Finally,
because the runlevel | awk commands are enclosed in $(), the output from
awk is passed to init as a parameter, thereby telling init to go back to
the previous run-level. It's a long-winded way of making sure you don't
go back to the wrong one[1].

[1] Which I have done on one occasion. I was logged on to a console, at
the same time as using a GUI desktop. I dropped to run-level 1, to
perform a similar task[2] and forgot I was using the GUI, so jumped back
to run-level 3 instead of 5.

[2] In my case I had added another drive and was moving /usr and /home
onto partitions on the new drive. At the same time, I also moved the
contents of /opt onto the partition that was /usr as adding lots of
extra KDE and Gnome stuff was rapidly filling up / .

Regards,
David Bolt

--
Member of Team Acorn checking nodes at 50 Mnodes/s:http://www.distributed.net/
RISCOS 3.11 | SUSE 10.0 32bit | SUSE 10.1 32bit | openSUSE 10.2 32bit
RISCOS 3.6 | SUSE 10.0 64bit | SUSE 10.1 64bit | openSUSE 10.2 64bit
TOS 4.02 | SUSE 9.3 32bit | | openSUSE 10.3a2 32bit



Great advice. It works great now. You saved me many many hours. I
really appreciate it.

Thanks again

Mike

what is riscos ?

.



Relevant Pages

  • Re: problem while creating new partition
    ... As you weren't initially using a separate /home partition, ... The '' tells awk to print the characterupto ... which would be the previous run-level. ...
    (alt.os.linux.suse)
  • Re: Getting rid of /boot
    ... nothing (unless it's on a partition that has to be formatted for ... etc.) if it is a separate LV (or if it's on a separate ... There's always a /home directory on the root filesystem. ... Chuckle, that beats me, my first install was RH5.0. ...
    (Fedora)
  • Re: Hard Disk Partition Problem
    ... The counter argument as you know on separate pagefiles. ... How to configure paging files for optimization and recovery in Windows ... more drives is better for larger hard drives!. ... Here are some general thoughts on how to partition: ...
    (microsoft.public.windowsxp.general)
  • Re: Changing default partition for storage of data in vista
    ... The main drive to have a separate data partition is that when you have to either redo or return to a previous image of the operating system partition you do not lose your data. ... There are just so many good reasons to have multiple partitions and drives that I have to think that those who rail against the practice are either too lazy to set their computer up in this fashion or the intricacies of doing so are beyond their competence level. ... dangers by backup to external media. ...
    (microsoft.public.windows.vista.file_management)
  • Re: New year, clean install, any advantage to having applications on D: instead of C:?
    ... I just use a separate directory instead of a separate partition. ... I just use it for my txt and doc files. ... Not an off-site backup, but neither are ...
    (uk.comp.homebuilt)