Moving /home - Setup

This is a discussion on Moving /home - Setup ; 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....

+ Reply to Thread
Results 1 to 20 of 20

Thread: Moving /home

  1. Moving /home

    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.


  2. Re: Moving /home

    zeno wrote:
    > 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.


    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 http://www.giwersworld.org/nizkook/nizkook.phtml
    flying saucers http://www.giwersworld.org/flyingsa.html a2

  3. Re: Moving /home

    On 2007-05-18, Matt Giwer wrote:
    > zeno wrote:
    >> 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.

    >
    > It is not clear what or why you are trying to do this.


    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.

    > It is best to move home to a new drive rather than partition.


    Why?

    > But if partition is what you mean why does not mv work?


    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

    --
    kkeller-usenet@wombat.san-francisco.ca.us
    (try just my userid to email me)
    AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
    see X- headers for PGP signature information


  4. Re: Moving /home

    Keith Keller wrote:
    > On 2007-05-18, Matt Giwer wrote:
    >> zeno wrote:
    >>> 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.

    >> It is not clear what or why you are trying to do this.

    >
    > 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.


    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.

    >> It is best to move home to a new drive rather than partition.


    > Why?


    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.

    >> But if partition is what you mean why does not mv work?


    > If users are logged in moving /home could cause problems.


    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.

    > 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.


    One hopes he is reading this.

    --
    What the English language needs most is a word that rhymes with orange.
    -- The Iron Webmaster, 3749
    nizkor http://www.giwersworld.org/nizkook/nizkook.phtml
    flying saucers http://www.giwersworld.org/flyingsa.html a2

  5. Re: Moving /home

    Matt Giwer writes:
    > But frankly I doubt sysadmins are here asking questions like this. I
    > assume most questioners are home users like me.


    Most are home users but an appalling (and frustrating) number are admins
    (often with even more basic questions than this one).
    --
    John Hasler
    john@dhh.gt.org
    Dancing Horse Hill
    Elmwood, WI USA

  6. Re: Moving /home

    On 2007-05-19, Matt Giwer 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.

    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) biffster@NOSPAM-REALLYgmail.com
    http://apt-get.biffster.org Y!: miguelito_fierro AIM: mfierro1
    --
    Bother, said Pooh as he realized he couldn't speak Klingon.

  7. Re: Moving /home

    On 2007-05-19, Matt Giwer wrote:
    > Keith Keller wrote:
    >> On 2007-05-18, Matt Giwer wrote:

    >
    >>> It is best to move home to a new drive rather than partition.

    >
    >> Why?

    >
    > 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.


    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.

    >>> But if partition is what you mean why does not mv work?

    >
    >> If users are logged in moving /home could cause problems.

    >
    > 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.


    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


    --
    kkeller-usenet@wombat.san-francisco.ca.us
    (try just my userid to email me)
    AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
    see X- headers for PGP signature information


  8. Re: Moving /home

    John Hasler wrote:
    > Matt Giwer writes:
    >> But frankly I doubt sysadmins are here asking questions like this. I
    >> assume most questioners are home users like me.

    >
    > Most are home users but an appalling (and frustrating) number are admins
    > (often with even more basic questions than this one).


    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 http://www.giwersworld.org/nizkook/nizkook.phtml
    environmentalism http://www.giwersworld.org/environment/aehb.phtml a9

  9. Re: Moving /home

    Michael Fierro wrote:
    > On 2007-05-19, Matt Giwer 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.


    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.

    > 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.


    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.

    > 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.


    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 http://www.giwersworld.org/nizkook/nizkook.phtml
    Lawful to bomb Israelis http://www.giwersworld.org/israel/bombings.phtml a11

  10. Re: Moving /home

    Keith Keller wrote:
    > On 2007-05-19, Matt Giwer wrote:
    >> Keith Keller wrote:
    >>> On 2007-05-18, Matt Giwer wrote:
    >>>> It is best to move home to a new drive rather than partition.
    >>> Why?

    >> 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.


    > You should ask them why they do these things before posting suggestions
    > that are not necessarily true.


    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 / ...

    > 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.


    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.

    >>>> But if partition is what you mean why does not mv work?
    >>> If users are logged in moving /home could cause problems.

    >> 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.


    > 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.


    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 http://www.giwersworld.org/nizkook/nizkook.phtml
    Larry Shiff http://www.giwersworld.org/computers/newsagent.phtml a8

  11. Re: Moving /home

    Keith Keller wrote:
    > 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.


    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

    http://markhobley.yi.org/


  12. Re: Moving /home

    Matt Giwer writes:

    >Michael Fierro wrote:
    >> On 2007-05-19, Matt Giwer 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.


    > 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


    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.

    ....

  13. Re: Moving /home

    In comp.os.linux.setup, zeno

    wrote
    on 17 May 2007 21:21:13 -0700
    <1179462073.074550.120320@q75g2000hsh.googlegroups. com>:
    > 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.
    >


    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, ewill3@earthlink.net
    Useless C++ Programming Idea #23291:
    void f(item *p) { if(p != 0) delete p; }

    --
    Posted via a free Usenet account from http://www.teranews.com


  14. Re: Moving /home

    Unruh wrote:
    > Matt Giwer writes:
    >> Michael Fierro wrote:
    >>> On 2007-05-19, Matt Giwer 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.


    >> 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


    > 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.


    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 http://www.giwersworld.org/nizkook/nizkook.phtml
    Iraqi democracy http://www.giwersworld.org/911/armless.phtml a3

  15. Re: Moving /home

    On 2007-05-20, Mark Hobley rambled on thusly:
    > Keith Keller wrote:
    >> 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.


    > 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.


    Okay, yeah, I can see that. Good point, eh?

    --
    Michael Fierro (aka Biffster) biffster@NOSPAM-REALLYgmail.com
    http://apt-get.biffster.org Y!: miguelito_fierro AIM: mfierro1
    --
    "I may not be a smart man, but I know what love is."
    - "Forrest Gump"

  16. Re: Moving /home

    On 2007-05-20, Mark Hobley wrote:
    > Keith Keller wrote:
    >> 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.

    >
    > 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.


    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

    --
    kkeller-usenet@wombat.san-francisco.ca.us
    (try just my userid to email me)
    AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
    see X- headers for PGP signature information


  17. Re: Moving /home

    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 wrote:
    > On 2007-05-19, Matt Giwer 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.
    >
    > 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.




  18. Re: Moving /home

    On May 18, 12:21 am, zeno wrote:
    > 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.




    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.


  19. Re: Moving /home

    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>:
    >
    > > 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.


    > First, do you have a partition?


    I can make one.

    > [1] mv /home /home.old
    > [2] mkdir /home
    >
    > [3] chmod 755 /home


    >From where do I issue this command? The new partition? Or from / ?


    >
    > [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.


    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?

    >
    > [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.
    >


    Looking forward to clarification.

    Thanks,

    Zeno (Geoffrey)




  20. Re: Moving /home

    In comp.os.linux.setup, zeno

    wrote
    on Wed, 06 Jun 2007 18:46:27 -0000
    <1181155587.928272.283800@g37g2000prf.googlegroups. com>:
    > 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>:
    >>
    >> > 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.

    >
    >> First, do you have a partition?

    >
    > I can make one.


    Good.

    >
    >> [1] mv /home /home.old
    >> [2] mkdir /home
    >>
    >> [3] chmod 755 /home

    >
    >From where do I issue this command? The new partition? Or from / ?


    Root; at this point you've not prepped the new partition yet.

    >
    >>
    >> [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.

    >
    > 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?


    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.)

    >
    >>
    >> [5] mkfs.ext3 /dev/hdax


    (This, BTW, is the prep part. Partitioning using fdisk simply allocates
    space.)

    >>
    >> 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.
    >>

    >
    > Looking forward to clarification.
    >
    > Thanks,
    >
    > Zeno (Geoffrey)
    >
    >
    >


    HTH


    --
    #191, ewill3@earthlink.net
    "Woman? What woman?"

    --
    Posted via a free Usenet account from http://www.teranews.com


+ Reply to Thread