You are not logged in.

#1 2010-04-01 10:48:26

tomislavski
Member
Registered: 2010-02-09
Posts: 87

[SOLVED]installation: partition size FAIL, too small /var

Yeah, I managed to make a mess again. sad

I thought I had given the /var 15 GB and it turned out to be 1.5 GB, now I'm facing this situation:

[tomislav@shakenbake ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              14G  2.5G   11G  19% /
udev                   10M  216K  9.8M   3% /dev
shm                   1.9G     0  1.9G   0% /dev/shm
/dev/sda1             464M   23M  418M   6% /boot
/dev/sda3             1.4G  1.1G  327M  78% /var
/dev/sda6             274G  1.8G  258G   1% /home
[tomislav@shakenbake ~]$

the 78% filled var is a BIG mistake. What do I do now? Should I use rsync and do a system backup, resize the /home partition using the cfdisk command and an Archlinux live CD, then copy everything back? Do this just for these two partitions (home and var are adjacent)?

Can I use rsync in a way that it stores the partition information, although I will send everything onto a single partition on an external HDD?

Damn it. This is what happens when you hurry: the newbness deamons get you.

Last edited by tomislavski (2010-04-02 14:30:14)

Offline

#2 2010-04-01 12:00:15

ChoK
Member
From: France
Registered: 2008-10-01
Posts: 346

Re: [SOLVED]installation: partition size FAIL, too small /var

If you have a big enough external hard drive you can use the dd command, you can also try clonezilla which will copy only used blocks (can't give you feedback on that tool though) http://clonezilla.org/ .

Isn't cfdisk just a partition editor ? you will also need to resize the underlying filesystem, parted can help you do both at the same time or you can use cfdisk + some ext2fs tool (in case of ext2/3/4) partition


Ah, good taste! What a dreadful thing! Taste is the enemy of creativeness.
Picasso
Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away.
Saint Exupéry

Offline

#3 2010-04-01 13:42:25

eirika
Member
From: New York
Registered: 2009-09-14
Posts: 65

Re: [SOLVED]installation: partition size FAIL, too small /var

In case that you don't want to do partition resize, there is a way to
make a loopback disk via a file on other partitions. Just figure out
the most space consuming directory and move them from  /var
to that virtual disk, and mount  it to the same path under /var.

this thread http://bbs.archlinux.org/viewtopic.php?id=20385
is a discuss about optimizing pacman performance, by putting
all the small files into a loopback file. I think the same idea
can be used here (look at the pacman-cage script).

Of course if you have more than one directories that take roughly
equal spaces this method would be tough/impractical.

Last edited by eirika (2010-04-01 13:43:05)

Offline

#4 2010-04-01 14:19:29

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SOLVED]installation: partition size FAIL, too small /var

If you keep an eye on your logs (and rotate and compress them) 1,5 GB is small but workable. If you like to keep your pacman cache, then you do need a bigger /var.

Cleaning out your pacman cache if you don't need it will free a lot of space already.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#5 2010-04-01 15:50:29

tomislavski
Member
Registered: 2010-02-09
Posts: 87

Re: [SOLVED]installation: partition size FAIL, too small /var

Thanks everyone! big_smile

@eirika
This seems as a great thing, the only problem is that I'm a worried newb and I need to get my numerics code on the laptop running smooth as  possible, as soon as possible. I will look into this for better performance, but I would like to have a properly sized /var anyway... one less thing to worry about...

This is what reverse sort of the

du -h /var

gives me:

1.1G    /var
993M    /var/cache
989M    /var/cache/pacman/pkg
989M    /var/cache/pacman
61M     /var/lib
44M     /var/lib/pacman
35M     /var/lib/pacman/sync
19M     /var/lib/pacman/sync/extra
17M     /var/lib/mlocate
15M     /var/log
15M     /var/lib/pacman/sync/community
9.3M    /var/lib/pacman/local
2.5M    /var/cache/man
1.4M    /var/lib/pacman/sync/core
1.1M    /var/cache/fontconfig
312K    /var/cache/hald252K    /var/lib/pacman/local/openoffice-base-3.2.0-1
180K    /var/lib/pacman/local/kernel26-2.6.32.10-1
172K    /var/lib/pacman/local/python-2.6.4-2
168K    /var/lib/pacman/local/xulrunner-1.9.2-4
132K    /var/lib/pacman/local/perl-5.10.1-5
124K    /var/lib/pacman/local/gimp-2.6.8-3
120K    /var/lib/pacman/local/man-pages-3.24-1
116K    /var/lib/pacman/local/ncurses-5.7-2.1
116K    /var/lib/pacman/local/gtkmm-2.18.2-1
112K    /var/lib/pacman/local/initscripts-2010.01-1
100K    /var/lib/pacman/local/xorg-fonts-75dpi-1.0.1-3
100K    /var/lib/pacman/local/xorg-fonts-100dpi-1.0.1-3
100K    /var/lib/pacman/local/openbox-themes-1.0.2-1
96K     /var/lib/pacman/local/gettext-0.17-3

I guess the pacman cache plays a role, obviously, and I can do this virtual directory stuff on the /var/cache. Cool. If this will speed things up, I will look into this.

@ChoK

I do have a large enough external USB HDD and I need to have a system backup on it, to sleep well. big_smile cfdisk : I've planed on using it to delete and resize the partitions /var and /home and then rsync the directories /var and /home from the external backup HDD back on these formated partitions. I'm sure I'm safe with /home, but for /var... again, I'm a newb: I know it's used fo logging and I'm not sure if the programs that are run at the shutdown moment of the system would mind a different timestamps on the files in /var?

Also when I run cfdisk /dev/sdb I see it holds an "archlinux-backup" labeled partition of 325 GB, but when I use

df -h /dev/sdb

I don't get the same size, I get 298 GB... that's weird and it worries me: I like to do these things right.

@.:B:.
Thank you, but I think that resizing the partition is the best solution, if I can do the things I've described above... I have so much to think about that keeping an eye of /var would be a blessing to avoid...


So, am I safe to rsync / , delete/create/reformat /var and /home, and rsync back from  the backup USB HDD?

Offline

#6 2010-04-01 16:14:58

tomislavski
Member
Registered: 2010-02-09
Posts: 87

Re: [SOLVED]installation: partition size FAIL, too small /var

yeah, I forgot:

/var format =  reiserfs V3

/home format = ext3

so will the resize2fs or resize_reiserfs work? I mean, if I use resize_reiserfs on /var and expand it forward, will this work? The two are adjacent to each other...

Thanks for any info...

Offline

#7 2010-04-01 20:18:53

tomislavski
Member
Registered: 2010-02-09
Posts: 87

Re: [SOLVED]installation: partition size FAIL, too small /var

O.K. I've resized the partitions successfuly, but Arch still sees them as they were. The "df -h" command still shows me the same partition sizes. I have tried using the "partprobe" command to make the system read the new partition table, but I had no success. This is what I've got:

[root@shakenbake tomislav]# partprobe
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy).
 As a result, it may not reflect all of your changes until after reboot.
[root@shakenbake tomislav]#

I will try to write down the partition table using a Live CD and maybe retry the partprobe command. I really could use some help on this...

Offline

#8 2010-04-01 21:47:49

tomislavski
Member
Registered: 2010-02-09
Posts: 87

Re: [SOLVED]installation: partition size FAIL, too small /var

Hi, me again.

Everything works: I've managed to resize the partitions manually using cfdisk and creating the filesystems.

Still, "df -h" doesn't seem to notice the difference. I have written the partition table to disk during the cfdisk session, but something is wrong.

Here's "fdisk -l":

[root@shakenbake tomislav]# fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7a3cfdca

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          61      489951   83  Linux
/dev/sda2              62        1885    14651280   83  Linux
/dev/sda3            1886        3101     9767520   83  Linux
/dev/sda4            3102       38913   287659890    5  Extended
/dev/sda5            3102        3648     4393746   82  Linux swap / Solaris
/dev/sda6            3649       38913   283266081   83  Linux
[root@shakenbake tomislav]#

here's "df -h":

[root@shakenbake tomislav]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              14G  2.5G   11G  19% /
udev                   10M  200K  9.9M   2% /dev
shm                   1.9G     0  1.9G   0% /dev/shm
/dev/sda1             464M   23M  418M   6% /boot
/dev/sda3             1.4G  1.2G  242M  84% /var
/dev/sda6             266G  1.7G  251G   1% /home
[root@shakenbake tomislav]#

and there's no swap in mount, although there is one in /etc/fstab:

[root@shakenbake tomislav]# cat /etc/fstab 
# 
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0

/dev/cdrom             /media/cd   auto    ro,user,noauto,unhide   0      0
/dev/dvd               /media/dvd  auto    ro,user,noauto,unhide   0      0
#/dev/fd0               /media/fl   auto    user,noauto             0      0

/dev/sda1 /boot ext3 defaults,noatime 0 1
/dev/sda2 / ext3 defaults,noatime 0 1
/dev/sda3 /var reiserfs defaults,noatime,notail 0 2
/dev/sda5 swap swap defaults 0 0
/dev/sda6 /home ext3 defaults,noatime 0 2
[root@shakenbake tomislav]#

"mount":

[root@shakenbake tomislav]# mount 
/dev/sda2 on / type ext3 (rw,noatime,commit=360)
udev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw)
shm on /dev/shm type tmpfs (rw,nosuid,nodev)
/dev/sda1 on /boot type ext3 (rw,noatime,commit=360)
/dev/sda3 on /var type reiserfs (rw,noatime,notail,commit=360)
/dev/sda6 on /home type ext3 (rw,noatime,commit=360)
[root@shakenbake tomislav]#

I didn't have to change /etc/fstab because the names of the partitions and the file systems remained the same after resizing.

The only thing that I've missed was the swap being actually between /var and /home but I've just moved everything by deleting/recreating/reformatting.

Why doesn't the kernel read from the written new partition table and still shows the wrong (old) sizes for the partitions?

I have done a system update, just to be sure, and as above in the "df -h" output, I've seen that my /var is now over 80% full, although I have resized it to 10 GB.

Although the swap is not mounted, I have tested it by using "pm-hibernate" and it works perfectly. It gets mounted and the session gets saved. I have some brightness issues there, but that's another problem... neutral

Any advice?

Offline

#9 2010-04-02 14:29:51

tomislavski
Member
Registered: 2010-02-09
Posts: 87

Re: [SOLVED]installation: partition size FAIL, too small /var

Solved it.

If someone needs to do this, first: write down or print the output of

"fstab -l"
and
"mount" of the original system partition layout. This way you will know what to change in the "/etc/fstab" if the creating and recreating of the partitions causes a change in their order (you wish to reorder the partitions).

I made a stupid mistake.

using live CD:

1) delete the partitions
2) resize the partitions
3) write the new partition table
4) create filesystems for the new ones -> forgot to do this for the /var partition sad
5*) if the partition numbers differ from the original ones, within the live CD mount the "/" and edit /etc/fstab and change the mount options.
6) reboot and it works.

"df -h" now shows correct available space as did "fdisk -l" because it relies on the filesystem information, and now the filesystem is correctly defined on the whole "/var". If in doubt, use "parted" on the live CD and use "check n" where "n" is the partition number in the "print list" table inside "parted" CLI.

All I had to do was to mkfs.reiserfs for the /dev/sda3 (/var mount point) and rsync the data on it (again). Now everything is working.

Offline

Board footer

Powered by FluxBB