LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-16-2009, 10:45 AM   #1
onesikgypo
Member
 
Registered: Jun 2008
Posts: 56

Rep: Reputation: 15
Partition Question - after fdisk'ing cant mount/unmount


Hi,

On the system i originally have:

Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             141G  2.2G  132G   2% /
tmpfs                 2.0G     0  2.0G   0% /dev/sh
my ultimate goal is to have a partition encrypted (LUKS), whilst leaving the boot the same. So what i wanted to do was have the unencrypted partition pointing to / and the encrypted partition pointing to /home.

So first i did fdisk and made the partitions and such:

Code:
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-18946, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-18946, default 18946): +10000M

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (1218-18946, default 1218):
Using default value 1218
Last cylinder or +size or +sizeM or +sizeK (1218-18946, default 18946):
Using default value 18946
Next i made the first partition the bootable partition, so finally fdisk showed the following:

Code:
Command (m for help): p

Disk /dev/sda1: 155.8 GB, 155844347904 bytes
255 heads, 63 sectors/track, 18946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

     Device Boot      Start         End      Blocks   Id  System
/dev/sda1p1   *           1        1217     9775521   83  Linux
/dev/sda1p2            1218       18946   142408192+  83  Linux

Command (m for help): w
The partition table has been altered!
I then rebooted the server.

Now when the server came back up, df -h still showed:

Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             141G  2.2G  132G   2% /
tmpfs                 2.0G     0  2.0G   0% /dev/shm
and fdisk still showed the two partitions.


Now i tried to mount /dev/sda1p2 but got an error:

Code:
mount /dev/sda1p2 /test
mount: special device /dev/sda1p2 does not exist
Next i tried making a fs on it:

Code:
# mkfs.ext3 /dev/sda1p2
mke2fs 1.39 (29-May-2006)
Could not stat /dev/sda1p2 --- No such file or directory

The device apparently does not exist; did you specify it correctly?

any assistance would be greatly appreciated.

Thankyou.
 
Old 09-16-2009, 10:54 AM   #2
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 67
You want to run fdisk on /dev/sda, not /dev/sda1.

You somehow told it to create subpartitions within the first partition on your disk =(

Also, you can't be doing this booted from the harddisk you're altering. You need to do it from some sort of bootcd (The ubuntu live cd will do just fine). In fact, with the ubuntu live cd, you can probably just resize your existing root partition without having to blow all of your stuff away. Then you can install cryptsetup, setup your encrypted home partition. Then modify your /etc/fstab and /etc/crypttab entries on the root partition.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unmount a FTP mount? twproductions Linux - Server 1 01-24-2008 07:15 AM
Mount and unmount Hargibi Linux - Software 9 09-26-2005 08:11 AM
mount and unmount d1l2w3 Linux - Hardware 4 05-15-2005 08:32 AM
mount / unmount Lostman Linux - Newbie 3 11-09-2003 01:15 AM
mount - unmount? randon Red Hat 3 10-10-2003 01:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration