LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   how to DEcrease disk size (https://www.linuxquestions.org/questions/linux-software-2/how-to-decrease-disk-size-875386/)

Basher52 04-16-2011 06:12 PM

Installing grub on a new HDD
 
I'm still, sorry, on F12 and sure need to upgrade. :redface:

Way back when I first had a bad disk on the "system" disk that was 80G, I only had a 200G lying around.
Next time that happened my other 200G wasn't "big" enough it said, so I put a 500G in there.
Now it seems I got more bad blocks etc but I need to lower the size 'cos I don't want to put a 1Tb HDD in there.

My question from all of this is, how do I decrease the image so I can put it all on a smaller HDD?
Used space on the system disk's partitions is about 30G, so an 80G disk should be sufficient.

Can anyone tell me how to do this?

What I can think of is that I need to "move" all data to the "beginning" of the HDD, then make an image of it but and the entire disk, just the data.
I've tried that with no luck since the image seem to get as big as the HDD, hence why I always needed to increase the HDD all the time.

Please help :)

//TIA B52

TobiSGD 04-16-2011 06:41 PM

Wouldn't it be simpler to copy your files with rsync? This way you can partition your new drive the way you want.

Basher52 04-16-2011 06:47 PM

yeah, but I need it to be an exact copy of the disk since it's bootable and all

TobiSGD 04-16-2011 07:03 PM

Just copy the files to the new disk and re-install grub. You will get a bootable system this way.

syg00 04-16-2011 09:00 PM

Totally agree with TobiSGD.
The only safe way to go IMHO. "imaging" solutions (most of them) only replicate any problems you already have. Copying the files allows you to redesign the partition layout and f/s to whatever is (now) best for you.
Re-installing (classic) grub on Fedora is simple.

Basher52 04-17-2011 06:34 AM

hmm, have been fiddling with Linux all these years and never new this :p
I'm gonna do that right now

thx ya'll

Basher52 04-22-2011 03:17 PM

Trying to install grub on the newly switched disk told me that it was already installed, so I 'rpm -e' it.
Tried again but since I now don't have network access how can I use the F12 CD or my own setup repo that I've been using for a long time.
(A pal told me to setup my own repo so all updates would be faster since they are all on my disk that get's DLd during the night)

TobiSGD 04-22-2011 03:46 PM

You misunderstood that part about installing grub. The software of the boot-loader is already installed, as you have already recognized. You have to set it up so that it writes it self to the master boot record.
You can find a detailed HowTo about doing that with Fedora here.

Basher52 04-22-2011 03:47 PM

UPDATE:

DOH!!

I uninstalled grub and that ain't the same as using 'grub-install'
Now I need to reinstall grub but how can I do that from the DVD or my own repo sicne I can't get network.

TobiSGD 04-22-2011 03:59 PM

Search for the grub package on your DVD and install it with
Code:

rpm -i NAME-OF-YOUR-GRUBPACKAGE
You need to be root to do that.

Basher52 04-22-2011 04:55 PM

that I know, my new problem is that I can't even find my DVD drive :(
been googling for a while now and still nothing :(
I got nothing in my fstab either for this DVD drive, can that be "auto" added?
I can add it manually if I can find the device it is, but how can I find that: "That's the question" :P

TobiSGD 04-22-2011 04:59 PM

I don't know for sure about Fedora , but it should be either /cdrom, /dev/cdrom or /dev/sr0.
Assuming that it is /dev/sr0 (which I think it is on most modern systems) you can mount it manually. Just create a mount-point for it (I assume that you are already using /mnt for your harddisk) and then mount it.
Code:

mkdir /DVD
mount /dev/sr0 /DVD


Basher52 04-22-2011 05:23 PM

thx Tobi
didn't know that sr0 is the DVD, most on "google" says hdx or something

thx a LOT :D


btw... what does sr0 stand for?

s=SCSI
r=ReadOnly
0=First device


or?

Basher52 04-22-2011 05:46 PM

Frell :( :(
My brain sure ain't with my tonight...

I mounted the DVD into /mnt/dvd
I chrooted into my "new" disk and then I want to reinstall grub.
but when I chroot I can't get to the DVD :(

What am I missing here :(

TobiSGD 04-22-2011 05:47 PM

I have absolute no clue for what that can stand. But what you write seems to be somewhat logical, at least until you have a CD/DVD-burner in the system. ;)


All times are GMT -5. The time now is 11:04 AM.