Re: Creating/Moving a partition
I had a similar problem and I found the Hard Disk Upgrade mini-HOWTO to be much helpful. I hope that such a reference is acceptable by you, though it is not a direct answer. Some few weeks ago someone replied to me quite rudely when I answered him this way. I find such references to be of much help and do not mind that people will answer to me like that. I'd like to make a new partition for /var because I don't have enough drive space where /var is currently mounted (/) to run apt-get dist-upgrade. What's the best way of doing this? I can create a new /var partition because I've got plenty of available drive space, but what set-up files will I have to modify to make sure things go smoothly? I assume I'll have to change fstab. But then do I have to move all contents of the current /var to the new /var? Could I create the new partition using a temporary name, move all the /var stuff to it, then rename it to /var? Thanks. -- David J. Kanter [EMAIL PROTECTED] Debian 2.1 -- Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] /dev/null
Creating/Moving a partition
I'd like to make a new partition for /var because I don't have enough drive space where /var is currently mounted (/) to run apt-get dist-upgrade. What's the best way of doing this? I can create a new /var partition because I've got plenty of available drive space, but what set-up files will I have to modify to make sure things go smoothly? I assume I'll have to change fstab. But then do I have to move all contents of the current /var to the new /var? Could I create the new partition using a temporary name, move all the /var stuff to it, then rename it to /var? Thanks. -- David J. Kanter [EMAIL PROTECTED] Debian 2.1
Re: Creating/Moving a partition
David J. Kanter wrote: I'd like to make a new partition for /var because I don't have enough drive space where /var is currently mounted (/) to run apt-get dist-upgrade. What's the best way of doing this? I can create a new /var partition because I've got plenty of available drive space, but what set-up files will I have to modify to make sure things go smoothly? I assume I'll have to change fstab. But then do I have to move all contents of the current /var to the new /var? Could I create the new partition using a temporary name, move all the /var stuff to it, then rename it to /var? Thats what I would suggest. Stop everything you can, copy the contents and do the final swapover in one line, just in case # mv /var /old_var ; mv /new_var /var Another alternative is to create a whole new, bigger, root partition, copy everyting to that, boot it from a rescue floppy and once there 1) make it bootable, fix up /etc/fstab and /etc/lilo.conf and run lilo 2) remove the original root partition and replace it with an enlarged verion. It depends what else you've got on the disk, how much time you have, etc. Andrew
Re: Creating/Moving a partition
David J. Kanter wrote: I'd like to make a new partition for /var because I don't have enough drive space where /var is currently mounted (/) to run apt-get dist-upgrade. What's the best way of doing this? I can create a new /var partition becaus e I've got plenty of available drive space, but what set-up files will I have to modify to make sure things go smoothly? I assume I'll have to change fstab. But then do I have to move all contents of the current /var to the new /var? Could I create the new partition using a temporary name, move all the /var stuff to it, then rename it to /var? Thats what I would suggest. Stop everything you can, copy the contents and do the final swapover in one line, just in case # mv /var /old_var ; mv /new_var /var NO, NO, NO, NO, NO Do *NOT* use mv. This will change the ownership and protection rights of the contents. This will most certainly break something. Instead, use cp -a to preserve everything. 1. Log in as root 2. Go to run level 1 (kills networking). Also kill all user processes. init 1 3. Add the following to your /etc/fstab /dev/??? /var ext2defaults1 2 (The ??? is the partition of your new /var) 4. Change the name of your old /var directory and make a new empty one. mv /var /oldvar mkdir /var chmod 755 /var 5. Mount your new var partition. mount /dev/??? /var 6. Now, use cp -a (or cp -av if you want to watch it) to copy your files, permissions and ownership to the new partition. cp -av /var/* /var If things don't work, you still have your old partition in pristine shape to go back to where you were. I wouldn't delete the old /var until I determined that everything works fine--maybe a week. The idea of just getting a bigger root partition is a bad idea. /var is a very, very good candidate for a separate partition.
Re: Creating/Moving a partition
I wrote: 6. Now, use cp -a (or cp -av if you want to watch it) to copy your files, permissions and ownership to the new partition. cp -av /var/* /var PS That command should be: cp -av /oldvar/* /var
Re: Creating/Moving a partition
David J. Kanter wrote: I'd like to make a new partition for /var because I don't have enough drive space where /var is currently mounted (/) to run apt-get dist-upgrade. What's the best way of doing this? I can create a new /var partition because I've got plenty of available drive space, but what set-up files will I have to modify to make sure things go smoothly? I assume I'll have to change fstab. But then do I have to move all contents of the current /var to the new /var? Could I create the new partition using a temporary name, move all the /var stuff to it, then rename it to /var? Yep, exactly. I'd go down to single-user mode to do this. 'Shutdown', good backups, and 'cp -a' are your friends.
Re: Creating/Moving a partition
[EMAIL PROTECTED] wrote: # mv /var /old_var ; mv /new_var /var NO, NO, NO, NO, NO! Do NOT use mv! This will change the ownership and protection rights of the files. That could be very, very bad and will most certainly break something. Oops. I missed out: First make a perfect copy of /var in another partition mounted on /new_var using tar, cp, cpio or whatever, Then swap them as described using mv. However, your approach seems a little more robust :-) I'll shut up now. Andrew -- http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=45690
Re: Creating/Moving a partition
On Fri, 15 Oct 1999, Andrew Hately wrote: David J. Kanter wrote: I'd like to make a new partition for /var because I don't have enough drive space where /var is currently mounted (/) to run apt-get dist-upgrade. What's the best way of doing this? I can create a new /var partition because I've got plenty of available drive space, but what set-up files will I have to modify to make sure things go smoothly? I assume I'll have to change fstab. But then do I have to move all contents of the current /var to the new /var? Could I create the new partition using a temporary name, move all the /var stuff to it, then rename it to /var? Thats what I would suggest. Stop everything you can, copy the contents and do the final swapover in one line, just in case # mv /var /old_var ; mv /new_var /var I'd like to expand on that last paragraph. 1) stop everything you can - go into single user mode close all user programs (i.e. tidy up) then as root: telinit 1 2) copy the contents - if you use the 'cp' command you're likely to mess with file ownership and permissions. The command I use is this: cd /mnt -- where the new /var partition is currently mounted (cd /var; tar cfp - [list of directories]) | tar xfp - 3) once you're done, go back to normal runlevel as root: telinit 2 (change the number depending on what runlevel you usually live in - you can find this on the initdefault line of /etc/inittab) dave -- | oOOooO / --|oOobodoO/ [EMAIL PROTECTED] --| ooOoOo / | II / The wise man tells you where you have fallen | II / and where you may fall - Invaluable secrets.
Re: Creating/Moving a partition
Another alternative is simply to create a directory under /usr/local such as /usr/local/tmp and then do: apt-get dist-upgrade -o dir::cache=/usr/local/tmp That will use the (for most people) much larger USR partition and will give you plenty of space to upgrade. That worked good for me until I got mostly fully upgraded to potato, and now I use /var again because I am only upgrading 15-20 packages at a time. regards, Todd On Fri, 15 Oct 1999, Andrew Hately wrote: David J. Kanter wrote: I'd like to make a new partition for /var because I don't have enough drive space where /var is currently mounted (/) to run apt-get dist-upgrade. What's the best way of doing this? I can create a new /var partition because I've got plenty of available drive space, but what set-up files will I have to modify to make sure things go smoothly? I assume I'll have to change fstab. But then do I have to move all contents of the current /var to the new /var? Could I create the new partition using a temporary name, move all the /var stuff to it, then rename it to /var? Thats what I would suggest. Stop everything you can, copy the contents and do the final swapover in one line, just in case # mv /var /old_var ; mv /new_var /var Another alternative is to create a whole new, bigger, root partition, copy everyting to that, boot it from a rescue floppy and once there 1) make it bootable, fix up /etc/fstab and /etc/lilo.conf and run lilo 2) remove the original root partition and replace it with an enlarged verion. It depends what else you've got on the disk, how much time you have, etc. Andrew -- Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] /dev/null