Re: problem while creating new partition
- From: "mmccaws2" <mmccaws@xxxxxxxxxxx>
- Date: 31 Mar 2007 13:31:55 -0700
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 ?
.
- References:
- problem while creating new partition
- From: mmccaws2
- Re: problem while creating new partition
- From: David Bolt
- Re: problem while creating new partition
- From: mmccaws2
- Re: problem while creating new partition
- From: David Bolt
- problem while creating new partition
- Prev by Date: Re: problem while creating new partition
- Previous by thread: Re: problem while creating new partition
- Next by thread: ATI PCI 9250 and opensuse 10.2
- Index(es):
Relevant Pages
|