Overclockers Australia Forums
OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Software Topics > Other Operating Systems

Notices


Sign up for a free OCAU account and this ad will go away!
Search our forums with Google:
Reply
 
Thread Tools
Old 25th August 2009, 8:28 PM   #1
foxmulder881 Thread Starter
Member
 
foxmulder881's Avatar
 
Join Date: Nov 2004
Location: Gold Coast, QLD OS:R.Hat
Posts: 5,845
Default /dev/sda2 < /dev/sda1

Is it possible to change sda2 to sda1?
foxmulder881 is offline   Reply With Quote

Join OCAU to remove this ad!
Old 26th August 2009, 10:04 AM   #2
MistaKa0s
Member
 
Join Date: Nov 2002
Posts: 51
Default

Quote:
Originally Posted by foxmulder881 View Post
Is it possible to change sda2 to sda1?
what are you trying to do exactly?

sda depicts the physical drive, and the suffix is numbered based on the partitions from the start of the drive.
eg

Code:
|<------- sda ------ >|
|<-sda1->|<-sda2->|
MistaKa0s is offline   Reply With Quote
Old 26th August 2009, 10:12 AM   #3
foxmulder881 Thread Starter
Member
 
foxmulder881's Avatar
 
Join Date: Nov 2004
Location: Gold Coast, QLD OS:R.Hat
Posts: 5,845
Default

Yeah I know. But I'll explain what I done. I've ditched Windows for now and have Ubuntu only running. Before I removed Windows I had:

Code:
sda1 ntfs windows
sda2 ext3 ubuntu
sda3 extended
sda5 linux swap
Now it looks like this:

Code:
sda2 ext3 ubuntu
sda3 extended
sda5 linux swap
So all I was curious about, is can I change sda2 to read as sda1 without anything being damaged. Obviously I 'd have to change grub config, but that's no biggie.
foxmulder881 is offline   Reply With Quote
Old 26th August 2009, 10:18 AM   #4
syx
Member
 
Join Date: Jul 2001
Location: Mount Gambier
Posts: 416
Default

Doesnt that mean that there is another partition before your new sda2 ppartition ?

Fire up gparted (if you dont have it, sudo apt-get install gparted) to have a look.

I am half guessing here so dont bet your data on my advice yet :P
__________________
"In the Morning !"
syx is offline   Reply With Quote
Old 26th August 2009, 10:34 AM   #5
MistaKa0s
Member
 
Join Date: Nov 2002
Posts: 51
Default

I think there's still a partition in front of sda2, otherwise it would've been picked up as sda1.

what does fdisk -l /dev/sda say?

You can probably merge sda1 and sda2 using parted (or qtparted/gparted etc), but sda1 should definitely still be there.
MistaKa0s is offline   Reply With Quote
Old 26th August 2009, 10:39 AM   #6
foxmulder881 Thread Starter
Member
 
foxmulder881's Avatar
 
Join Date: Nov 2004
Location: Gold Coast, QLD OS:R.Hat
Posts: 5,845
Default

No I removed sda1 because that's what partition Windows was installed on. And then I used GParted and grew sda2 from 80GB > 160GB to take over the freed space that was left by sda1.

Code:
chris@chris-desktop:~$ sudo fdisk -l /dev/sda

Disk /dev/sda: 163.9 GB, 163928604672 bytes
255 heads, 63 sectors/track, 19929 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x70855789

   Device Boot      Start         End      Blocks   Id  System
/dev/sda2               1       19752   158657908+  83  Linux
/dev/sda3           19753       19929     1421752+   5  Extended
/dev/sda5           19753       19929     1421721   82  Linux swap / Solaris
Exactly as I knew it was.
foxmulder881 is offline   Reply With Quote
Old 26th August 2009, 10:44 AM   #7
syx
Member
 
Join Date: Jul 2001
Location: Mount Gambier
Posts: 416
Default

Bugger me.

You'll need someone cleverer than me to answer then !
__________________
"In the Morning !"
syx is offline   Reply With Quote
Old 26th August 2009, 12:55 PM   #8
Crinos
Member
 
Crinos's Avatar
 
Join Date: Jul 2002
Location: Tasmania
Posts: 4,019
Default

You shouldn't rely on the numbers anyway... label the partitions and use that for mounting, e.g.

Code:
# e2label /dev/sda2 qwerty

/etc/fstab:
Replace
/dev/sda2    /mnt/qwerty    ext3    defaults    0 0
with:
LABEL=qwerty /mnt/qwerty    ext3    defaults    0 0
That's if you don't use LVM, then it's even better. Partition numbers are a crappy way to manage mounting filesystems, but in any case, it doesn't matter what number it is, as long as it's persistent...
__________________
OCAU MetaL Club Member #666 | last.fm
2005: Megadeth | 2006: Opeth | 2007: Blind Guardian, Sodom | 2008: Iron Maiden | 2009: Pain of Salvation, Dream Theater
2010: Ensiferum, Sonata Arctica, Wolves in the Throne Room
Crinos is offline   Reply With Quote
Old 26th August 2009, 1:06 PM   #9
syx
Member
 
Join Date: Jul 2001
Location: Mount Gambier
Posts: 416
Default

Does that mean that when you take some sata drives out and maybe plug them into different ports they still mount fine ?

Also does it mean you can reinstall the os and put that same line in fstab and it will pick up the label name from the drive ? Or is the label name stored in the os ?

Thanks
__________________
"In the Morning !"
syx is offline   Reply With Quote
Old 26th August 2009, 1:13 PM   #10
BIPyjamas
Member
 
BIPyjamas's Avatar
 
Join Date: Jun 2001
Location: Sydney, Australia
Posts: 620
Default

The label name is stored as part of the filesystem, so it's intrinsic to the disk.

I personally don't use labels as they don't tell me which partition is being used at a glance. It seems more intuitive to use LVM and name the logical partitions in a nice way such as /dev/VolGroup00/home as an example.

EDIT: Forgot to mention that labels are handy when you have multiple drives to prevent boot issues that might occur when udev feels like swapping your drive references around.

Last edited by BIPyjamas; 26th August 2009 at 1:19 PM.
BIPyjamas is offline   Reply With Quote
Old 26th August 2009, 1:24 PM   #11
Bort
Member
 
Bort's Avatar
 
Join Date: Jun 2001
Location: Melbourne
Posts: 1,326
Default

I've found the various sda1, sda2 labels just appear in the order the partitions were created. Following from ubuntu's practice, I use the UUID string to keep consistency in after moving around partitions.
__________________
Steve's Ubuntu Tweaks || Flickr

Intel i7-3770K | ASRock Z77 Extreme4-M | 8GB G.Skill 1600 | Gigabyte GTX 560 | Samsung 830 120GB SSD | Seagate 2TB HDD
Bort is offline   Reply With Quote
Old 26th August 2009, 4:06 PM   #12
Drunkmunky
Member
 
Drunkmunky's Avatar
 
Join Date: Jun 2006
Location: Hobart
Posts: 1,843
Default

UUID all the way
Drunkmunky is offline   Reply With Quote
Old 26th August 2009, 9:04 PM   #13
foxmulder881 Thread Starter
Member
 
foxmulder881's Avatar
 
Join Date: Nov 2004
Location: Gold Coast, QLD OS:R.Hat
Posts: 5,845
Default

Quote:
Originally Posted by Bort View Post
I've found the various sda1, sda2 labels just appear in the order the partitions were created. Following from ubuntu's practice, I use the UUID string to keep consistency in after moving around partitions.
This is exactly how it works and how it has worked out for me. It's not really a big deal anyway. I think I'll just leave it be for now, until I reinstall when Karmic goes gold.
foxmulder881 is offline   Reply With Quote
Reply

Bookmarks

Sign up for a free OCAU account and this ad will go away!

Thread Tools

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 On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 7:37 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. -
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Internode!