Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

The question I have is a little complicated, I'll try to walk you through the problem:

Basically, I installed Ubuntu 11.10 onto a USB thumb drive that I formatted as an ext2 partition. I didn't want to go the Live USB route because I wanted full control over all the files on the partition. Because I installed it on a USB stick I chose not to create a swap partition (to decrease disk I/O and because I wouldn't want to hibernate my USB stick anyway).

Aside from that, I own an Asus EEE PC netbook that is running Oneiric as well, but obviously with a separate swap partition.

Now, my problem is as follows: Whenever I decide to boot up Ubuntu from my USB stick (whose partition table doesn't include a swap partition or any partition outside of the USB stick), that seems to corrupt the swap partition on my netbook. I'm not sure as to why or how that happens, but basically when I boot back into my regular Ubuntu on my netbook, it tells me that the headers of the swap partition are wrong/corrupt (I don't remember the exact wording). In order to get my swap partition working again, I then have to:

sudo mkswap /dev/sda8 [my swap partition] && sudo swapon -a

This workaround is fine, but it's a real hassle. Also, it gets me thinking what might happen to other people's systems if I put my USB stick in their computer. I haven't tried that yet, but it seems a real possibility that it might screw with their setup as well.

Anyhow, I really have no idea what's going on because the fstab on my USB thumb drive doesn't mention a swap partition, but I'm guessing something must be going wrong when Ubuntu does a disk scan to check for mountable partitions.

Any thoughts?

share|improve this question
    
Well, it does a swapon -a during boot, but that reads from /etc/fstab... Has your other partition on your netbook gotten corrupted at all? Also, does your flash drive installation use an encrypted home? –  Githlar Feb 20 '12 at 17:51
    
hey, no other partitions have been corrupted. i do use an encrypted home, though, so i guess that's what might be causing it. –  user47246 Feb 20 '12 at 23:09

1 Answer 1

up vote 0 down vote accepted

Comment out the line in /etc/crypttab on your flash drive install.

If you set up encryption on your flash drive install, then it looked for swap and securely wiped it. The actual swap definition is in /etc/crypttab and refers to a device rather than a UUID like you'll see in /etc/fstab on a non-encrypted Ubuntu install.

If this is true, it should probably be a bug. Because you probably didn't tell it to use the swap partition on your netbook during the install process (default is "Don't use")

share|improve this answer
    
that's interesting, i didn't realize there's a separate partition table for encrypted partitions. so it might be a bug, you're right, but at least this will help me fix it. if it works, i'll vote up your answer. –  user47246 Feb 20 '12 at 23:10
    
ok, so there really was an entry for a "cryptswap" partition in /etc/crypttab which pointed to /dev/sda8, so that was what was causing the corruption. i commented it out and now everything works fine, thanks a bunch. –  user47246 Feb 20 '12 at 23:42
    
Come back and see me sometime! –  Githlar Feb 20 '12 at 23:44
    

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.