Merge Debian's /usr and /usr/local partitions together? - Setup

This is a discussion on Merge Debian's /usr and /usr/local partitions together? - Setup ; Hello. I am running low on disk spaces on my old Debian box for /usr partition (yes, I have a lot since I read it was good to have many partitions but now I am told that it is unrecommended) ...

+ Reply to Thread
Results 1 to 12 of 12

Thread: Merge Debian's /usr and /usr/local partitions together?

  1. Merge Debian's /usr and /usr/local partitions together?

    Hello.

    I am running low on disk spaces on my old Debian box for /usr partition
    (yes, I have a lot since I read it was good to have many partitions but
    now I am told that it is unrecommended) since I upgrade daily with
    apt-get command:

    $ df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/hda1 274M 166M 94M 64% /
    tmpfs 252M 0 252M 0% /lib/init/rw
    udev 10M 136K 9.9M 2% /dev
    tmpfs 252M 0 252M 0% /dev/shm
    /dev/hda11 46G 12G 32G 26% /extra
    /dev/hda5 14G 4.5G 8.6G 35% /home
    /dev/hda12 897M 17M 833M 2% /others
    /dev/hdb5 5.1G 1.6G 3.3G 32% /storage
    /dev/hdb1 842M 17M 783M 3% /stuff
    /dev/hda8 942M 31M 864M 4% /tmp
    /dev/hda6 4.6G 3.9G 517M 89% /usr
    /dev/hda9 4.6G 187M 4.2G 5% /usr/local
    /dev/hda7 942M 599M 296M 67% /var

    I was told that /usr/local isn't used much and I can merge both /usr/
    and /usr/local together to regain 4.2 GB of free disk space. According
    to df -h, I can see /usr/local is only using 187 MB of disk space.

    What's the easiest and quickest way to merge these two partitions. I
    recalled using qtparted with a KNOPPIX LiveCD anbd it said I couldn't
    resize/merge them. I forget why. I think it is because of no disk space
    around them or something.

    FYI from fdisk /dev/hda if it helps:
    Disk /dev/hda: 80.0 GB, 80026361856 bytes
    255 heads, 63 sectors/track, 9729 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x6a3a6846

    Device Boot Start End Blocks Id System
    /dev/hda1 1 36 289138+ 83 Linux
    /dev/hda2 37 9729 77859022+ 5 Extended
    /dev/hda5 37 1860 14651248+ 83 Linux
    /dev/hda6 1861 2468 4883728+ 83 Linux
    /dev/hda7 2469 2590 979933+ 83 Linux
    /dev/hda8 2591 2712 979933+ 83 Linux
    /dev/hda9 2713 3320 4883728+ 83 Linux
    /dev/hda10 3443 3736 2361523+ 82 Linux swap / Solaris
    /dev/hda11 3737 9729 48138741 83 Linux
    /dev/hda12 3321 3442 979933+ 83 Linux

    Partition table entries are not in disk order


    Thank you in advance.
    --
    "We are anthill men upon an anthill world." --Ray Bradbury
    /\___/\
    / /\ /\ \ Phillip (Ant) @ http://antfarm.ma.cx (Personal Web Site)
    | |o o| | Ant's Quality Foraged Links (AQFL): http://aqfl.net
    \ _ / Please remove ANT if replying by e-mail.
    ( )

  2. Re: Merge Debian's /usr and /usr/local partitions together?

    ANTant@zimage.com writes:

    > $ df -h
    > Filesystem Size Used Avail Use% Mounted on
    > /dev/hda1 274M 166M 94M 64% /
    > tmpfs 252M 0 252M 0% /lib/init/rw
    > udev 10M 136K 9.9M 2% /dev
    > tmpfs 252M 0 252M 0% /dev/shm
    > /dev/hda11 46G 12G 32G 26% /extra
    > /dev/hda5 14G 4.5G 8.6G 35% /home
    > /dev/hda12 897M 17M 833M 2% /others
    > /dev/hdb5 5.1G 1.6G 3.3G 32% /storage
    > /dev/hdb1 842M 17M 783M 3% /stuff
    > /dev/hda8 942M 31M 864M 4% /tmp
    > /dev/hda6 4.6G 3.9G 517M 89% /usr
    > /dev/hda9 4.6G 187M 4.2G 5% /usr/local
    > /dev/hda7 942M 599M 296M 67% /var
    >
    > I was told that /usr/local isn't used much and I can merge both /usr/
    > and /usr/local together to regain 4.2 GB of free disk space. According
    > to df -h, I can see /usr/local is only using 187 MB of disk space.
    >
    > What's the easiest and quickest way to merge these two partitions.


    Hmm. Not easy. Perhaps the easiest is to move files from /usr to /usr/local


    For instance, move /usr/man to /usr/local/man
    and create a symbolic link from /usr/man to /usr/local/man

    If those partitions were contiguous, I'd say you back up the
    partitions, and repartion the disk to combine two partitons into one.


    However
    (1) this is risky and not recommended for beginners.
    (2) partitions /dev/hda6 and /dev/hda9 are not contiguous.


    You could back up /var /usr /usr/local and /tmp and repartition
    to be

    /dev/hda6 9.2G /usr and /usr/local
    /dev/hda7 942M /var
    /dev/hda8 942M /tmp


    Looking at
    /dev/hda5 14G 4.5G 8.6G 35% /home

    you could copy /usr/local into /home/local and link /usr/local->/home/local

    There is the same with /extra.

    This frees up a partition, without repartitioning,
    but you still need to move files out of /usr into the new partition.

    Or you can move /extra onto /home. and then make /extra a new /usr

    Frankly I usually buy a BIG disk and copy files onto it, and repartition.
    If I can repartiton without screwing up, fine.
    If I need to recover, I can.
    It creates a backup, which is always good.


  3. Re: Merge Debian's /usr and /usr/local partitions together?

    On 6/4/2008 7:50 PM PT, Maxwell Lol typed:

    >> $ df -h
    >> Filesystem Size Used Avail Use% Mounted on
    >> /dev/hda1 274M 166M 94M 64% /
    >> tmpfs 252M 0 252M 0% /lib/init/rw
    >> udev 10M 136K 9.9M 2% /dev
    >> tmpfs 252M 0 252M 0% /dev/shm
    >> /dev/hda11 46G 12G 32G 26% /extra
    >> /dev/hda5 14G 4.5G 8.6G 35% /home
    >> /dev/hda12 897M 17M 833M 2% /others
    >> /dev/hdb5 5.1G 1.6G 3.3G 32% /storage
    >> /dev/hdb1 842M 17M 783M 3% /stuff
    >> /dev/hda8 942M 31M 864M 4% /tmp
    >> /dev/hda6 4.6G 3.9G 517M 89% /usr
    >> /dev/hda9 4.6G 187M 4.2G 5% /usr/local
    >> /dev/hda7 942M 599M 296M 67% /var
    >>
    >> I was told that /usr/local isn't used much and I can merge both /usr/
    >> and /usr/local together to regain 4.2 GB of free disk space. According
    >> to df -h, I can see /usr/local is only using 187 MB of disk space.
    >>
    >> What's the easiest and quickest way to merge these two partitions.

    >
    > Hmm. Not easy. Perhaps the easiest is to move files from /usr to /usr/local


    Are you saying I will have a /usr/local/usr?


    > For instance, move /usr/man to /usr/local/man
    > and create a symbolic link from /usr/man to /usr/local/man


    How will this affect apt-get and source compilations? Will they
    recognize the symbolic links?


    > If those partitions were contiguous, I'd say you back up the
    > partitions, and repartion the disk to combine two partitons into one.
    >
    >
    > However
    > (1) this is risky and not recommended for beginners.
    > (2) partitions /dev/hda6 and /dev/hda9 are not contiguous.
    >
    >
    > You could back up /var /usr /usr/local and /tmp and repartition
    > to be
    >
    > /dev/hda6 9.2G /usr and /usr/local
    > /dev/hda7 942M /var
    > /dev/hda8 942M /tmp
    >
    >
    > Looking at
    > /dev/hda5 14G 4.5G 8.6G 35% /home
    >
    > you could copy /usr/local into /home/local and link /usr/local->/home/local
    >
    > There is the same with /extra.
    >
    > This frees up a partition, without repartitioning,
    > but you still need to move files out of /usr into the new partition.
    >
    > Or you can move /extra onto /home. and then make /extra a new /usr
    >
    > Frankly I usually buy a BIG disk and copy files onto it, and repartition.
    > If I can repartiton without screwing up, fine.
    > If I need to recover, I can.
    > It creates a backup, which is always good.


    Yeah, I can do that but that won't be a while unless my HDD dies or
    something that I am forced to replace it. I will probably upgrade
    hardwares at the end of this year.
    --
    "What is this? A center for ants?!" "...What?" "How can we be expected
    to teach children to learn how read, if they can't even fit inside the
    building?" "Derek, it's just a--" "I don't want to hear your excuses!
    The center has to be at least... three times bigger than this!" "...He's
    absolutely right!" --Zoolander movie
    /\___/\
    / /\ /\ \ Phil/Ant @ http://antfarm.home.dhs.org (Personal Web Site)
    | |o o| | Ant's Quality Foraged Links (AQFL): http://aqfl.net
    \ _ / Remove ANT from e-mail address: philpi@earthlink.netANT
    ( ) or ANTant@zimage.com
    Ant is currently not listening to any songs on his home computer.

  4. Re: Merge Debian's /usr and /usr/local partitions together?

    ANTant@zimage.com wrote:
    > Filesystem Size Used Avail Use% Mounted on
    > /dev/hda1 274M 166M 94M 64% /
    > tmpfs 252M 0 252M 0% /lib/init/rw
    > udev 10M 136K 9.9M 2% /dev
    > tmpfs 252M 0 252M 0% /dev/shm
    > /dev/hda11 46G 12G 32G 26% /extra
    > /dev/hda5 14G 4.5G 8.6G 35% /home
    > /dev/hda12 897M 17M 833M 2% /others
    > /dev/hdb5 5.1G 1.6G 3.3G 32% /storage
    > /dev/hdb1 842M 17M 783M 3% /stuff
    > /dev/hda8 942M 31M 864M 4% /tmp
    > /dev/hda6 4.6G 3.9G 517M 89% /usr
    > /dev/hda9 4.6G 187M 4.2G 5% /usr/local
    > /dev/hda7 942M 599M 296M 67% /var
    >
    > What's the easiest and quickest way to merge these two partitions. I
    > recalled using qtparted with a KNOPPIX LiveCD anbd it said I couldn't
    > resize/merge them. I forget why. I think it is because of no disk space
    > around them or something.


    Shut down to single user mode,

    move /var to a subdirectory or /stuff
    move /usr/local to a subdirectory of /storage
    move /usr to a subdirectory of /extra

    Now use fdisk and blitz /dev/hda6, /dev/hda7, /dev/hda8 and /dev/hda9

    You can now recreate two partitions in space of those four.

    Move /usr into the first one created, and move /usr/local inside /usr.

    /var and /tmp can be symlinks within the second partition.

    For an 80Gb hard drive, I use the following scheme:

    /boot 650 Mb
    / 650 Mb
    /usr 32767 Mb
    /local 47104 Mb
    swap 512Mb Swap Partition

    /var, /home, and /tmp are symlinks to subdirectories of /local

    Regards,

    Mark.

    --
    Mark Hobley,
    393 Quinton Road West,
    Quinton, BIRMINGHAM.
    B32 1QE.

  5. Re: Merge Debian's /usr and /usr/local partitions together?

    > ANTant@zimage.com wrote:
    >> Filesystem Size Used Avail Use% Mounted on
    >> /dev/hda1 274M 166M 94M 64% /
    >> tmpfs 252M 0 252M 0% /lib/init/rw
    >> udev 10M 136K 9.9M 2% /dev
    >> tmpfs 252M 0 252M 0% /dev/shm
    >> /dev/hda11 46G 12G 32G 26% /extra
    >> /dev/hda5 14G 4.5G 8.6G 35% /home
    >> /dev/hda12 897M 17M 833M 2% /others
    >> /dev/hdb5 5.1G 1.6G 3.3G 32% /storage
    >> /dev/hdb1 842M 17M 783M 3% /stuff
    >> /dev/hda8 942M 31M 864M 4% /tmp
    >> /dev/hda6 4.6G 3.9G 517M 89% /usr
    >> /dev/hda9 4.6G 187M 4.2G 5% /usr/local
    >> /dev/hda7 942M 599M 296M 67% /var
    >>
    >> What's the easiest and quickest way to merge these two partitions. I
    >> recalled using qtparted with a KNOPPIX LiveCD anbd it said I couldn't
    >> resize/merge them. I forget why. I think it is because of no disk space
    >> around them or something.

    >
    > Shut down to single user mode,
    >
    > move /var to a subdirectory or /stuff
    > move /usr/local to a subdirectory of /storage
    > move /usr to a subdirectory of /extra
    >
    > Now use fdisk and blitz /dev/hda6, /dev/hda7, /dev/hda8 and /dev/hda9
    >
    > You can now recreate two partitions in space of those four.
    >
    > Move /usr into the first one created, and move /usr/local inside /usr.
    >
    > /var and /tmp can be symlinks within the second partition.
    >
    > For an 80Gb hard drive, I use the following scheme:
    >
    > /boot 650 Mb
    > / 650 Mb
    > /usr 32767 Mb
    > /local 47104 Mb
    > swap 512Mb Swap Partition
    >
    > /var, /home, and /tmp are symlinks to subdirectories of /local


    Thanks! How will this affect apt-get and source compilations? Will they
    recognize the symbolic links?
    --
    "We are anthill men upon an anthill world." --Ray Bradbury
    /\___/\
    / /\ /\ \ Phillip (Ant) @ http://antfarm.ma.cx (Personal Web Site)
    | |o o| | Ant's Quality Foraged Links (AQFL): http://aqfl.net
    \ _ / Please remove ANT if replying by e-mail.
    ( )

  6. Re: Merge Debian's /usr and /usr/local partitions together?

    ANTant@zimage.com wrote:

    > Thanks! How will this affect apt-get and source compilations? Will they
    > recognize the symbolic links?


    Yes. No problem. My /usr and /var are remapped via symbolic links.

    Regards,

    Mark.

    --
    Mark Hobley,
    393 Quinton Road West,
    Quinton, BIRMINGHAM.
    B32 1QE.

  7. Re: Merge Debian's /usr and /usr/local partitions together?

    ["Followup-To:" header set to alt.os.linux.debian.]
    On 04 Jun 2008 22:50:24 -0400,
    Maxwell Lol wrote:
    > ANTant@zimage.com writes:
    >
    > > $ df -h
    > > Filesystem Size Used Avail Use% Mounted on
    > > /dev/hda1 274M 166M 94M 64% /
    > > tmpfs 252M 0 252M 0% /lib/init/rw
    > > udev 10M 136K 9.9M 2% /dev
    > > tmpfs 252M 0 252M 0% /dev/shm
    > > /dev/hda11 46G 12G 32G 26% /extra
    > > /dev/hda5 14G 4.5G 8.6G 35% /home
    > > /dev/hda12 897M 17M 833M 2% /others
    > > /dev/hdb5 5.1G 1.6G 3.3G 32% /storage
    > > /dev/hdb1 842M 17M 783M 3% /stuff
    > > /dev/hda8 942M 31M 864M 4% /tmp
    > > /dev/hda6 4.6G 3.9G 517M 89% /usr
    > > /dev/hda9 4.6G 187M 4.2G 5% /usr/local
    > > /dev/hda7 942M 599M 296M 67% /var
    > >
    > > I was told that /usr/local isn't used much and I can merge both
    > > /usr/ and /usr/local together to regain 4.2 GB of free disk space.
    > > According to df -h, I can see /usr/local is only using 187 MB of
    > > disk space.
    > >
    > > What's the easiest and quickest way to merge these two partitions.

    >
    > Hmm. Not easy. Perhaps the easiest is to move files from /usr to
    > /usr/local
    >
    >
    > For instance, move /usr/man to /usr/local/man and create a symbolic
    > link from /usr/man to /usr/local/man


    You don't want to do that. /usr/local/man should already exist, and
    should be populated with man pages installed from locally compiled
    software which usually exists outside the knowledge of the package
    manager.

    Merging like that may technically work, but it is very likely you will
    run into trouble with package management as you add and remove
    software.

    Obviously this is less of a problem with /usr{,/local}/man than with
    /usr{,/local}/{lib,bin}.

    Michael C.
    --
    mjchappell@verizon.net http://mcsuper5.freeshell.org/

    Most folks are about as happy as they make up their mind to be.

  8. Re: Merge Debian's /usr and /usr/local partitions together?

    ANTant@zimage.com wrote:
    > Hello.


    > I am running low on disk spaces on my old Debian box for /usr partition
    > (yes, I have a lot since I read it was good to have many partitions but
    > now I am told that it is unrecommended) since I upgrade daily with
    > apt-get command:


    No matter where you move things the upgrade will put its files back where it
    wants them to be. But as the search order is usually /usr/bin followed by
    /usr/local/bin and the OS will take the first one it finds upgrades put in
    /usr/local/bin will not be used. Thus you are left with a daily project after
    upgrade to move things around back to where you want them.

    It does not seem worth the effort when hard drives are so cheap.

    --
    Interested in studying the effects of a medieval
    castle siege? Study the siege of Gaza today.
    -- The Iron Webmaster, 4004
    http://www.giwersworld.org/disinfo/occupied-2.phtml a6

  9. Re: Merge Debian's /usr and /usr/local partitions together?

    Matt Giwer writes:
    > But as the search order is usually /usr/bin followed by /usr/local/bin...


    /usr/local/bin is usually first.

    --
    John Hasler

  10. Re: Merge Debian's /usr and /usr/local partitions together?

    John Hasler wrote:
    > Matt Giwer writes:
    >> But as the search order is usually /usr/bin followed by /usr/local/bin...


    > /usr/local/bin is usually first.


    I can only say when I tried the bright idea he is talking about I found
    /usr/bin was first with Redhat 8 or so. A few releases of Fedora ago I noticed
    everything but legacy stuff had been put into /usr/bin. I just counted only 14
    apps in /usr/local/bin with Fedora 9 and I might have added a couple of them
    before I found them available with yum.

    --
    Interested in studying the effects of a medieval
    castle siege? Study the siege of Gaza today.
    -- The Iron Webmaster, 4004
    http://www.giwersworld.org a1

  11. Re: Merge Debian's /usr and /usr/local partitions together?

    Matt Giwer writes:

    >John Hasler wrote:
    >> Matt Giwer writes:
    >>> But as the search order is usually /usr/bin followed by /usr/local/bin...


    >> /usr/local/bin is usually first.


    > I can only say when I tried the bright idea he is talking about I found
    >/usr/bin was first with Redhat 8 or so. A few releases of Fedora ago I noticed
    >everything but legacy stuff had been put into /usr/bin. I just counted only 14
    >apps in /usr/local/bin with Fedora 9 and I might have added a couple of them
    >before I found them available with yum.


    The distro puts everything into /usr/bin ( or /usr/sbin, /sbin or /bin) and
    not /usr/local/bin. That is for local programs.
    Search order should usually be /usr/local/bin first since if you have
    generated a new version in /usr/local/bin, that is the one that should be
    used, rather than the distros version.


  12. Re: Merge Debian's /usr and /usr/local partitions together?

    Ant writes:

    > >> What's the easiest and quickest way to merge these two partitions.

    > > Hmm. Not easy. Perhaps the easiest is to move files from /usr to
    > > /usr/local

    >
    > Are you saying I will have a /usr/local/usr?



    With Unix, you can move files around anyway you want to, and create symbolic links to point to the new location.

    >
    >
    > > For instance, move /usr/man to /usr/local/man
    > > and create a symbolic link from /usr/man to /usr/local/man

    >
    > How will this affect apt-get and source compilations? Will they
    > recognize the symbolic links?



    Sure. Symbolic links work fine. It's in the file system, not the application.

    Perhaps the only issue might be if some application does something like

    cd /new directory
    cd ..
    it might end up in a different location.

+ Reply to Thread