Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
advice on increasing a partiton size[solved]
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
F-0_ICE
l33t
l33t


Joined: 06 Dec 2004
Posts: 679

PostPosted: Fri Jan 19, 2007 6:13 pm    Post subject: advice on increasing a partiton size[solved] Reply with quote

i want to increase the size of my swap partition but i don't have any unpartitioned space on the disk

heres what i thought of doing:

use norton's ghost to backup my root and boot partition in windows us fdisk to set my partitions to the desired sizes and reload the drive image back to the new partitions.

i know this probably sounds sloppy so i wanted to know if anyone thinks its safe to do or if there is another way to do this with deleting anything.

any advice appreciated.
_________________
~AMD64
AMD: Athlon64 X2 3800+
2G PC3200
ATI: RADEON HD 4350
Linksys: WMP54G

True Knowledge is Best Acquired Through Experience.


Last edited by F-0_ICE on Sat Jan 27, 2007 11:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
mirojira
l33t
l33t


Joined: 18 Feb 2006
Posts: 685

PostPosted: Fri Jan 19, 2007 6:20 pm    Post subject: Reply with quote

Could you send your fstab ?
Back to top
View user's profile Send private message
F-0_ICE
l33t
l33t


Joined: 06 Dec 2004
Posts: 679

PostPosted: Fri Jan 19, 2007 6:27 pm    Post subject: Reply with quote

Code:

/dev/hda1               /boot           ext2            defaults,noatime       1 2
/dev/hda2               none            swap            sw              0 0
/dev/hda3               /               ext3            noatime         0 1

#Optical Devices

/dev/hdc                /mnt/dvdrw      auto            users,noauto,ro 0 0
/dev/hdd                /mnt/dvd        auto            users,noauto,ro 0 0

/dev/sda2               /mnt/winxp       ntfs    auto,ro,users,umask=0002,nls=utf8 0 0


proc                    /proc           proc            defaults        0 0
shm                     /dev/shm        tmpfs           nodev,nosuid,noexec    0 0


thanks for the speedy reply
gentoo is on its own drive windows is on sda2
_________________
~AMD64
AMD: Athlon64 X2 3800+
2G PC3200
ATI: RADEON HD 4350
Linksys: WMP54G

True Knowledge is Best Acquired Through Experience.
Back to top
View user's profile Send private message
mirojira
l33t
l33t


Joined: 18 Feb 2006
Posts: 685

PostPosted: Fri Jan 19, 2007 7:27 pm    Post subject: Reply with quote

I was hoping that the next partition after swap ( which you want to resize ) will be for data storing. In this case it wouldn't be any problem to make backup, resize partition and copy data back. I think that as you have boot partition separately you should make it this way but I have never tried it so I am not sure. Sorry I wouldn't like to help you destroy your system. :(
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54578
Location: 56N 3W

PostPosted: Fri Jan 19, 2007 7:33 pm    Post subject: Reply with quote

F-0_ICE,

Make a swap file and use that as well as your swap partition.
That won't help hibernate to swap, if thats your motive but the kernel can manage up to 16 swap spaces.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
F-0_ICE
l33t
l33t


Joined: 06 Dec 2004
Posts: 679

PostPosted: Fri Jan 19, 2007 8:40 pm    Post subject: Reply with quote

hibernate? no i just wanted a little extra swap space for the system to use.
a swap file sounds much better than ghosting the partition.
so how can i make a swap file for gentoo and set it up properly?
_________________
~AMD64
AMD: Athlon64 X2 3800+
2G PC3200
ATI: RADEON HD 4350
Linksys: WMP54G

True Knowledge is Best Acquired Through Experience.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54578
Location: 56N 3W

PostPosted: Fri Jan 19, 2007 9:33 pm    Post subject: Reply with quote

F-0_ICE,

Make an empty file with dd.
Code:
dd if=/dev/zero of=/path/to/swap/file bs=4096 count=<number-of-4k-blocks>
mkswap /path/to/swap/file
swapon /path/to/swap/file


Also add it to fstab so its activated at boot. Use a lower priority than your swap partition so its used after your marginally faster partition.

You may need loop support in your kernel.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Fri Jan 19, 2007 10:09 pm    Post subject: Reply with quote

GNUParted (partition tool) has the ability to resize partitions, but I have never tried it, so I don't know if it actually works. I do know that resizing windows partitions with partition magic is safe, at least it was for FAT systems, so resizing partitions can be done.

If you can't resize an existing partition, you can temporarily transfer the contents of your root partition to some other disk, like an external USB drive. I have done it on several occasions; archive my system with dar to a USB disk, alter the partition table or put in replacement disk, and transfer it back. There are some things to know about what file systems do before you can safely choose the options to your backup software and make the transfer. My backup article will help you, I hope. It describes not how exactly to make the backup, but informs you of what to look out for.
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
madisonicus
Veteran
Veteran


Joined: 20 Sep 2006
Posts: 1130

PostPosted: Sat Jan 20, 2007 1:47 am    Post subject: Reply with quote

I just did something very similar to this on my laptop. hda1 is ntfs windows. hda2 is swap. hda3 is gentoo. and, hda4 was a spare partition for playing with other distros. The entire disk was partitioned. I wanted to increase the swap partition because it was sometimes too small to permit me to hibernate to disk.

Anyway, I used the gparted livecd. Gparted is a great piece of software as far as I'm concerned. Anyway, I made sure to defrag and ckdisk my NTFS partition. (BTW, how in the world does NTFS get off considering 15% fragmentation to be defragmented?!?!) Then fired up gparted. With it, I shrank the NTFS partition and grew the swap partition without any trouble.

GParted is very step by step and doesn't actually do anything until you confirm it and commit it. Depending on the size of your partitions, it will take a long long time... make sure you back up as much as you can and pray for no power interruptions.

I have nothing against Norton Ghost... I've just never used it. Some folks have had a lot of success with Partition Magic too. Personally, GParted has always done everything I've asked, and it's free.

HTH,
m
_________________
Please add [SOLVED] to your message title if you feel that your question has been answered.
------
Intel Q9300 Core2 Quad * Gigabyte GA-EP35C-DS3R
Samsung x360
AMD64 x2 4200+ * TF7050-M2 * HTPC
ZOTAC ION A-U Mini-ITX * HTPC
Back to top
View user's profile Send private message
F-0_ICE
l33t
l33t


Joined: 06 Dec 2004
Posts: 679

PostPosted: Sat Jan 20, 2007 2:56 am    Post subject: Reply with quote

thanks for everyones replies

halfgaar. i have a question is there a way at all to simply clone my current gentoo install on to my larger 250 sata drive? all this talk about partitions has brought this to my mind. since i hardly use windows i thinks it a waste to let this sata drive just sit for the most part.
_________________
~AMD64
AMD: Athlon64 X2 3800+
2G PC3200
ATI: RADEON HD 4350
Linksys: WMP54G

True Knowledge is Best Acquired Through Experience.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54578
Location: 56N 3W

PostPosted: Sat Jan 20, 2007 9:56 am    Post subject: Reply with quote

F-0_ICE,

Partition the new space as you would like it to be and make the filesystems.
Using a liveCD (copying live root filesystems can produce unexpected resulrs) mount the old Gentoo install at /mnt/gentoo.
Make a new mount point for your new install with say,
Code:
mkdir /mnt/new
and mount your new space there.
Make more dirs inside /mnt/new if you will have separate /home, /usr ... and so on. Do not copy /dev, /proc or /sys, which are not real filesystems.

Now copy over the contents of /mnt/gentoo to /mnt/new being careful to use a method that preserves permissions.
cp -a, cpio, tar, and rsync are all suitable.
I've never trusted cp -a and my favourite here is tar.

Now I've answered your question, you can spread your Gentoo over as many drives and partitions as you like. Indeed, with NFS in the mix, the drives don't even need to be in the same system. You may want to condisder expamding onto the second drive rather than migrating to it. All that will change is your /etc/fstab so the new space gets mounted at boot.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Sat Jan 20, 2007 12:49 pm    Post subject: Reply with quote

Actually, when booting off a live CD, and therefore copying a non-live system, you do want to copy dev, proc, sys bla. Some are empty dirs, which need to exist for the boot sequence to mount them. Others contain data, like /dev/, which is required for booting. For instance, if I remember correctly, it contains /dev/console which is accessed before udev is started.

When using any tool, like tar, dar, cp, cpio, rsync, you have to read the entire man page. Read the article I linked to to find out why. An example, rsync has an --archive switch to preserve as much as possible. But, it does not retain hard link information because it slows rsync down. You have to supply it manually. If you don't, your transferred system is useless. For me, rsync needs: "--archive --sparse --numeric-ids --hard-links" for correct preservation. Same goes for tar; default options -> borked system.

I have frequently used dar to perform this procedure. Dar is designed with correct defaults for a low-level system backup. The only incorrect default is that it tries to preserve atime of files read by default, which means it changes the ctime of every file read (this is already fixed in the development version). Supply -aa to fix that. However, when transferring you system to another disk, ctimes will be changed anyway, so it doesn't really matter in this case. Dar unfortunately doesn't support sparse files, but for me, that's not really an issue. With Dar, of course, you also need to read the man page first.

There is yet another way. perhaps you know of tools like Seagate's diskwizard, which lets you transfer partitions and MBR from one disk to another, so you don't have any hassle. You can do this by hand as well. You can clone partition tables with "sfdisk -d /dev/bla|sfdisk /dev/bla". Then transfer the contents of the partition with "dd if=/dev/blaX of=/dev/blaX". You can copy the MBR with "dd if=/dev/bla of=/dev/bla bs=512 count=1". This is all just from the top of my head, so it doesn't come with guarantees :). Once you have done this, you can resize the partition with Gparted, if it is really as good as madisonicus says :). But, this is kind of a risky procedure...

madisonicus, quick question: do you need to defragment to resize? Partition magic is smart enough to relocate data itself. This is especially useful to know in the case of ext3, as there are no defragmenters...
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54578
Location: 56N 3W

PostPosted: Sat Jan 20, 2007 1:11 pm    Post subject: Reply with quote

halfgaar,

The kernel creates /dev /proc and /sys if they are missing and the required static /dev entries are added too.
/dev is normally in shmfs now, so they don't persist anyway
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Sat Jan 20, 2007 1:16 pm    Post subject: Reply with quote

Quote:
The kernel creates /dev /proc and /sys if they are missing and the required static /dev entries are added too.


Ah, I didn't know that.

Quote:
/dev is normally in shmfs now, so they don't persist anyway


Isn't it still the default that a tarball is made of /dev/ when you shut down your system, to simulate persistence of nodes you make yourself?
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54578
Location: 56N 3W

PostPosted: Sat Jan 20, 2007 1:19 pm    Post subject: Reply with quote

halfgaar,

The tarball defualt option was turned off some time ago. It was intended to preserve /dev entries you had may yourself because udev did not deal with the devices.

I think its still supported. Look in /etc/conf.d/rc
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Sat Jan 20, 2007 1:28 pm    Post subject: Reply with quote

I know it's still supported, but because I have it turned off, and never etc-update that file blindly, I don't what the default is, and if the tarball is meant for anything else than offering the user an option to add nodes without having to edit udev rules.
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
F-0_ICE
l33t
l33t


Joined: 06 Dec 2004
Posts: 679

PostPosted: Sat Jan 20, 2007 6:36 pm    Post subject: Reply with quote

ok this message is coming from the cloned drive. for at first glance things appear sound but i will run things for a couple of days to see if there are problems. at first there was problem with simply getting grub to boot the kernel but i fixed that.

needless to say i did get a bigger swap partition like i wanted. if things stay stable for a few days i will remove the old gentoo setup andl use my system recovery dvds to put Windows XP back on the other drive.
though windows sucks i do need it for my ipod and in case something goes really awry in gentoo.

i would like to thank everyone for their help in this. i will likely get a little better performance with gentoo on this sata drive instead of the ATA100 one

when things look stable i will close this thread.
thanks again :)
_________________
~AMD64
AMD: Athlon64 X2 3800+
2G PC3200
ATI: RADEON HD 4350
Linksys: WMP54G

True Knowledge is Best Acquired Through Experience.
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Sat Jan 20, 2007 6:53 pm    Post subject: Reply with quote

Some things that can go wrong aren't immediately apparent. You should do some checks (this is not an exhaustive list):


  • do "equery check" on a number of packages. This is mostly to check if mtimes have been preserved.
  • do "stat /usr/X11R6/bin/" to see if links is > 1. This is to test if hard links were maintained. If you don't have that dir, find something else that you know should be a hard link.


How did you transfer your system? Can you give the exact command(s) with options you used?[/list]
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
F-0_ICE
l33t
l33t


Joined: 06 Dec 2004
Posts: 679

PostPosted: Sat Jan 20, 2007 8:11 pm    Post subject: Reply with quote

after i posted last night i looked around here and saw that some people use
Code:
cp -ar

to copy things over i figured i let that run over night and if it didn't work i would check back here to see what you guys suggested.

now stat /usr/X11R6/bin gives a 2 by the links this is good right?

sadly i don't know any hard links to test myself

now i got this from an equery check a couple of packages
Code:

equery check kdelibs
[ Checking kde-base/kdelibs-3.5.5-r7 ]
!!! Failed to calculate MD5 sum for /usr/kde/3.5/bin/start_kdeinit
!!! Failed to calculate MD5 sum for /usr/kde/3.5/bin/kgrantpty
[ Checking sys-libs/glibc-2.5 ]
!!! Failed to calculate MD5 sum for /usr/lib64/misc/glibc/pt_chown
!!! Failed to calculate MD5 sum for /usr/lib32/misc/glibc/pt_chown
 * 2457 out of 2459 files good

_________________
~AMD64
AMD: Athlon64 X2 3800+
2G PC3200
ATI: RADEON HD 4350
Linksys: WMP54G

True Knowledge is Best Acquired Through Experience.
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Sat Jan 20, 2007 8:30 pm    Post subject: Reply with quote

It seems to be OK. However, I did just learn that cp -a doesn't copy ACL's (and probably extended attributes neither). So, if you had any of those, you don't have them anymore...

I assume you copied a non-live system? A live system can pose extra problems, so if you transferred it when it was not live, you've got less to worry about.
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
F-0_ICE
l33t
l33t


Joined: 06 Dec 2004
Posts: 679

PostPosted: Sat Jan 20, 2007 8:52 pm    Post subject: Reply with quote

yes i did the copy from the livecd so things should be ok regarding that since there shouldn't be any programs altering files.

by ACL's you mean access control lists? i saw kernel settings for those under filesystems it said say N if you don't know what access control lists are so i said N.
i don't have extended attributes enabled for ext2/3 either.

and the above equery check repeated on the original drive as well so they weren't caused by cp
_________________
~AMD64
AMD: Athlon64 X2 3800+
2G PC3200
ATI: RADEON HD 4350
Linksys: WMP54G

True Knowledge is Best Acquired Through Experience.
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Sat Jan 20, 2007 11:29 pm    Post subject: Reply with quote

Then I think everything is OK.
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
F-0_ICE
l33t
l33t


Joined: 06 Dec 2004
Posts: 679

PostPosted: Fri Jan 26, 2007 3:15 am    Post subject: Reply with quote

so far things have been just fine i have been syncing regularly and haven't noticed anything odd or had any problems.

i thinks i will clear off the old hard drive Saturday and proceed to re-install windows. it will need updates as well.

if you have any objections feel free to comment on this. i would be happy to hear them.
_________________
~AMD64
AMD: Athlon64 X2 3800+
2G PC3200
ATI: RADEON HD 4350
Linksys: WMP54G

True Knowledge is Best Acquired Through Experience.
Back to top
View user's profile Send private message
rlittle
Apprentice
Apprentice


Joined: 17 Dec 2003
Posts: 200

PostPosted: Sat Jan 27, 2007 6:16 pm    Post subject: Reply with quote

It's a little late, but for those kinds of "whole partition" copies, I would only use "tar". There are a few tricks...

cd to the source dir and run

Code:
tar cf - . | (cd /mnt/gentoo/<wherever>; tar xf - )


using "-" as your destination filename sends the contents to the "pipe", and then you untar from "-" as the filename to pull the data from the pipe. There's no file in between and it keeps mtimes, ACLs, hidden files, and anything else.

Actually, I'm re-arranging my partitions between two drives right now. I'm shrinking /usr and /opt by tarring them to (new) smaller partitions, then killing the old partitions, making a bigger one, etc etc.. Haven't killed by system yet and I'm halfway done. :D
_________________
I need a better signature...
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Sat Jan 27, 2007 6:22 pm    Post subject: Reply with quote

Actually, that is a sure way of destroying your system. You didn't even specify to preserve permissions.

One really has to carefully consider every aspect of your system and decide on a tool to do it, and how to configure that tool. There is no quick way of doing it. That's why I wrote my backup article.

edit: also, you mentioned to CD to <whatever>. If you copy directories individually, you will lose hard link information. You also have to watch for this when splitting up parts of your system to different partitions.
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum