LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Will this resize method work? (https://www.linuxquestions.org/questions/linux-newbie-8/will-this-resize-method-work-847482/)

Mr. Alex 11-30-2010 11:05 AM

Will this resize method work?
 
So I have a partition I wanna make smaller. I can use GParted but this is not secure. Even with backup - there are tons of personal files, I can't check 'em all if they are correct after resizing. So I thought maybe I can create a dir on another machine and do something like
Code:

cp -a / /mnt/0 # which is a mounted directory on another machine
and after repartitioning HDD get everithing back this way. Will it work?

Mr. Alex 11-30-2010 11:11 AM

More info. What I need to do is the following. I have a 80 GB laptop HDD with Linux on it. root and swap. I need to install Windows also, as a second OS. From CD which came with the laptop. That CD is not an installer, it has an image of an HDD and what it does is it formats the whole laptop HDD and extracts Windows to a partition size of which you can select. So I need to save whole Linux system, install Windows XP from that CD and add Linux to a smaller partition so I'll have dual boot. How can I do it. I don't want to reinstall Linux.

TobiSGD 11-30-2010 11:19 AM

Your method should work. But don't forget that you have to update your UUIDs/devices in your fstab after you have copied your files back, and then reinstall your bootloader.

Edit: And don't forget taht if your Windows is XP, it works best in the first primary partition.

Mr. Alex 11-30-2010 11:43 AM

To install a bootloader I should do this?
Code:

sudo grub
root (hd0,2)
setup (hd0)


TobiSGD 11-30-2010 12:12 PM

It seems to me that you are using grub-legacy, sorry, I don't know about that. With grub2 (on Debian, copied the files from a live-medium)I would simply do
Code:

mount /dev/sdXY /mnt
mount -o bind /dev /mnt/dev
chroot /mnt
grub-install /dev/sdX
update-grub


Mr. Alex 11-30-2010 12:22 PM

Yeah, GRUB-Legacy. If anyone knows, let me know please.

TobiSGD 11-30-2010 07:23 PM

Different ways to install grub-legacy from a live-CD: http://members.iinet.net/~herman546/...b_with_Live_CD

Mr. Alex 12-05-2010 03:06 PM

Quote:

Originally Posted by TobiSGD (Post 4175974)
Your method should work. But don't forget that you have to update your UUIDs/devices in your fstab after you have copied your files back, and then reinstall your bootloader.

Edit: And don't forget taht if your Windows is XP, it works best in the first primary partition.

Is this correct for my purpose?
Code:

tar cpvf SDA1.tar /
Doesn't it lack anything? Doing it from Live CD of course... And thanks for help.

TobiSGD 12-06-2010 12:52 PM

If you do that from a live-CD, you will backup you live-CD, and not your installed system. You have to mount the filesystem and the backup that.


All times are GMT -5. The time now is 04:35 PM.