# tuxonice and lvm partition, no esacpe in using initrd?

## DaggyStyle

I'm using TOI-src, my root partition is normal reiserfs but var, home and swap are lvm.

I can hibernate (for the first time since I've had linux) but upon trying to resume, I get a error that some of the partitions are lvm and that I probably needs to setup initrd. is there no other way to use TOI without creating initrd?

----------

## MotivatedTea

As far as I know, TuxOnIce doesn't understand LVM. So, if you don't want to use an initrd, then your kernel and wherever TuxOnIce stores your hibernation data (which may be a swap partition or a file) must be on a non-LVM partition. I don't use an initrd, so I made sure my / partition includes /boot and a swapfile large enough for hibernation. The rest of my drive is (Windows and) a large LVM2 partition. You could also use a swap partition instead of a swap file.

----------

## Hu

Using an initrd is the simplest solution.  Is there some specific problem that prevents you from using one?

----------

## DaggyStyle

 *MotivatedTea wrote:*   

> As far as I know, TuxOnIce doesn't understand LVM. So, if you don't want to use an initrd, then your kernel and wherever TuxOnIce stores your hibernation data (which may be a swap partition or a file) must be on a non-LVM partition. I don't use an initrd, so I made sure my / partition includes /boot and a swapfile large enough for hibernation. The rest of my drive is (Windows and) a large LVM2 partition. You could also use a swap partition instead of a swap file.

 

I using a swap partition which isn't lvm, but still it wont resume.

 *Quote:*   

> 
> 
> Using an initrd is the simplest solution. Is there some specific problem that prevents you from using one?
> 
> 

 

from what I've understood, creating a initrd generates a file which takes room, I don't know how much and I don't want to fill up my boot partition.

moreover, I've made loops in the air so I won't have to use initrd... (like installing the systems 3 times...)

----------

## tuber

I have an compressed initramfs that takes up a little under 1MB.

----------

## MotivatedTea

In your first post you said your swap was on LVM. Can you check that? What are the outputs of "fdisk -l", and "lvdisplay" and what does your "/etc/fstab" look like? If you are trying to save space, you're probably better off going with an initrd, since then you can have a small boot partition and you can put your swap on LVM. If you don't want to use an initrd then you either need a large non-LVM boot partition with a swapfile, or a physical swap partition. The size of your initrd will depend on your kernel configuration. Generic distributions like Debian tend to have large initrds because they need to include kernel modules for every conceivable piece of hardware that someone might want to boot from. If you're configuring your own kernel, you'll probably have a much smaller initrd, as tuber says.

----------

## DaggyStyle

 *MotivatedTea wrote:*   

> In your first post you said your swap was on LVM. Can you check that? What are the outputs of "fdisk -l", and "lvdisplay" and what does your "/etc/fstab" look like? If you are trying to save space, you're probably better off going with an initrd, since then you can have a small boot partition and you can put your swap on LVM. If you don't want to use an initrd then you either need a large non-LVM boot partition with a swapfile, or a physical swap partition. The size of your initrd will depend on your kernel configuration. Generic distributions like Debian tend to have large initrds because they need to include kernel modules for every conceivable piece of hardware that someone might want to boot from. If you're configuring your own kernel, you'll probably have a much smaller initrd, as tuber says.

 

damm, your right, I've forgot to mention it...

well, I have two swap partitions, one under lvm which the system uses and another not under lvm which is used for resume.

here are the outputs:

```

dagg@NCC-5001-D ~ $ fdisk -l /dev/sda          

Disk /dev/sda: 250.1 GB, 250059350016 bytes

255 heads, 63 sectors/track, 30401 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x70787078                     

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1        3824    30716248+   7  HPFS/NTFS

/dev/sda2            3825        4461     5116702+   c  W95 FAT32 (LBA)

/dev/sda3            4462        4475      112455   83  Linux          

/dev/sda4            4476       30401   208250595    5  Extended       

/dev/sda5            4476        8392    31463271   83  Linux          

/dev/sda6            8393        8661     2160711   82  Linux swap / Solaris

/dev/sda7            8662       30401   174626518+  8e  Linux LVM           

                                                    

dagg@NCC-5001-D ~ $ lvdisplay                                               

                                  

  --- Logical volume ---                                                       

  LV Name                /dev/mainframe/swap                                   

  VG Name                mainframe                                             

  LV UUID                CcZlBb-jQ23-Z9Kj-gOrk-otNA-QQCj-eLsceo                

  LV Write Access        read/write                                            

  LV Status              available                                             

  # open                 1                                                     

  LV Size                1.50 GB                                               

  Current LE             384                                                   

  Segments               1                                                     

  Allocation             inherit                                               

  Read ahead sectors     auto                                                  

  - currently set to     256                                                   

  Block device           253:0                                                 

                                                                               

  --- Logical volume ---                                                       

  LV Name                /dev/mainframe/home                                   

  VG Name                mainframe                                             

  LV UUID                kOlv7k-BL5v-JTLe-yIpT-daCJ-LhI7-xv4805                

  LV Write Access        read/write                                            

  LV Status              available                                             

  # open                 2                                                     

  LV Size                65.00 GB                                              

  Current LE             16640                                                 

  Segments               1                                                     

  Allocation             inherit                                               

  Read ahead sectors     auto                                                  

  - currently set to     256                                                   

  Block device           253:1                                                 

                                                                               

  --- Logical volume ---                                                       

  LV Name                /dev/mainframe/var                                    

  VG Name                mainframe                                             

  LV UUID                c5DS5n-Ya69-HMCF-UkWn-9lL0-82hr-cMvP1B                

  LV Write Access        read/write                                            

  LV Status              available                                             

  # open                 2                                                     

  LV Size                10.00 GB                                              

  Current LE             2560                                                  

  Segments               1                                                     

  Allocation             inherit                                               

  Read ahead sectors     auto                                                  

  - currently set to     256                                                   

  Block device           253:2                                                 

                                                                               

  --- Logical volume ---                                                       

  LV Name                /dev/mainframe/media                                  

  VG Name                mainframe                                             

  LV UUID                2wizQG-KU3w-HYMS-vqsM-4j4Z-zy1U-ubx3vV                

  LV Write Access        read/write                                            

  LV Status              available                                             

  # open                 2                                                     

  LV Size                90.04 GB                                              

  Current LE             23049                                                 

  Segments               1                                                     

  Allocation             inherit                                               

  Read ahead sectors     auto                                                  

  - currently set to     256                                                   

  Block device           253:3                                                 

                                                                               

dagg@NCC-5001-D ~ $ cat /etc/fstab                                             

# /etc/fstab: static file system information.                                  

#                                                                              

# noatime turns off atimes for increased performance (atimes normally aren't   

# needed; notail increases performance of ReiserFS (at the expense of storage  

# efficiency).  It's safe to drop the noatime options if you want and to       

# switch between notail / tail freely.                                         

#                                                                              

# The root filesystem should have a pass number of either 0 or 1.              

# All other filesystems should have a pass number of 0 or greater than 1.      

#                                                                              

# See the manpage fstab(5) for more information.                               

#                                                                              

# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/sda3               /boot           ext3            noauto,noatime  1 2

/dev/sda5               /               reiserfs        noatime         0 1

/dev/mainframe/swap     none            swap            sw              0 0

/dev/dvd                /mnt/dvd        auto            noauto,user,rw  0 0

/dev/mainframe/home     /home           reiserfs        noatime,user,exec       0 0

/dev/mainframe/var      /var            reiserfs        noatime         0 0

/dev/mainframe/media    /mnt/media      reiserfs        noatime,user    0 0

/dev/sda2               /mnt/shared     vfat            umask=0000,user,defaults,iocharset=iso8859-8,codepage=862 0 0 #=utf8,codepage=1255,utf8=true            0 0

/dev/sdb                /mnt/msd        auto            noauto,user,exec  0 0

/dev/mmcblk0p1          /mnt/dcr        auto            noauto,user,exec,iocharset=iso8859-8,codepage=862        0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for

# POSIX shared memory (shm_open, shm_unlink).

# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will

#  use almost no memory if not populated with files)

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

```

I suspend into sda6

----------

## MotivatedTea

As far as I can tell, what you're trying to do should work. Try two things:

1) Make sure your physical swap is mounted before you try to hibernate ("swapon /dev/sda6"). You don't have that listed in your /etc/fstab, so it won't get mounted automatically. (If you don't want to use it except for swap, then you can have your hibernation config files mount it before hibernating and unmount it after resuming.)

2) Just to see if it makes a difference, try unmounting your LVM swap so that you only have physical swap mounted before you hibernate. This shouldn't be necessary, but maybe TuxOnIce is getting confused.

----------

## DaggyStyle

 *MotivatedTea wrote:*   

> As far as I can tell, what you're trying to do should work. Try two things:
> 
> 1) Make sure your physical swap is mounted before you try to hibernate ("swapon /dev/sda6"). You don't have that listed in your /etc/fstab, so it won't get mounted automatically. (If you don't want to use it except for swap, then you can have your hibernation config files mount it before hibernating and unmount it after resuming.)
> 
> 2) Just to see if it makes a difference, try unmounting your LVM swap so that you only have physical swap mounted before you hibernate. This shouldn't be necessary, but maybe TuxOnIce is getting confused.

 

I think that if sda6 wasn't mount, toi wouldn't have been able to suspend. not in this case.

also, upon resume, I get a msg that says clearly that toi has found a bin suspend image...

----------

## MotivatedTea

TOI can't resume from swap on LVM, but it can (uselessly) suspend to it. That's why I suggested making sure that /dev/sda6 is mounted and /dev/mainframe/swap is not. I'm not suggesting that as a permanent solution - just as a way of making absolutely sure that TOI is writing to the correct swap partition. Of course, also check that you have the right values for "SuspendDeive" in /etc/hibernate/tuxonice.conf and for the "resume=" parameter in GRUB -- but I figured you had checked those already.

----------

## DaggyStyle

 *MotivatedTea wrote:*   

> TOI can't resume from swap on LVM, but it can (uselessly) suspend to it. That's why I suggested making sure that /dev/sda6 is mounted and /dev/mainframe/swap is not. I'm not suggesting that as a permanent solution - just as a way of making absolutely sure that TOI is writing to the correct swap partition. Of course, also check that you have the right values for "SuspendDeive" in /etc/hibernate/tuxonice.conf and for the "resume=" parameter in GRUB -- but I figured you had checked those already.

 

the grub parameter is right but the SuspendDevice wasn't set, will try and report back

----------

## DaggyStyle

no go, I've to a error -6, cant get to access or something like that

----------

