How to move /home dir, which is now a sub-dir of root, to a separate
partition? To be able to upgrade/alter system without affecting main
data.
Printable View
How to move /home dir, which is now a sub-dir of root, to a separate
partition? To be able to upgrade/alter system without affecting main
data.
zeno wrote:[color=blue]
> How to move /home dir, which is now a sub-dir of root, to a separate
> partition? To be able to upgrade/alter system without affecting main
> data.[/color]
It is not clear what or why you are trying to do this.
It is best to move home to a new drive rather than partition.
But if partition is what you mean why does not mv work?
--
How is sending 22,000 troops to Iraq a better plan than sending 130,000
troops to Iraq?
-- The Iron Webmaster, 3746
nizkor [url]http://www.giwersworld.org/nizkook/nizkook.phtml[/url]
flying saucers [url]http://www.giwersworld.org/flyingsa.html[/url] a2
On 2007-05-18, Matt Giwer <jull43@tampabay.REMover.rr.com> wrote:[color=blue]
> zeno wrote:[color=green]
>> How to move /home dir, which is now a sub-dir of root, to a separate
>> partition? To be able to upgrade/alter system without affecting main
>> data.[/color]
>
> It is not clear what or why you are trying to do this.[/color]
It's not? The OP seems to have originally placed /home on the
/ partition, and now wants it on its own partition. He probably
wants to be able to erase / without disturbing /home.
[color=blue]
> It is best to move home to a new drive rather than partition.[/color]
Why?
[color=blue]
> But if partition is what you mean why does not mv work?[/color]
If users are logged in moving /home could cause problems. The
most sure way is to go to runlevel 1, log in directly as root, and
then move /home to its final destination e.g.
mount /dev/hda88 /mnt/newhome
cd /home
tar cf - . | (cd /mnt/newhome;tar xvf -)
# (force of habit; the equivalent mv should work too)
# verify newhome is good; then
rm -rf /home
# or
mv /home /oldhome
mkdir /home
mount /dev/hda88 /home
# now edit /etc/fstab and add an entry for /home
If runlevel 1 is not an option, then set /etc/nologin or equivalent
(like beating your users over the head with a hockey stick if they
log in), kill off any processes using /home (lsof can help here), then
do the above.
You need to remove or move the old /home before mounting the new
/home if you want to be able to eventually free up that space without
having to umount the new /home. If you don't move it out of the way,
the new mount will mask the existing files, and there will be no way
to delete them without umounting the new /home.
--keith
--
[email]kkeller-usenet@wombat.san-francisco.ca.us[/email]
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information
Keith Keller wrote:[color=blue]
> On 2007-05-18, Matt Giwer <jull43@tampabay.REMover.rr.com> wrote:[color=green]
>> zeno wrote:[color=darkred]
>>> How to move /home dir, which is now a sub-dir of root, to a separate
>>> partition? To be able to upgrade/alter system without affecting main
>>> data.[/color]
>> It is not clear what or why you are trying to do this.[/color]
>
> It's not? The OP seems to have originally placed /home on the
> / partition, and now wants it on its own partition. He probably
> wants to be able to erase / without disturbing /home.[/color]
Now that you repeat it and I have to read it again, yes, it is clear. I guess I
was thinking "he can't mean that" the first time through.
[color=blue][color=green]
>> It is best to move home to a new drive rather than partition.[/color][/color]
[color=blue]
> Why?[/color]
I have read it is for security. I never quite got full reasons but it is
supposed to be related to the reason /root and /home are separate on the same
disk. When sysadmins for software companies who have just as many disgruntled
employees as anyone else I pay attention to their suggestions.
[color=blue][color=green]
>> But if partition is what you mean why does not mv work?[/color][/color]
[color=blue]
> If users are logged in moving /home could cause problems.[/color]
The system is going down in five minutes.
Work it into an upgrade.
But frankly I doubt sysadmins are here asking questions like this. I assume
most questioners are home users like me. I mostly only respond to questions
where I have made a similar mistake and corrected it. You can look at how many I
respond to as an indication of how many times I have screwed up. Most everything
I suggest is the same or similar to what has worked for me. Some of the most
desperate kludges have been stable.
[color=blue]
> The
> most sure way is to go to runlevel 1, log in directly as root, and
> then move /home to its final destination e.g.[/color]
[color=blue]
> mount /dev/hda88 /mnt/newhome
> cd /home
> tar cf - . | (cd /mnt/newhome;tar xvf -)[/color]
[color=blue]
> # (force of habit; the equivalent mv should work too)
> # verify newhome is good; then
> rm -rf /home
> # or
> mv /home /oldhome
> mkdir /home
> mount /dev/hda88 /home
> # now edit /etc/fstab and add an entry for /home[/color]
[color=blue]
> If runlevel 1 is not an option, then set /etc/nologin or equivalent
> (like beating your users over the head with a hockey stick if they
> log in), kill off any processes using /home (lsof can help here), then
> do the above.[/color]
[color=blue]
> You need to remove or move the old /home before mounting the new
> /home if you want to be able to eventually free up that space without
> having to umount the new /home. If you don't move it out of the way,
> the new mount will mask the existing files, and there will be no way
> to delete them without umounting the new /home.[/color]
One hopes he is reading this.
--
What the English language needs most is a word that rhymes with orange.
-- The Iron Webmaster, 3749
nizkor [url]http://www.giwersworld.org/nizkook/nizkook.phtml[/url]
flying saucers [url]http://www.giwersworld.org/flyingsa.html[/url] a2
Matt Giwer writes:[color=blue]
> But frankly I doubt sysadmins are here asking questions like this. I
> assume most questioners are home users like me.[/color]
Most are home users but an appalling (and frustrating) number are admins
(often with even more basic questions than this one).
--
John Hasler
[email]john@dhh.gt.org[/email]
Dancing Horse Hill
Elmwood, WI USA
On 2007-05-19, Matt Giwer <jull43@tampabay.REMover.rr.com> rambled on thusly:
[color=blue]
> I have read it is for security. I never quite got full reasons but it is
> supposed to be related to the reason /root and /home are separate on the same
> disk. When sysadmins for software companies who have just as many disgruntled
> employees as anyone else I pay attention to their suggestions.[/color]
Security makes absolutely no sense at all in this context. Under Linux (and
most other *NIXes), physical drives are irrelevant, security is controlled
at the filesystem level. Someone with access to /home has access to /home,
no matter where it sits physically.
There are good reasons to separate /home from the rest of the filesystem,
though. For one, it allows an easy separation of data from the system. The
OS can be removed and a new OS installed without causing problems with the
data. It also allows a bit of redundancy: if the system drive crashes, the
data drive is still okay.
This also allows for easier addition of space on /home. If /home is put on
a RAID array, drives can easily be added to the array to transparently
increase the amount of storage available.
--
Michael Fierro (aka Biffster) [email]biffster@NOSPAM-REALLYgmail.com[/email]
[url]http://apt-get.biffster.org[/url] Y!: miguelito_fierro AIM: mfierro1
--
Bother, said Pooh as he realized he couldn't speak Klingon.
On 2007-05-19, Matt Giwer <jull43@tampabay.REMover.rr.com> wrote:[color=blue]
> Keith Keller wrote:[color=green]
>> On 2007-05-18, Matt Giwer <jull43@tampabay.REMover.rr.com> wrote:[/color]
>[color=green][color=darkred]
>>> It is best to move home to a new drive rather than partition.[/color][/color]
>[color=green]
>> Why?[/color]
>
> I have read it is for security. I never quite got full reasons but it is
> supposed to be related to the reason /root and /home are separate on the same
> disk. When sysadmins for software companies who have just as many disgruntled
> employees as anyone else I pay attention to their suggestions.[/color]
You should ask them why they do these things before posting suggestions
that are not necessarily true.
In this case, one might put /home on a separate disk for performance
gains: with (say) /var and /home on separate disks the writes to each
filesystem won't compete with each other for write time (as much,
anyway). I can't possibly imagine how you'd enhance security by having
/home and / on separate disks, unless one of the disks is in a removable
drive bay and another isn't.
[color=blue][color=green][color=darkred]
>>> But if partition is what you mean why does not mv work?[/color][/color]
>[color=green]
>> If users are logged in moving /home could cause problems.[/color]
>
> The system is going down in five minutes.
>
> Work it into an upgrade.
>
> But frankly I doubt sysadmins are here asking questions like this. I assume
> most questioners are home users like me.[/color]
You're still administering your system. And, as John points out, you
never know what the quality of sysadmins is like out there--the OP is
likely a solo home user, but might not be.
--keith
--
[email]kkeller-usenet@wombat.san-francisco.ca.us[/email]
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information
John Hasler wrote:[color=blue]
> Matt Giwer writes:[color=green]
>> But frankly I doubt sysadmins are here asking questions like this. I
>> assume most questioners are home users like me.[/color]
>
> Most are home users but an appalling (and frustrating) number are admins
> (often with even more basic questions than this one).[/color]
Know anyone who is hiring? ;)
One hopes you are in error.
--
Cavemen blamed the end of the Ice Age on the invention of fire.
-- The Iron Webmaster, 3753
nizkor [url]http://www.giwersworld.org/nizkook/nizkook.phtml[/url]
environmentalism [url]http://www.giwersworld.org/environment/aehb.phtml[/url] a9
Michael Fierro wrote:[color=blue]
> On 2007-05-19, Matt Giwer <jull43@tampabay.REMover.rr.com> rambled on thusly:[color=green]
>> I have read it is for security. I never quite got full reasons but it is
>> supposed to be related to the reason /root and /home are separate on the same
>> disk. When sysadmins for software companies who have just as many disgruntled
>> employees as anyone else I pay attention to their suggestions.[/color][/color]
[color=blue]
> Security makes absolutely no sense at all in this context. Under Linux (and
> most other *NIXes), physical drives are irrelevant, security is controlled
> at the filesystem level. Someone with access to /home has access to /home,
> no matter where it sits physically.[/color]
Frankly I can't think of a reason other than an accidental typo for root to be
in a separate directory. So when I read several people over the years saying it
adds security to have a separate drive I am not going to argue. I do not see it.
But clearly this OS was developed by companies whose main product is software.
When there is a risk of disgruntled employees knowing more about the OS than the
sysadmins I take assume the more separation the better. From my time in DOD the
computers that do the classified work are completely separate from all networks
and sit inside Faraday cages.
I do know of exploits that if possible to install are not going propagate past
the drive it is on unless it happens to know of the symlink and its name and
where it is on the first drive. You can't hurt it if you can't find it.
[color=blue]
> There are good reasons to separate /home from the rest of the filesystem,
> though. For one, it allows an easy separation of data from the system. The
> OS can be removed and a new OS installed without causing problems with the
> data. It also allows a bit of redundancy: if the system drive crashes, the
> data drive is still okay.[/color]
And that I have done first with a failing drive and then with an added drive.
In fact I had symlinks going to another drive and back again to work around one
problem. What I have done I will more freely talk about.
[color=blue]
> This also allows for easier addition of space on /home. If /home is put on
> a RAID array, drives can easily be added to the array to transparently
> increase the amount of storage available.[/color]
I can't comment on RAID arrays. Never even figured out how they are different
or better much less why I might want one.
I began answering questions here barely six months after I started asking them
because I had the same problem and solved it. I appreciated the answers I got
even if off the wall as they expanded my knowledge of linux and suggested things
that, even it not quite the answer, lead to a solution. I do not claim to know
all the answers or even a few of them. I simply try to return the favor for what
I was given. So far not one person I have tried to help has complained. If that
is the best I can do, so be it.
--
You hate America if you suggest it can do other than pure good.
-- The Iron Webmaster, 3755
nizkor [url]http://www.giwersworld.org/nizkook/nizkook.phtml[/url]
Lawful to bomb Israelis [url]http://www.giwersworld.org/israel/bombings.phtml[/url] a11
Keith Keller wrote:[color=blue]
> On 2007-05-19, Matt Giwer <jull43@tampabay.REMover.rr.com> wrote:[color=green]
>> Keith Keller wrote:[color=darkred]
>>> On 2007-05-18, Matt Giwer <jull43@tampabay.REMover.rr.com> wrote:
>>>> It is best to move home to a new drive rather than partition.
>>> Why?[/color]
>> I have read it is for security. I never quite got full reasons but it is
>> supposed to be related to the reason /root and /home are separate on the same
>> disk. When sysadmins for software companies who have just as many disgruntled
>> employees as anyone else I pay attention to their suggestions.[/color][/color]
[color=blue]
> You should ask them why they do these things before posting suggestions
> that are not necessarily true.[/color]
If I knew what was necessarily true about linux I would not much of anything
even if right or even if it just worked. Good ideas are never necessarily true.
In fact off hand other than rm -f / ...
[color=blue]
> In this case, one might put /home on a separate disk for performance
> gains: with (say) /var and /home on separate disks the writes to each
> filesystem won't compete with each other for write time (as much,
> anyway). I can't possibly imagine how you'd enhance security by having
> /home and / on separate disks, unless one of the disks is in a removable
> drive bay and another isn't.[/color]
As I answered in another post, I can't come up with a good argument other than
human error for having /home and /root separate. If everything is passworded and
permissioned I don't see a problem.
I am not here to fight anyone. I don't like arguing computer stuff because
there are so many ways to be right or at least harmelss that I doubt anyone can
know them all.
But I do think making suggestions which might help is better than remaining
silent. When I was asking for help most suggestions did not help the problem but
they did help me learn linux. I appreciated even the useless answers. There was
information in them.
BTW, the whole issue of separate drives is moot these days. I only mentioned it
in this case as he said it was an upgrade and not knowing the old size it might
have applied. You can't get drives smaller than 40GB these days and you can't
find a linux that uses 10% of that. I got into the issue I brought up when I had
6, 10 and lastly 40 GB drives on a 333MHz machine I was keeping alive as a smart
terminal for three better machines. That is all long gone history as now I am
managing 1.3TB on a single 3GHz machine.
[color=blue][color=green][color=darkred]
>>>> But if partition is what you mean why does not mv work?
>>> If users are logged in moving /home could cause problems.[/color]
>> The system is going down in five minutes.
>> Work it into an upgrade.
>> But frankly I doubt sysadmins are here asking questions like this. I assume
>> most questioners are home users like me.[/color][/color]
[color=blue]
> You're still administering your system. And, as John points out, you
> never know what the quality of sysadmins is like out there--the OP is
> likely a solo home user, but might not be.[/color]
And if he is not like me then he should deal with my semi-annual problems every
day or his staff should. I don't see anyone who does this for a living doing
other than contacting the vendor for assistance. Vendor as in Redhat EL where
they make a living on support. Why would people who paid for vendor support be
posting here?
--
May 1 has been declared Mission Accomplished Day.
-- The Iron Webmaster, 3760
nizkor [url]http://www.giwersworld.org/nizkook/nizkook.phtml[/url]
Larry Shiff [url]http://www.giwersworld.org/computers/newsagent.phtml[/url] a8
Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> wrote:[color=blue]
> anyway). I can't possibly imagine how you'd enhance security by having
> /home and / on separate disks, unless one of the disks is in a removable
> drive bay and another isn't.[/color]
Well, if we could write-protect the disks, / could in theory be mounted on read
only media, and /home would then go on a separate writable disk. That would be
nice.
Mark.
--
Mark Hobley
393 Quinton Road West
QUINTON
Birmingham
B32 1QE
Email: markhobley at hotpop dot donottypethisbit com
[url]http://markhobley.yi.org/[/url]
Matt Giwer <jull43@tampabay.REMover.rr.com> writes:
[color=blue]
>Michael Fierro wrote:[color=green]
>> On 2007-05-19, Matt Giwer <jull43@tampabay.REMover.rr.com> rambled on thusly:[color=darkred]
>>> I have read it is for security. I never quite got full reasons but it is
>>> supposed to be related to the reason /root and /home are separate on the same
>>> disk. When sysadmins for software companies who have just as many disgruntled
>>> employees as anyone else I pay attention to their suggestions.[/color][/color][/color]
[color=blue][color=green]
>> Security makes absolutely no sense at all in this context. Under Linux (and
>> most other *NIXes), physical drives are irrelevant, security is controlled
>> at the filesystem level. Someone with access to /home has access to /home,
>> no matter where it sits physically.[/color][/color]
[color=blue]
> Frankly I can't think of a reason other than an accidental typo for root to be
>in a separate directory. So when I read several people over the years saying it[/color]
Well, let me give you a reason-- suddenly the partition containing /home
goes on the blink. Suddenly root no longer has its home directory eitehr.
Or you come up in single user mode without mounting /home.
/root is placed on the partition which must be there in order for the
system to boot at all. This gives root all of its home directory setups in
order to fix things.
....
In comp.os.linux.setup, zeno
<geoffrey.froner@gmail.com>
wrote
on 17 May 2007 21:21:13 -0700
<1179462073.074550.120320@q75g2000hsh.googlegroups.com>:[color=blue]
> How to move /home dir, which is now a sub-dir of root, to a separate
> partition? To be able to upgrade/alter system without affecting main
> data.
>[/color]
First, do you have a partition? If not, you have some
work to do! ;-) If you do have a spare partition, you can
do something along the following lines. All of these are
of course to be run as root, and /dev/hdax is the device
-- 'x' is a number, and even 'a' can change if one has
multiple drives (the second one is 'b', for example).
[1] mv /home /home.old
[2] mkdir /home
[3] chmod 755 /home
[4] edit /etc/fstab, adding a line similar to the following.
/dev/hdax /home ext3 noatime 1 1
/dev/hdax is the new partition location.
/home is the directory you wish to mount during bootup.
ext3 is the filesystem type.
It is possible /etc/fstab may not be using /dev/hdax, but
hopefully the comments are clear in that case. Not all
Linux systems use /dev/hdax; some use volume identifiers.
[5] mkfs.ext3 /dev/hdax
This prepares the partition for mounting, by writing out
(erasing, if there's already stuff on it!) blocks in
special locations (one of them's called the superblock)
and generally ensuring things are emptied/readied.
[6] mount /dev/hdax /home
And here's the actual mount. During bootup /etc/fstab is read,
and this mount automatically done.
[7] At this point you have some options, depending on how much data you
have and your paranoia.
(a) mv /home.old/* /home
This is the simplest but can be problematic if there's
an error. mv is smart enough to do a copy/delete,
however, if the destination is not on the same
partition as the source -- which is the case here.
(b) cp -rp /home.old/* /home
This doesn't handle symbolic links all that well.
(c) (cd /home.old; tar cf - .) | (cd /home; tar xpf -)
This complicated-looking command is two tar commands end to end.
(d) cd /home.old; tar czf /somewhere/backup/directory/home.dir.tgz .
cd /home; tar xzf /somewhere/backup/directory/home.dir.tgz
This is (c) with compression and an explicit file as an
intermediary. The file is of course a backup of your home directory
at that point in time.
--
#191, [email]ewill3@earthlink.net[/email]
Useless C++ Programming Idea #23291:
void f(item *p) { if(p != 0) delete p; }
--
Posted via a free Usenet account from [url]http://www.teranews.com[/url]
Unruh wrote:[color=blue]
> Matt Giwer <jull43@tampabay.REMover.rr.com> writes:[color=green]
>> Michael Fierro wrote:[color=darkred]
>>> On 2007-05-19, Matt Giwer <jull43@tampabay.REMover.rr.com> rambled on thusly:
>>>> I have read it is for security. I never quite got full reasons but it is
>>>> supposed to be related to the reason /root and /home are separate on the same
>>>> disk. When sysadmins for software companies who have just as many disgruntled
>>>> employees as anyone else I pay attention to their suggestions.
>>> Security makes absolutely no sense at all in this context. Under Linux (and
>>> most other *NIXes), physical drives are irrelevant, security is controlled
>>> at the filesystem level. Someone with access to /home has access to /home,
>>> no matter where it sits physically.[/color][/color][/color]
[color=blue][color=green]
>> Frankly I can't think of a reason other than an accidental typo for root to be
>> in a separate directory. So when I read several people over the years saying it[/color][/color]
[color=blue]
> Well, let me give you a reason-- suddenly the partition containing /home
> goes on the blink. Suddenly root no longer has its home directory eitehr.
> Or you come up in single user mode without mounting /home.
> /root is placed on the partition which must be there in order for the
> system to boot at all. This gives root all of its home directory setups in
> order to fix things.[/color]
Or /root 'goes on the blink' and one again needs to load the backup files or
put the drive in another machine as hdb or hdc or creating a new partition and
installing damn small linux or several other things I am sure.
I don't see a difference regardless of where things are mounted.
--
Why all the concern for Darfur when Iraq is worse?
-- The Iron Webmaster, 3767
nizkor [url]http://www.giwersworld.org/nizkook/nizkook.phtml[/url]
Iraqi democracy [url]http://www.giwersworld.org/911/armless.phtml[/url] a3
On 2007-05-20, Mark Hobley <markhobley@hotpop.deletethisbit.com> rambled on thusly:[color=blue]
> Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> wrote:[color=green]
>> anyway). I can't possibly imagine how you'd enhance security by having
>> /home and / on separate disks, unless one of the disks is in a removable
>> drive bay and another isn't.[/color][/color]
[color=blue]
> Well, if we could write-protect the disks, / could in theory be mounted on read
> only media, and /home would then go on a separate writable disk. That would be
> nice.[/color]
Okay, yeah, I can see that. Good point, eh? :)
--
Michael Fierro (aka Biffster) [email]biffster@NOSPAM-REALLYgmail.com[/email]
[url]http://apt-get.biffster.org[/url] Y!: miguelito_fierro AIM: mfierro1
--
"I may not be a smart man, but I know what love is."
- "Forrest Gump"
On 2007-05-20, Mark Hobley <markhobley@hotpop.deletethisbit.com> wrote:[color=blue]
> Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> wrote:[color=green]
>> anyway). I can't possibly imagine how you'd enhance security by having
>> /home and / on separate disks, unless one of the disks is in a removable
>> drive bay and another isn't.[/color]
>
> Well, if we could write-protect the disks, / could in theory be mounted on read
> only media, and /home would then go on a separate writable disk. That would be
> nice.[/color]
That's a good point, actually. I suppose you could put / onto some sort
of media which supports a physical method of write protection, if you
were a bit paranoid. Actually, IIRC some of the router distributions
support having / on CD and some sort of /home on disk. It'd probably
take a bit of work to get a ''real'' distro to put / on CD. (I could
see putting /usr there, too, in fact, though you'd want most if not all
of the distro installed, or some way of installing additional packages
into /usr/local.)
--keith
--
[email]kkeller-usenet@wombat.san-francisco.ca.us[/email]
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information
Hello and a belated thanks to you and others who responded to my
query. I didnt answer because I wasnt...
Home. As regards /home, I want to put it on a separate partition for
the reasons you mentioned, almost.
I want to install another O.S. (I've got XP, Debian, and now to add
SuSE) and want to protect my data from the impending changes and my
own clumsiness rather than the fear of any outside threats. (Isn't
that interesting? Almost always the danger is from our own system
rather than the barbarian invaders.)
And yes, a number of years ago I did build and administer a Linux
network at college (Mass Bay) but the memories slipped away and Debian
is a bit different than SuSE.
So thank you very much again for your reply.
Geoffrey
On May 18, 11:48 pm, Michael Fierro <the_biffs...@comcast.net> wrote:[color=blue]
> On 2007-05-19, Matt Giwer <jul...@tampabay.REMover.rr.com> rambled on thusly:
>[color=green]
> > I have read it is for security. I never quite got full reasons but it is
> > supposed to be related to the reason /root and /home are separate on the same
> > disk. When sysadmins for software companies who have just as many disgruntled
> > employees as anyone else I pay attention to their suggestions.[/color]
>
> Security makes absolutely no sense at all in this context. Under Linux (and
> most other *NIXes), physical drives are irrelevant, security is controlled
> at the filesystem level. Someone with access to /home has access to /home,
> no matter where it sits physically.
>
> There are good reasons to separate /home from the rest of the filesystem,
> though. For one, it allows an easy separation of data from the system. The
> OS can be removed and a new OS installed without causing problems with the
> data. It also allows a bit of redundancy: if the system drive crashes, the
> data drive is still okay.
>
> This also allows for easier addition of space on /home. If /home is put on
> a RAID array, drives can easily be added to the array to transparently
> increase the amount of storage available.
>
> --
> Michael Fierro (aka Biffster) biffs...@NOSPAM-REALLYgmail.comhttp://apt-get.biffster.org Y!: miguelito_fierro AIM: mfierro1
> --
> Bother, said Pooh as he realized he couldn't speak Klingon.[/color]
On May 18, 12:21 am, zeno <geoffrey.fro...@gmail.com> wrote:[color=blue]
> How to move /home dir, which is now a sub-dir of root, to a separate
> partition? To be able to upgrade/alter system without affecting main
> data.[/color]
June 6, 2007 A belated thanks to those who responded to my query,
many of them were very helpful and some even went beyond the initial
question to other interesting places. I didnt respond earlier because
I was away from.... Home. But now I know how to re-configure my
directories as I wanted to.
Thanks for your suggestions, however, I'm not sure about the
sequences.
First off, I am NOT now an administrator nor are their other users on
my system. No need for explications.
h.googlegroups.com>:[color=blue]
>[color=green]
> > How to move /home dir, which is now a sub-dir of root, to a separate
> > partition? To be able to upgrade/alter system without affecting main data.[/color][/color]
[color=blue]
> First, do you have a partition?[/color]
I can make one.
[color=blue]
> [1] mv /home /home.old
> [2] mkdir /home
>
> [3] chmod 755 /home[/color]
[color=blue]
>From where do I issue this command? The new partition? Or from / ?[/color]
[color=blue]
>
> [4] edit /etc/fstab, adding a line similar to the following.
>
> /dev/hdax /home ext3 noatime 1 1
>
> /dev/hdax is the new partition location.
> /home is the directory you wish to mount during bootup.
> ext3 is the filesystem type.
>
> It is possible /etc/fstab may not be using /dev/hdax, but
> hopefully the comments are clear in that case.[/color]
I'm running Ubuntu 6.06 which seemed a good way to get the feet wet,
except Deb is different. There is an
/etc/fstab file. Okay, is this where we go after creating /dev/
hdax: ? In that case, the previous command:
$ mv /home /old.home is not done? Or is that an alternative to the
following steps?
[color=blue]
>
> [5] mkfs.ext3 /dev/hdax
>
> This prepares the partition for mounting, by writing out
> (erasing, if there's already stuff on it!) blocks in
> special locations (one of them's called the superblock)
> and generally ensuring things are emptied/readied.
>
> [6] mount /dev/hdax /home
>
> And here's the actual mount. During bootup /etc/fstab is read,
> and this mount automatically done.
>
> [7] At this point you have some options, depending on how much data you
> have and your paranoia.
>
> (a) mv /home.old/* /home
>
> This is the simplest but can be problematic if there's
> an error. mv is smart enough to do a copy/delete,
> however, if the destination is not on the same
> partition as the source -- which is the case here.
>
> (b) cp -rp /home.old/* /home
>
> This doesn't handle symbolic links all that well.
>
> (c) (cd /home.old; tar cf - .) | (cd /home; tar xpf -)
>
> This complicated-looking command is two tar commands end to end.
>
> (d) cd /home.old; tar czf /somewhere/backup/directory/home.dir.tgz .
> cd /home; tar xzf /somewhere/backup/directory/home.dir.tgz
>
> This is (c) with compression and an explicit file as an
> intermediary. The file is of course a backup of your home directory
> at that point in time.
>[/color]
Looking forward to clarification.
Thanks,
Zeno (Geoffrey)
In comp.os.linux.setup, zeno
<geoffrey.froner@gmail.com>
wrote
on Wed, 06 Jun 2007 18:46:27 -0000
<1181155587.928272.283800@g37g2000prf.googlegroups.com>:[color=blue]
> Thanks for your suggestions, however, I'm not sure about the
> sequences.
> First off, I am NOT now an administrator nor are their other users on
> my system. No need for explications.
>
> h.googlegroups.com>:[color=green]
>>[color=darkred]
>> > How to move /home dir, which is now a sub-dir of root, to a separate
>> > partition? To be able to upgrade/alter system without affecting main data.[/color][/color]
>[color=green]
>> First, do you have a partition?[/color]
>
> I can make one.[/color]
Good.
[color=blue]
>[color=green]
>> [1] mv /home /home.old
>> [2] mkdir /home
>>
>> [3] chmod 755 /home[/color]
>
>From where do I issue this command? The new partition? Or from / ?[/color]
Root; at this point you've not prepped the new partition yet.
[color=blue]
>[color=green]
>>
>> [4] edit /etc/fstab, adding a line similar to the following.
>>
>> /dev/hdax /home ext3 noatime 1 1
>>
>> /dev/hdax is the new partition location.
>> /home is the directory you wish to mount during bootup.
>> ext3 is the filesystem type.
>>
>> It is possible /etc/fstab may not be using /dev/hdax, but
>> hopefully the comments are clear in that case.[/color]
>
> I'm running Ubuntu 6.06 which seemed a good way to get the feet wet,
> except Deb is different. There is an
> /etc/fstab file. Okay, is this where we go after creating /dev/
> hdax: ? In that case, the previous command:
> $ mv /home /old.home is not done? Or is that an alternative to the
> following steps?[/color]
If you want your partition mounted at bootup you generally
have to put it into /etc/fstab as described above. (There
are alternatives such as mounting it in /etc/init.d/local,
but, since editing /etc/fstab is so simple, unless one has
removable devices or other special requrements, there's
usually not much point.)
[color=blue]
>[color=green]
>>
>> [5] mkfs.ext3 /dev/hdax[/color][/color]
(This, BTW, is the prep part. Partitioning using fdisk simply allocates
space.)
[color=blue][color=green]
>>
>> This prepares the partition for mounting, by writing out
>> (erasing, if there's already stuff on it!) blocks in
>> special locations (one of them's called the superblock)
>> and generally ensuring things are emptied/readied.
>>
>> [6] mount /dev/hdax /home
>>
>> And here's the actual mount. During bootup /etc/fstab is read,
>> and this mount automatically done.
>>
>> [7] At this point you have some options, depending on how much data you
>> have and your paranoia.
>>
>> (a) mv /home.old/* /home
>>
>> This is the simplest but can be problematic if there's
>> an error. mv is smart enough to do a copy/delete,
>> however, if the destination is not on the same
>> partition as the source -- which is the case here.
>>
>> (b) cp -rp /home.old/* /home
>>
>> This doesn't handle symbolic links all that well.
>>
>> (c) (cd /home.old; tar cf - .) | (cd /home; tar xpf -)
>>
>> This complicated-looking command is two tar commands end to end.
>>
>> (d) cd /home.old; tar czf /somewhere/backup/directory/home.dir.tgz .
>> cd /home; tar xzf /somewhere/backup/directory/home.dir.tgz
>>
>> This is (c) with compression and an explicit file as an
>> intermediary. The file is of course a backup of your home directory
>> at that point in time.
>>[/color]
>
> Looking forward to clarification.
>
> Thanks,
>
> Zeno (Geoffrey)
>
>
>[/color]
HTH
--
#191, [email]ewill3@earthlink.net[/email]
"Woman? What woman?"
--
Posted via a free Usenet account from [url]http://www.teranews.com[/url]