i'm slowly running out of disk space
i was thinking about bying a new disk
is it possible to somehow "copy" the linux installation to the new disk without the need of reinstalling
or what is the best way to switch the disks?
The best way is just to install your new disk, format and
partition it., and then mount it: mount /dev/hdd /mnt/new
Then say that you want to transfer the contents/structure of /var to the new disk..good choice if you have a busy
server class box with a single drive(bad idea).
cp -a /var/ /mnt/new
rm -rf /usr
ln -s /mnt/new /usr/
Then add your new mount scheme to /etc/fstab.
That is one way.
With the new journaling filesystems and lvm there are other options.
Hi,
Hmmmmm .... yes that particular typo would not have had quite the desired result !!
If you're adding hard drives you're obviously going to take the system down so, once you've copied files/directories onto a new physical partition you can just edit /etc/fstab to mount that partition at the normal mount-point. For example, if /var was previously within the '/' partition you can add a line like the following saying its now on another physical partition :
/dev/hdb1 /var ext2 defaults 1 2
(/dev/hdb1 is just an example)
This is a bit simpler than using links. Obvious candidates for their own partition are /var, /usr, /home . Please note, however, that you cannot put any of : /bin, /dev, /etc, /lib, or /sbin in separate partitions because they must all be in the filesystem at boot time.
isn't there a better way using dd? dd would be the way to go if you want to transfer the whole disk image.
If you just want to add a disk then you can temporarily mount onto /mnt/temp, copy the old mount to the /mnt/temp. Once the copy is verified, you can edit /etc/fstab so that the new file system takes the place of the old mount. The old mount can now be used for something else.
This a better solution than linking the new mount to the old.
thanx guys for your posts
your way is adding another disk to the system, am i right?
i was actually searching for a disk (partition) image transfer, with the possibility to transfer the original (small) partition to a bigger one on the new disk and then somehow changing config files that represent the disk status (i found only /etc/fstab with such info) to reflect the new situation
could it be done with the "dd" way as bluedevils posted?
Sure dd is more efficient, as is copying a backup of the
entire directory structure to the new disk and remounting..but it takes a while-> this is 5 minutes work.
I've never done a disk image copy, but the basic would be dd if=/dev/hdc of=/dev/hdd
Oooh another reminder if you don't use dd and you try the /mnt/temp thing, you might want to use tar instead of copy. It preserves ownership and permissions.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.