주절주절

Ubuntu에서 LG-NAS 하드디스크 마운트시키기

트릭맨 2016. 2. 3. 14:07

Ubuntu에서 LG-NAS 하드디스크 마운트시키기


HDD를 리눅스 서버에 먼저 연결했다.

부팅 후 fdisk 명령으로 확인해 보니 해당 디스크가 GPT 라고 표시가 되어 있다.

물론 fdisk 명령으로는 GPT를 지원하지 못한다는 문구와 함께..ㅠㅠ


root@elf1:/mnt# fdisk -l


Disk /dev/sda: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 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: 0x00045baa


   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1       58336   468581376   83  Linux

/dev/sda2           58336       60802    19802113    5  Extended

/dev/sda5           58336       60802    19802112   82  Linux swap / Solaris


Disk /dev/sdb: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 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: 0x858f35f5


   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1       60801   488384001   83  Linux


WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.



Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes

255 heads, 63 sectors/track, 121601 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: 0x00000000


   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1               1      121602   976762583+  ee  GPT

root@elf1:/mnt# 



그럼에도 불구하고 GPT를 마운트 하는 방법을 구글링해서 마운트를 시도해 보았다.

GPT는 NTFS 파일시스템으로 마운트하면 된다고 해서 아래처럼 마운트했다.



jskwak@elf1:~$ sudo blkid /dev/sdc1

[sudo] password for jskwak: 

/dev/sdc1: UUID="576fd8e9-c8ad-b1b5-bafa-a0fd3edaa250" TYPE="linux_raid_member" 


jskwak@elf1:~$ sudo mount -t ntfs-3g /dev/sdc1 /mnt

NTFS signature is missing.

Failed to mount '/dev/sdc1': Invalid argument

The device '/dev/sdc1' doesn't seem to have a valid NTFS.

Maybe the wrong device is used? Or the whole disk instead of a

partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?



그랬더니 위의 메시지 처럼 정상적인 NTFS가 아니라고 나오고 디바이스에 문제가 

있는 것처럼 보이다나....절망...

여기에서 좌절하지 않고 다시 구글링을 시도했다.

검색 : linux GPT mount NTFS signature is missing


어떤 사람의 대답이 "parted -l" 로 해보라는 것이다.

그래서 parted 명령으로 다시 확인했다.


root@elf1:~# parted -l

Model: ATA ST500NM0011 (scsi)

Disk /dev/sda: 500GB

Sector size (logical/physical): 512B/512B

Partition Table: msdos


Number  Start   End    Size    Type      File system     Flags

 1      1049kB  480GB  480GB   primary   ext4            boot

 2      480GB   500GB  20.3GB  extended

 5      480GB   500GB  20.3GB  logical   linux-swap(v1)



Model: ATA HUA722050CLA330 (scsi)

Disk /dev/sdb: 500GB

Sector size (logical/physical): 512B/512B

Partition Table: msdos


Number  Start   End    Size   Type     File system  Flags

 1      32.3kB  500GB  500GB  primary  ext4



Model: ATA Hitachi HDS72101 (scsi)

Disk /dev/sdc: 1000GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt


Number  Start   End     Size    File system     Name     Flags

 1      1000MB  24.0GB  23.0GB  ext3            system   raid

 2      24.0GB  32.0GB  8001MB  linux-swap(v1)  primary  raid

 3      32.0GB  1000GB  968GB   ext4            primary  raid



오호!!!

/dev/sdc는 3개의 파티션으로 나누어져 있는 것을 알았다...빙고...

물론 NTFS 파일시스템도 아니었다. 내가 원하는 데이터가 있는 영역인

/dev/sdc3는 ext4 파일시스템임을 알았다..

ext4 파일시스템으로 해당 파티션을 마운트하고 데이터가 정상적으로

있는 것을 확인했다..ㅋㅋㅋ



root@elf1:~# mount -t ext4 /dev/sdc3 /mnt

root@elf1:~# cd /mnt

root@elf1:/mnt# ls -la

total 17392

drwxr-xr-x 14 root     root             4096 2015-11-20 21:09 .

drwxr-xr-x 25 root     root             4096 2015-03-16 17:21 ..

-rw-------  1 root     root             7168 2015-12-30 18:21 aquota.user

-rw-r--r--  1 root     root     429491220480 2015-12-30 14:21 backing_file

drwxrwxrwx  2 root     root             4096 2012-04-25 01:22 DRM

drwxrwxrwx  2 root     root             4096 2012-04-25 01:22 FamilyCast

drwxrwxrwx  5 root     root             4096 2013-11-20 15:08 Multimedia

drwxrwxrwx  2 root     root             4096 2031-01-11 13:58 MyDisc

drwxrwxrwx  3 couchdb  ssh              4096 2013-09-13 22:15 mysql

drwxrwxrwx  2 root     root             4096 2012-04-25 00:45 myweb

drwxrwxrwx  2 root     root             4096 2012-04-25 01:22 preload

drwxr-xr-x  6 root     root             4096 2031-01-11 13:58 service

drwxrwxrwx 10 root     root             4096 2015-04-06 11:41 Share

drwxr-xr-x  2 root     root             4096 2012-04-25 01:21 .sys

drwx------  2 www-data www-data         4096 2012-05-18 21:23 .webtmp

drwxrwxrwx  2 root     root             4096 2031-01-11 13:58 x-hdd




***[tip]***

이미 눈치 채신 분들도 있겠지만 LG-NAS의 OS 영역은 /dev/sdc1의 ext3파일시스템으로

되어 있다.

# mount -t ext3 /dev/sdc1 /nas

명령으로 해당 파티션을 마운트해서 /nas/etc/shadow 파일을 편집하면 

리모트에서 root 계정으로 들어갈 수 있다. ㅋㅋㅋ