Ask a Question related to Debian, Design and Development.
-
alex #1
Moving /home to its own partition.
Suppose Debian was installed on hda with only two partitions, swap
and / and you have accumulated much data in /home.
Later, you add another hard drive, hdb, and decided to place swap
and a separate /home partition on this new drive while keeping / on
the original hda.
How would you create new swap and /home partitions om hdb so Debian
would use these instead of the original /home and swap?
Additionally, how could you best utilize the space gained by
transferring data from the original /home to the new /home partition?
alex
--
To UNSUBSCRIBE, email to [email]debian-user-request@lists.debian.org[/email]
with a subject of "unsubscribe". Trouble? Contact [email]listmaster@lists.debian.org[/email]
alex Guest
-
Moving Randomly Moving Sprite To New Location on mouseEnter
Hi All, This is way over my head. I am currently using Director 8. I have a randomly moving sprite(call it X) on stage (I accomplished this... -
Moving /home out of rootvg
I installed AIX 4.3.3 on my system and want to move /home to a separate disk. I umount'ed /home, deleted hd1 from the rootvg, created a new volume... -
Jaguar - Moving Appplications Folder to seperate partition (/etc/fstab)
Dear Readers, I have just installed Mac OSX 10.2.6 onto my power book. I have partitioned my drive with Mac OSX, Applications and Users. (12 Gb... -
Moving PC from work to home ( from network to standalone)
PLEASE HELP! I tried this for my windows xp professional, the problem is step 5 this option is greyed out and can not be selected the only... -
XP Pro another partition w/ XP Home?
I have an evalution of Win2K Adv Serv on my laptop, partition C I have WinXP Home on Partition E - I use for school and work. I have Data on... -
Andreas Janssen #2
Re: Moving /home to its own partition.
Hello
alex (<radsky@ncia.net>) wrote:
First, you make the partitions, for example with cfdisk.> Suppose Debian was installed on hda with only two partitions, swap
> and / and you have accumulated much data in /home.
>
> Later, you add another hard drive, hdb, and decided to place swap
> and a separate /home partition on this new drive while keeping / on
> the original hda.
>
> How would you create new swap and /home partitions om hdb so Debian
> would use these instead of the original /home and swap?
Then you need to create a file system on your new home partition (with
mkfs.ext3 for example, depending on what filesystem you want to use)
and use mkswap with your swap partition. Use swapon to activate swap
partitions.
Next, mount your new partition somewhere, e.g. in /mnt, move the data
from /home there, unmount the partition and remount it in /home. Add a
line for the partition in your fstab.
best regards
Andreas Janssen
--
Andreas Janssen
[email]andreas.janssen@bigfoot.com[/email]
PGP-Key-ID: 0xDC801674
Registered Linux User #267976
--
To UNSUBSCRIBE, email to [email]debian-user-request@lists.debian.org[/email]
with a subject of "unsubscribe". Trouble? Contact [email]listmaster@lists.debian.org[/email]
Andreas Janssen Guest
-
Kevin Mark #3
Re: Moving /home to its own partition.
On Sun, 2003-08-03 at 17:31, alex wrote:
Hi Alex,> Suppose Debian was installed on hda with only two partitions, swap
> and / and you have accumulated much data in /home.
>
> Later, you add another hard drive, hdb, and decided to place swap
> and a separate /home partition on this new drive while keeping / on
> the original hda.
>
> How would you create new swap and /home partitions om hdb so Debian
> would use these instead of the original /home and swap?
This is the basic step -- THIS IS NOT TESTED. wait for a few GURUS to
debug.
edit partition table with
cfdisk /dev/hdb
create file system with
mkfs.ext2 /dev/hdb1
mount new partition with
mount /dev/hdb1 /mnt/home2
move data to new partition with
mv /home/* /mnt/home2
get rid of old home directory with
rmdir /home
modify /etc/fstab to point to new partition with
edit /etc/fstab
add "/dev/hdb1 /home ext2 ?????? 1 1" (not sure what to put for ????)
make changes active with
reboot
the swap is similar:
cfdisk /dev/hdb
mkswap /dev/hdb2
edit /etc/fstab by changing /dev/<old-swap> to /dev/hdb2
reboot>
> Additionally, how could you best utilize the space gained by
> transferring data from the original /home to the new /home partition?
>
> alex
>
>
--
To UNSUBSCRIBE, email to [email]debian-user-request@lists.debian.org[/email]
with a subject of "unsubscribe". Trouble? Contact [email]listmaster@lists.debian.org[/email]
Kevin Mark Guest
-
ajlewis2@intac.com #4
Re: Moving /home to its own partition.
> mkdir /b2
I was questioning the thing about not getting the dot files, but now I> mount -t ext2 /dev/hdb2 /b2
>
> # Drop to single user; kills any pesky daemons writing stuff in background.
> telinit 1
>
> # Anything here we don't understand? If not, proceed.
> cd /home && ls -la
>
> # Copy everything whose name does not start with a dot.
> cp -a * /b2 && sync
>
realize that this means not the dot files in /home. It would get the dot
files in /home/<username> though. You would get the config files for the
users. A little slow this morning.
Question: What is the 'sync' for? I haven't done this before and am
wondering what I've been missing.
Thanks,
Anita
--
To UNSUBSCRIBE, email to [email]debian-user-request@lists.debian.org[/email]
with a subject of "unsubscribe". Trouble? Contact [email]listmaster@lists.debian.org[/email]
ajlewis2@intac.com Guest
-
alex #5
Re: Moving /home to its own partition.
Thanks all.... a lot of good info.
--
To UNSUBSCRIBE, email to [email]debian-user-request@lists.debian.org[/email]
with a subject of "unsubscribe". Trouble? Contact [email]listmaster@lists.debian.org[/email]
alex Guest
-
Pigeon #6
Re: Moving /home to its own partition.
On Mon, Aug 04, 2003 at 03:33:17AM -0400, Kevin Mark wrote:
I wouldn't call myself a GURU, but I seem to have done this sort of> On Sun, 2003-08-03 at 17:31, alex wrote:> Hi Alex,> > Suppose Debian was installed on hda with only two partitions, swap
> > and / and you have accumulated much data in /home.
> >
> > Later, you add another hard drive, hdb, and decided to place swap
> > and a separate /home partition on this new drive while keeping / on
> > the original hda.
> >
> > How would you create new swap and /home partitions om hdb so Debian
> > would use these instead of the original /home and swap?
> This is the basic step -- THIS IS NOT TESTED. wait for a few GURUS to
> debug.
thing quite a lot recently...
... assuming that /mnt/home2 exists; if not, either create it or just> edit partition table with
> cfdisk /dev/hdb
> create file system with
> mkfs.ext2 /dev/hdb1
> mount new partition with
> mount /dev/hdb1 /mnt/home2
use /mnt
Everyone has their own recipe for this, it seems... I prefer 'cp -a',> move data to new partition with
> mv /home/* /mnt/home2
which preserves permissions, handles special files correctly, doesn't
ignore dot files, and stuff.
cp -a /home/* /mnt/home2
if you used cp -a instead of mv:> get rid of old home directory with
> rmdir /home
rm -rf /home (gets rid of old stuff)
mkdir /home (you still need a /home as a mount point)
Note that:
rm -rf /home/* won't get rid of those pesky dot files
rm -rf /home/.* gets rid of a little bit too much...
your-favourite-editor /etc/fstab> modify /etc/fstab to point to new partition with
Make that "/dev/hdb1 /home ext2 defaults 0 2"> add "/dev/hdb1 /home ext2 ?????? 1 1" (not sure what to put for ????)
umount /mnt/home2> make changes active with
mount /home
(no need to reboot!)
> the swap is similar:(if you forgot to define a swap partition the first time you ran cfdisk)> cfdisk /dev/hdb
Turn off swap while editing swap entry in /etc/fstab:> mkswap /dev/hdb2
swapoff -a
Turn on new swap:> edit /etc/fstab by changing /dev/<old-swap> to /dev/hdb2
swapon -a
(again, no need to reboot)
cfdisk tends to moan at you to reboot to make sure that the kernel
re-reads the partition table. IME this is a "safety message" which is
given irrespective of whether it's needed; if nothing is using the
disk in question (as is the case when partitioning a brand-new disk)
the kernel re-reads the partition table quite happily. You know it has
done this by the line that appears which messes up the screen layout
and is recognisable as similar to the lines in dmesg produced by the
kernel when it reads the partition table on bootup. If you don't see
such a line, you need to reboot immediately on quitting cfdisk, before
you do anything else. You still don't need to reboot at any other point.
Define 'best' - there are loads of possible answers here... For an> > Additionally, how could you best utilize the space gained by
> > transferring data from the original /home to the new /home partition?
ordinary home PC I'd say just leave it in / and the system will use it
as it needs it.
To make available the space used by your original swap partition,
you'll need to use parted. Assuming your old swap is on /dev/hda1 and
your / is on /dev/hda2:
parted /dev/hda
p (prints out a listing of the current partition table. You need this
information for resizing)
rm 1 (deletes /dev/hda1)
resize 2 START END (START = what p gave you for Start on /dev/hda1
END = what p gave you for End on /dev/hda2
This resizes /dev/hda2 to include the space
originally used for /dev/hda1)
q (quit)
You'll need to boot off a rescue disk, install CD or something to do
this, as it is dangerous to do it on a mounted filesystem.
--
Pigeon
Be kind to pigeons
Get my GPG key here: [url]http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x21C61F7F[/url]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see [url]http://www.gnupg.org[/url]
iD8DBQE/Ln1UUxADjyHGH38RAvUaAJ4z48ivTv8kuIH/AVfULVpC85F+2ACfXuqo
MNjVzUAl9NZ1zL3SrixU0TA=
=P71D
-----END PGP SIGNATURE-----
Pigeon Guest



Reply With Quote

